Blob Blame History Raw
diff --git a/rel-eng/packages/subscription-manager b/rel-eng/packages/subscription-manager
index ba45018..25c7507 100644
--- a/rel-eng/packages/subscription-manager
+++ b/rel-eng/packages/subscription-manager
@@ -1 +1 @@
-1.15.9-13 ./
+1.15.9-14 ./
diff --git a/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py b/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
index 131bc9b..0f96db5 100644
--- a/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
+++ b/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
@@ -73,6 +73,8 @@ class RHSMSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
 
         backend = managergui.Backend()
         self.info = registergui.RegisterInfo()
+        # BZ 1267322 Set the registration status message
+        self._status_message = self.info.get_registration_status()
         self.register_widget = registergui.RegisterWidget(backend, facts,
                                                           reg_info=self.info,
                                                           parent_window=self.main_window)
diff --git a/src/subscription_manager/gui/data/glade/register_dialog.glade b/src/subscription_manager/gui/data/glade/register_dialog.glade
index 454d463..04b49b5 100644
--- a/src/subscription_manager/gui/data/glade/register_dialog.glade
+++ b/src/subscription_manager/gui/data/glade/register_dialog.glade
@@ -19,6 +19,25 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="label" translatable="yes">Close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="close_button-atkobject">
+                    <property name="AtkObject::accessible-name" translatable="yes">close_button</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkButton" id="back_button">
                 <property name="label">gtk-go-back</property>
                 <property name="visible">True</property>
@@ -35,7 +54,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -57,7 +76,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
           </object>
@@ -74,6 +93,7 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="0">cancel_button</action-widget>
       <action-widget response="0">back_button</action-widget>
       <action-widget response="0">register_button</action-widget>
     </action-widgets>
diff --git a/src/subscription_manager/gui/data/ui/register_dialog.ui b/src/subscription_manager/gui/data/ui/register_dialog.ui
index 3099ddc..0730800 100644
--- a/src/subscription_manager/gui/data/ui/register_dialog.ui
+++ b/src/subscription_manager/gui/data/ui/register_dialog.ui
@@ -27,10 +27,30 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="margin_left">4</property>
-            <property name="margin_right">5</property>
+            <property name="margin_right">4</property>
             <property name="margin_top">4</property>
             <property name="margin_bottom">4</property>
             <property name="hexpand">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="label" translatable="yes">Close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="close_button-atkobject">
+                    <property name="AtkObject::accessible-name" translatable="yes">close_button</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkButton" id="back_button">
                 <property name="label">gtk-go-back</property>
@@ -47,7 +67,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -58,7 +78,6 @@
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
                 <property name="receives_default">True</property>
-                <property name="image_position">right</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="register_button-atkobject">
                     <property name="AtkObject::accessible-name" translatable="yes">register_button</property>
@@ -69,7 +88,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child internal-child="accessible">
diff --git a/src/subscription_manager/gui/data/ui/selectsla.ui b/src/subscription_manager/gui/data/ui/selectsla.ui
index 5093209..cce6375 100644
--- a/src/subscription_manager/gui/data/ui/selectsla.ui
+++ b/src/subscription_manager/gui/data/ui/selectsla.ui
@@ -1,22 +1,22 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <object class="GtkTextBuffer" id="textbuffer1">
-    <property name="text">Your installed products could be covered using one of multiple service levels.</property>
-  </object>
-  <!-- interface-requires gtk+ 2.10 -->
-  <!-- interface-naming-policy project-wide -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkBox" id="container">
-    <property name="orientation">vertical</property>
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="spacing">7</property>
+    <property name="orientation">vertical</property>
     <child>
       <object class="GtkLabel" id="label3">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="xalign">0</property>
+        <property name="halign">start</property>
         <property name="label" translatable="yes">&lt;b&gt;Select Service Level&lt;/b&gt;</property>
         <property name="use_markup">True</property>
+        <property name="wrap">True</property>
+        <property name="ellipsize">end</property>
+        <property name="max_width_chars">64</property>
+        <property name="xalign">0</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -26,25 +26,32 @@
     </child>
     <child>
       <object class="GtkBox" id="vbox2">
-        <property name="orientation">vertical</property>
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">12</property>
+        <property name="hexpand">False</property>
+        <property name="vexpand">False</property>
+        <property name="orientation">vertical</property>
         <child>
-          <object class="GtkTextView" id="detection_label">
+          <object class="GtkLabel" id="label1">
             <property name="visible">True</property>
-            <property name="sensitive">False</property>
             <property name="can_focus">False</property>
