Otherwise, the resize dialog is going to be passed incorrect references. --- pyanaconda/ui/gui/spokes/storage.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 51a3340..747c5f3 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -388,6 +388,7 @@ class StorageSpoke(NormalSpoke, StorageChecker): self.storage.config.update(self.data) self.storage.autoPartType = self.data.autopart.type self.storage.reset() + self.disks = getDisks(self.storage.devicetree) else: if self.autopart: # this was already run as part of doAutoPartition. dumb.
Otherwise, the resize dialog is going to be referencing devices that are hidden in the devicetree, which makes them basically not exist. --- pyanaconda/ui/gui/spokes/storage.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 747c5f3..cda59a6 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -665,6 +665,8 @@ class StorageSpoke(NormalSpoke, StorageChecker): if dialog.custom: self.skipTo = "CustomPartitioningSpoke" else: + self.apply() + resizeDialog = ResizeDialog(self.data, self.storage, self.payload) resizeDialog.refresh(disks)
First, don't always put a cancel button on. That looks weird on the storage spoke where we don't mention cancel. Second, change the order such that the Quit or Cancel button comes left-most and is positioned secondarily. --- pyanaconda/ui/gui/spokes/lib/detailederror.glade | 22 ++-------------------- pyanaconda/ui/gui/spokes/lib/detailederror.py | 21 +++++++++++++++++---- pyanaconda/ui/gui/spokes/software.py | 9 +++++---- pyanaconda/ui/gui/spokes/storage.py | 8 ++++---- 4 files changed, 28 insertions(+), 32 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/detailederror.glade b/pyanaconda/ui/gui/spokes/lib/detailederror.glade index eb031b5..3a873ce 100644 --- a/pyanaconda/ui/gui/spokes/lib/detailederror.glade +++ b/pyanaconda/ui/gui/spokes/lib/detailederror.glade @@ -50,26 +50,11 @@ </packing> </child> <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area2"> + <object class="GtkButtonBox" id="detailedButtonBox"> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="detailedCancelButton"> - <property name="label">gtk-cancel</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="halign">start</property> - <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - <property name="secondary">True</property> - </packing> + <placeholder/> </child> </object> <packing> @@ -81,8 +66,5 @@ </child> </object> </child> - <action-widgets> - <action-widget response="0">detailedCancelButton</action-widget> - </action-widgets> </object> </interface> diff --git a/pyanaconda/ui/gui/spokes/lib/detailederror.py b/pyanaconda/ui/gui/spokes/lib/detailederror.py index fd6a455..dbc3b08 100644 --- a/pyanaconda/ui/gui/spokes/lib/detailederror.py +++ b/pyanaconda/ui/gui/spokes/lib/detailederror.py @@ -23,6 +23,9 @@ from gi.repository import Gtk
from pyanaconda.ui.gui import GUIObject
+import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + __all__ = ["DetailedErrorDialog"]
class DetailedErrorDialog(GUIObject): @@ -46,10 +49,20 @@ class DetailedErrorDialog(GUIObject): label = kwargs.pop("label", None) GUIObject.__init__(self, *args, **kwargs)
- i = 1 - for button in buttons: - self.window.add_button(button, i) - i += 1 + if not buttons: + self.window.add_button(_("_Cancel"), 0) + else: + buttonbox = self.builder.get_object("detailedButtonBox") + i = 0 + + for button in buttons: + widget = self.window.add_button(button, i) + + # Quit buttons should always appear left-most. + if button == _("_Quit"): + buttonbox.set_child_secondary(widget, True) + + i += 1
if label: self.builder.get_object("detailedLabel").set_text(label) diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 1d795a9..080d7da 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -300,7 +300,8 @@ class SoftwareSelectionSpoke(NormalSpoke): "This is likely caused by an error with\nyour installation source. " "You can attempt to remove these packages from your installation.\n" "change your installation source, or quit the installer.") - dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit"), _("_Remove Packages"), + dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit"), _("_Cancel"), + _("_Remove Packages"), _("_Modify Software Source")], label=label) with enlightbox(self.window, dialog.window): @@ -310,11 +311,11 @@ class SoftwareSelectionSpoke(NormalSpoke): dialog.window.destroy()
if rc == 0: - # Close the dialog so the user can change selections. - pass - elif rc == 1: # Quit. sys.exit(0) + elif rc == 1: + # Close the dialog so the user can change selections. + pass elif rc == 2: # TODO: Attempt to remove the affected packages. pass diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index cda59a6..84a23ac 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -690,7 +690,7 @@ class StorageSpoke(NormalSpoke, StorageChecker): label = _("The following errors were encountered when checking your storage " "configuration. You can modify your storage layout\nor quit the " "installer.") - dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit")], label=label) + dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit"), _("_Modify Storage Layout")], label=label) with enlightbox(self.window, dialog.window): errors = "\n".join(self.errors) dialog.refresh(errors) @@ -699,8 +699,8 @@ class StorageSpoke(NormalSpoke, StorageChecker): dialog.window.destroy()
if rc == 0: - # Close the dialog so the user can change selections. - pass - elif rc == 1: # Quit. sys.exit(0) + elif rc == 1: + # Close the dialog so the user can change selections. + pass
All three look fine to me.
On Tue, 2012-10-09 at 15:49 -0400, Chris Lumens wrote:
Otherwise, the resize dialog is going to be passed incorrect references.
pyanaconda/ui/gui/spokes/storage.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 51a3340..747c5f3 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -388,6 +388,7 @@ class StorageSpoke(NormalSpoke, StorageChecker): self.storage.config.update(self.data) self.storage.autoPartType = self.data.autopart.type self.storage.reset()
self.disks = getDisks(self.storage.devicetree) else: if self.autopart: # this was already run as part of doAutoPartition. dumb.
anaconda-patches@lists.fedorahosted.org