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 @@ False end + + Close + True + True + True + + + close_button + + + + + False + False + 0 + True + + + gtk-go-back True @@ -35,7 +54,7 @@ False False - 0 + 1 @@ -57,7 +76,7 @@ False False - 1 + 2 @@ -74,6 +93,7 @@ + cancel_button back_button register_button 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 @@ True False 4 - 5 + 4 4 4 True + end + + + Close + True + True + True + + + close_button + + + + + False + True + 0 + True + + gtk-go-back @@ -47,7 +67,7 @@ False True - 0 + 1 @@ -58,7 +78,6 @@ True True True - right register_button @@ -69,7 +88,7 @@ False True - 1 + 2 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 @@ - + + - - Your installed products could be covered using one of multiple service levels. - - - + - vertical True False - 7 + vertical True False - 0 + start <b>Select Service Level</b> True + True + end + 64 + 0 False @@ -26,25 +26,32 @@ - vertical True False - 12 + False + False + vertical - + True - False False - False - word - 10 - 10 - False - False - textbuffer1 + 8 + 8 + 4 + 4 + Your installed products could be covered using one of multiple service levels. + True + end + 64 + 4 + 0 + 0 + + + - False + True True 0 @@ -53,111 +60,88 @@ True False - 0 - 0 + start + start 10 <b>Installed products:</b> True + True + middle + 64 + 0 + 0 False False - 1 + 2 True False - 0 - 0 + 4 + 4 25 - prod 1, prod2, prod 3, prod 4, prod 5, prod 6, prod 7, prod 8 + Awesome OS 14, Awesome OS 14 Super Edition, Awesome Middle Ware For Awesome App Platform Awesome Developer Editition True True + 64 + 0 + 0 False False - 2 + 3 + + + False + True + 1 + + + + + True + False - + True False - 0 - 0 - 10 - <b>Select a common service level for this system's subscriptions:</b> - True - False - False - 3 + 1 + 0 - + True - True - automatic - automatic - - - True - False - queue - none - - - vertical - True - False - 4 - - - True - False - 0 - label - - - False - False - 0 - - - - - True - False - 0 - label - - - False - False - 1 - - - - - - + False + start + start + 10 + <b>Select a common service level for this system's subscriptions:</b> + True + True + 32 + 0 + 0 - True - True - 4 + 0 + 0 - True + False True - 1 + 2 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 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 1.15.9-13 - 1266480: Refresh TreeView selection after subscriptions are removed. (awood@redhat.com)