-            <property name="editable">False</property>
-            <property name="wrap_mode">word</property>
-            <property name="left_margin">10</property>
-            <property name="right_margin">10</property>
-            <property name="cursor_visible">False</property>
-            <property name="accepts_tab">False</property>
-            <property name="buffer">textbuffer1</property>
+            <property name="margin_left">8</property>
+            <property name="margin_right">8</property>
+            <property name="margin_top">4</property>
+            <property name="margin_bottom">4</property>
+            <property name="label" translatable="yes">Your installed products could be covered using one of multiple service levels.</property>
+            <property name="wrap">True</property>
+            <property name="ellipsize">end</property>
+            <property name="max_width_chars">64</property>
+            <property name="lines">4</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <attributes>
+              <attribute name="background" value="#ffffffffffff"/>
+            </attributes>
           </object>
           <packing>
-            <property name="expand">False</property>
+            <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
@@ -53,111 +60,88 @@
           <object class="GtkLabel" id="detected_products_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0</property>
+            <property name="halign">start</property>
+            <property name="valign">start</property>
             <property name="xpad">10</property>
             <property name="label" translatable="yes">&lt;b&gt;Installed products:&lt;/b&gt;</property>
             <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <property name="ellipsize">middle</property>
+            <property name="max_width_chars">64</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">1</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
           <object class="GtkLabel" id="product_list_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0</property>
+            <property name="margin_top">4</property>
+            <property name="margin_bottom">4</property>
             <property name="xpad">25</property>
-            <property name="label" translatable="yes">prod 1, prod2, prod 3, prod 4, prod 5, prod 6, prod 7, prod 8</property>
+            <property name="label" translatable="yes">Awesome OS 14, Awesome OS 14 Super Edition, Awesome Middle Ware For Awesome App Platform Awesome Developer Editition</property>
             <property name="use_markup">True</property>
             <property name="wrap">True</property>
+            <property name="max_width_chars">64</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">2</property>
+            <property name="position">3</property>
           </packing>
         </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkGrid" id="grid2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child>
-          <object class="GtkLabel" id="subscribe_all_as_label">
+          <object class="GtkComboBox" id="sla_combobox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0</property>
-            <property name="xpad">10</property>
-            <property name="label" translatable="yes">&lt;b&gt;Select a common service level for this system's subscriptions:&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">3</property>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1">
+          <object class="GtkLabel" id="subscribe_all_as_label">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hscrollbar_policy">automatic</property>
-            <property name="vscrollbar_policy">automatic</property>
-            <child>
-              <object class="GtkViewport" id="viewport1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="resize_mode">queue</property>
-                <property name="shadow_type">none</property>
-                <child>
-                  <object class="GtkBox" id="sla_radio_container">
-                    <property name="orientation">vertical</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">4</property>
-                    <child>
-                      <object class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">label</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label2">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">label</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
+            <property name="can_focus">False</property>
+            <property name="halign">start</property>
+            <property name="valign">start</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">&lt;b&gt;Select a common service level for this system's subscriptions:&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <property name="max_width_chars">32</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
           </object>
           <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">4</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
           </packing>
         </child>
       </object>
       <packing>
-        <property name="expand">True</property>
+        <property name="expand">False</property>
         <property name="fill">True</property>
-        <property name="position">1</property>
+        <property name="position">2</property>
       </packing>
     </child>
   </object>
diff --git a/src/subscription_manager/gui/managergui.py b/src/subscription_manager/gui/managergui.py
index 8f3ddb4..8a0498e 100644
--- a/src/subscription_manager/gui/managergui.py
+++ b/src/subscription_manager/gui/managergui.py
@@ -359,9 +359,20 @@ class MainWindow(widgets.SubmanBaseWidget):
 
     def _register_item_clicked(self, widget):
         registration_dialog = registergui.RegisterDialog(self.backend, self.facts)
+        registration_dialog.register_dialog.connect('destroy',
+                                                    self._on_dialog_destroy,
+                                                    widget)
+
+        if registration_dialog and widget:
+            widget.set_sensitive(False)
+
         registration_dialog.initialize()
         registration_dialog.show()
 
+    def _on_dialog_destroy(self, obj, widget):
+        widget.set_sensitive(True)
+        return False
+
     def _preferences_item_clicked(self, widget):
         try:
             self.preferences_dialog.show()
@@ -425,8 +436,14 @@ class MainWindow(widgets.SubmanBaseWidget):
         self.import_sub_dialog.show()
 
     def _update_certificates_button_clicked(self, widget):
-        autobind_wizard = registergui.AutobindWizardDialog(self.backend,
-                                                           self.facts)
+        autobind_wizard = registergui.AutobindWizardDialog(self.backend, self.facts)
+        autobind_wizard.register_dialog.connect('destroy',
+                                                self._on_dialog_destroy,
+                                                widget)
+
+        if autobind_wizard and widget:
+            widget.set_sensitive(False)
+
         autobind_wizard.initialize()
         autobind_wizard.show()
 
diff --git a/src/subscription_manager/gui/registergui.py b/src/subscription_manager/gui/registergui.py
index a07a646..5dc5676 100644
--- a/src/subscription_manager/gui/registergui.py
+++ b/src/subscription_manager/gui/registergui.py
@@ -190,6 +190,12 @@ class RegisterInfo(ga_GObject.GObject):
         self.set_property('port', CFG.get('server', 'port'))
         self.set_property('prefix', CFG.get('server', 'prefix'))
 
+    def get_registration_status(self):
+        msg = _("This system is currently not registered.")
+        if self.identity and self.identity.is_valid():
+            msg = _("System Already Registered")
+        return msg
+
 
 class RegisterWidget(widgets.SubmanBaseWidget):
     gui_file = "registration"
@@ -358,7 +364,7 @@ class RegisterWidget(widgets.SubmanBaseWidget):
         self.info.set_property('register-status', msg)
 
     def do_register_finished(self):
-        msg = _("The system has been registered with ID: %s ") % self.info.identity.uuid
+        msg = _("System '%s' successfully registered.\n") % self.info.identity.name
         self.info.set_property('register-status', msg)
 
     def do_finished(self):
@@ -402,6 +408,8 @@ class RegisterWidget(widgets.SubmanBaseWidget):
 
         if self.info.identity.is_valid():
             self.emit('register-finished')
+            msg = _("System '%s' successfully registered.\n") % self.info.identity.name
+            self.info.set_property('register-status', msg.rstrip())
             # We are done if auto bind is being skipped ("Manually attach
             # to subscriptions" is clicked in the gui)
             if self.info.get_property('skip-auto-bind'):
@@ -409,7 +417,8 @@ class RegisterWidget(widgets.SubmanBaseWidget):
             self.current_screen.emit('move-to-screen', SELECT_SLA_PAGE)
             self.register_widget.show_all()
             return False
-
+        msg = _("This system is currently not registered.")
+        self.info.set_property('register-status', msg)
         self.current_screen.stay()
         self.register_widget.show_all()
         return False
@@ -643,7 +652,8 @@ class RegisterDialog(widgets.SubmanBaseWidget):
 
     widget_names = ['register_dialog', 'register_dialog_main_vbox',
                     'register_details_label',
-                    'back_button', 'register_button', 'progress_label',
+                    'back_button', 'register_button',
+                    'cancel_button', 'progress_label',
                     'dialog_vbox6']
 
     gui_file = "register_dialog"
@@ -690,6 +700,9 @@ class RegisterDialog(widgets.SubmanBaseWidget):
         self.register_button.connect('clicked', self._on_register_button_clicked)
         self.back_button.connect('clicked', self._on_back_button_clicked)
 
+        # TODO: Hook this up to a RegisterWidget 'cancel' handler, when there is one
+        self.cancel_button.connect('clicked', self.cancel)
+
         # update window title on register state changes
         self.reg_info.connect('notify::register-state',
                                self._on_register_state_change)
@@ -718,8 +731,8 @@ class RegisterDialog(widgets.SubmanBaseWidget):
         self.register_dialog.show()
 
     def cancel(self, button):
-        self.register_dialog.hide()
-        return True
+        self.register_dialog.destroy()
+        return False
 
     def on_register_message(self, obj, msg, msg_type=None):
         # NOTE: We ignore the message type here, but initial-setup wont.
@@ -972,11 +985,24 @@ class PerformRegisterScreen(NoGuiScreen):
         # Done with the registration stuff, now on to attach
         self.emit('register-finished')
 
+        # Having activation-keys means the 'skip-auto-bind' wasn't an
+        # option. So 'skip-auto-bind' and 'activation-keys' are
+        # exclusive in practice.
         if self.info.get_property('activation-keys'):
             self.emit('move-to-screen', REFRESH_SUBSCRIPTIONS_PAGE)
-        else:
-            self.emit('move-to-screen', SELECT_SLA_PAGE)
+            self.pre_done()
+            return
 
+        if self.info.get_property('skip-auto-bind'):
+            # We are done at this point basically. The handler for 'register-finished'
+            # will take care of going to the done screen. This is just to avoid starting
+            # select sla page's pre(). In the future it may make sense to have a 'screen'
+            # after this that just does the logic in these if statements in a non-async pre()
+            # so we could potentially block on it.
+            self.pre_done()
+            return
+
+        self.emit('move-to-screen', SELECT_SLA_PAGE)
         self.pre_done()
         return
 
@@ -1092,7 +1118,7 @@ class SelectSLAScreen(Screen):
     """
     screen_enum = SELECT_SLA_PAGE
     widget_names = Screen.widget_names + ['product_list_label',
-                                          'sla_radio_container',
+                                          'sla_combobox',
                                           'owner_treeview']
     gui_file = "selectsla"
 
@@ -1102,53 +1128,41 @@ class SelectSLAScreen(Screen):
         self.pre_message = _("Finding suitable service levels")
         self.button_label = _("Next")
 
+        self.list_store = ga_Gtk.ListStore(str, ga_GObject.TYPE_PYOBJECT)
+        self.sla_combobox.set_model(self.list_store)
+
+        self.sla_combobox.connect('changed', self._on_sla_combobox_changed)
+
+        renderer_text = ga_Gtk.CellRendererText()
+        self.sla_combobox.pack_start(renderer_text, True)
+        self.sla_combobox.add_attribute(renderer_text, 'text', 0)
+
+    def _on_sla_combobox_changed(self, combobox):
+        tree_iter = combobox.get_active_iter()
+        if tree_iter is not None:
+            model = combobox.get_model()
+            sla, sla_data_map = model[tree_iter][:2]
+            self.info.set_property('dry-run-result',
+                                   sla_data_map[sla])
+
     def set_model(self, unentitled_prod_certs, sla_data_map):
         self.product_list_label.set_text(
                 self._format_prods(unentitled_prod_certs))
-        group = None
 
-        # The sla the user or kickstart requested
-        preferred_sla = self.info.get_property('preferred_sla')
-
-        # reverse iterate the list as that will most likely put 'None' last.
-        # then pack_start so we don't end up with radio buttons at the bottom
-        # of the screen.
-        chose_default = False
+        self.list_store.clear()
         for sla in reversed(sla_data_map.keys()):
-            radio = ga_Gtk.RadioButton(group=group, label=sla)
-            radio.connect("toggled",
-                          self._radio_clicked,
-                          (sla, sla_data_map))
-            # Use the user preferred sla as the default
-            # May need to handle preferred_sla not being in the suggested slas
-            if preferred_sla and preferred_sla == sla:
-                radio.set_active(True)
-                chose_default = True
-
-            self.sla_radio_container.pack_start(radio, expand=False,
-                                                fill=False, padding=0)
-            radio.show()
-            group = radio
-
-        if not chose_default:
-            # set the initial radio button as default selection.
-            group.set_active(True)
+            self.list_store.append([sla, sla_data_map])
+
+        self.sla_combobox.set_model(self.list_store)
+        self.sla_combobox.set_active(0)
 
     def apply(self):
         self.emit('move-to-screen', CONFIRM_SUBS_PAGE)
         return True
 
     def clear(self):
-        child_widgets = self.sla_radio_container.get_children()
-        for child in child_widgets:
-            self.sla_radio_container.remove(child)
-
-    def _radio_clicked(self, button, data):
-        sla, sla_data_map = data
-
-        if button.get_active():
-            self.info.set_property('dry-run-result',
-                                   sla_data_map[sla])
+        self.list_store.clear()
+        self.sla_combobox.set_model(self.list_store)
 
     def _format_prods(self, prod_certs):
         prod_str = ""
@@ -2031,6 +2045,11 @@ class DoneScreen(Screen):
         super(DoneScreen, self).__init__(reg_info, async_backend, facts, parent_window)
         self.pre_message = "We are done."
 
+    def pre(self):
+        # TODO: We could start cleanup tasks here.
+        self.pre_done()
+        return False
+
 
 class InfoScreen(Screen):
     """
diff --git a/subscription-manager.spec b/subscription-manager.spec
index 63e7a50..aaec788 100644
--- a/subscription-manager.spec
+++ b/subscription-manager.spec
@@ -49,7 +49,7 @@
 
 Name: subscription-manager
 Version: 1.15.9
-Release: 13%{?dist}
+Release: 14%{?dist}
 Summary: Tools and libraries for subscription and repository management
 Group:   System Environment/Base
 License: GPLv2
@@ -542,6 +542,14 @@ fi
 %endif
 
 %changelog
+* Wed Oct 07 2015 Chris Rog <crog@redhat.com> 1.15.9-14
+- 1268102: Stop main window from opening duplicate dialogs. (awood@redhat.com)
+- 1268088: Changes the rhsm spoke display message to end with "registered"
+  (csnyder@redhat.com)
+- 1268095: Replace SLA radio buttons w/ combobox (alikins@redhat.com)
+- 1268028: Fix skipped auto attach in registergui (alikins@redhat.com)
+- 1268060: Add 'cancel' back to s-m-gui register. (alikins@redhat.com)
+
 * Wed Sep 30 2015 Chris Rog <crog@redhat.com> 1.15.9-13
 - 1266480: Refresh TreeView selection after subscriptions are removed.
   (awood@redhat.com)