When the custom checkbox is selected, we need to make sure the software spoke is ready when deciding whether the Modify button is sensitive or not. --- pyanaconda/ui/gui/spokes/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 3498517..537781a 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -246,7 +246,7 @@ class InstallOptions2Dialog(InstallOptions1Dialog): def on_custom_toggled(self, checkbutton): super(InstallOptions2Dialog, self).on_custom_toggled(checkbutton) self.builder.get_object("options2_cancel_button").set_sensitive(not self.custom) - self.builder.get_object("options2_modify_sw_button").set_sensitive(not self.custom) + self.builder.get_object("options2_modify_sw_button").set_sensitive(not self.custom and self._software_is_ready())
class InstallOptions3Dialog(InstallOptions1Dialog): builderObjects = ["options3_dialog"]
Otherwise, you'll end up in a situation where packages the previous and current environment share will not get installed. --- pyanaconda/packaging/__init__.py | 3 +++ pyanaconda/packaging/yumpayload.py | 12 ++++++++++++ pyanaconda/ui/gui/spokes/software.py | 10 ++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py index 65e3776..6462a28 100644 --- a/pyanaconda/packaging/__init__.py +++ b/pyanaconda/packaging/__init__.py @@ -277,6 +277,9 @@ class Payload(object): def deselectEnvironment(self, environmentid): raise NotImplementedError()
+ def environmentGroups(self, environmentid): + raise NotImplementedError() + ### ### METHODS FOR WORKING WITH GROUPS ### diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py index 6f3160d..cd2e22e 100644 --- a/pyanaconda/packaging/yumpayload.py +++ b/pyanaconda/packaging/yumpayload.py @@ -837,6 +837,18 @@ reposdir=%s for group in environment.options: self.deselectGroup(group)
+ def environmentGroups(self, environmentid): + groups = self._yumGroups + if not groups: + return [] + + with _yum_lock: + if not groups.has_environment(environmentid): + raise NoSuchGroup(environmentid) + + environment = groups.return_environment(environmentid) + return environment.groups + environment.options + ### ### METHODS FOR WORKING WITH GROUPS ### diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 10b4d48..1d795a9 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -32,6 +32,8 @@ from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded from pyanaconda.ui.gui.categories.software import SoftwareCategory from .source import AdditionalReposDialog
+from pykickstart.parser import Group + import sys
__all__ = ["SoftwareSelectionSpoke"] @@ -260,8 +262,12 @@ class SoftwareSelectionSpoke(NormalSpoke): for row in self._environmentStore: row[0] = False
- if self.environment: - self.payload.deselectEnvironment(self.environment) + # Remove all groups from the previous environment from the selected + # list, but don't explicitly exclude them. + for groupid in self.payload.environmentGroups(self.environment): + grp = Group(groupid) + if grp in self.data.packages.groupList: + self.data.packages.groupList.remove(grp)
# Then mark the clicked environment as selected and update the screen. self._environmentStore[path][0] = True
--- pyanaconda/storage/__init__.py | 3 --- pyanaconda/ui/gui/spokes/lib/cart.py | 3 +++ pyanaconda/ui/gui/spokes/storage.py | 4 +++- pyanaconda/ui/tui/spokes/storage.py | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 8239e6f..c506ed8 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -103,9 +103,6 @@ def storageInitialize(storage, ksdata, protected): else: storage.reset()
- if not storage.disks: - raise NoDisksError - # kickstart uses all the disks if flags.automatedInstall: if not ksdata.ignoredisk.onlyuse: diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py index 1b46bc2..ed4f1f7 100644 --- a/pyanaconda/ui/gui/spokes/lib/cart.py +++ b/pyanaconda/ui/gui/spokes/lib/cart.py @@ -65,6 +65,9 @@ class SelectedDisksDialog(GUIObject): if not showRemove: self.builder.get_object("remove_button").hide()
+ if not disks: + return + # Set up the default boot device. Use what's in the ksdata if anything, # then fall back to the first device. default_id = None diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 537781a..5bee70c 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -531,7 +531,9 @@ class StorageSpoke(NormalSpoke, StorageChecker): summary_label = self.builder.get_object("summary_label") summary_label.set_text(summary)
- if count == 0: + if len(self.disks) == 0: + self.window.set_info(Gtk.MessageType.WARNING, _("No disks detected. Please shut down the computer, connect at least one disk, and restart to complete installation.")) + elif count == 0: self.window.set_info(Gtk.MessageType.WARNING, _("No disks selected; please select at least one disk to install to.")) else: self.window.clear_info() diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index afa2855..c0a7cdd 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -163,7 +163,9 @@ class StorageSpoke(NormalTUISpoke): ("%d disks selected; %s capacity; %s free ..."), count) % (count, str(Size(spec="%s MB" % capacity)), free))
- if count == 0: + if len(self.disks) == 0: + summary = _("No disks detected. Please shut down the computer, connect at least one disk, and restart to complete installation.") + elif count == 0: summary = (_("No disks selected; please select at least one disk to install to."))
return summary
It needs to be more clear that deleting filesystems is also an option. --- pyanaconda/ui/gui/spokes/lib/resize.glade | 7 ++++--- pyanaconda/ui/gui/spokes/lib/resize.py | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade index 6a1799b..d3dbbfd 100644 --- a/pyanaconda/ui/gui/spokes/lib/resize.glade +++ b/pyanaconda/ui/gui/spokes/lib/resize.glade @@ -37,7 +37,7 @@ </columns> </object> <object class="GtkDialog" id="resizeDialog"> - <property name="height_request">350</property> + <property name="height_request">450</property> <property name="can_focus">False</property> <property name="border_width">5</property> <property name="resizable">False</property> @@ -115,10 +115,11 @@ </packing> </child> <child> - <object class="GtkLabel" id="label2"> + <object class="GtkLabel" id="reclaimDescLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Some of the disks on your system have free space available in pre-existing filesystems. While it's risky and we recommend you back up your data first, you can recover that free disk space and make it available for this installation below:</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Description goes here.</property> <property name="wrap">True</property> </object> <packing> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py index fcccbeb..2bcb6d2 100644 --- a/pyanaconda/ui/gui/spokes/lib/resize.py +++ b/pyanaconda/ui/gui/spokes/lib/resize.py @@ -75,6 +75,8 @@ class ResizeDialog(GUIObject): markup = self._required_label.get_label() self._required_label.set_markup(markup % size_str(payload.spaceRequired))
+ self._reclaimDescLabel = self.builder.get_object("reclaimDescLabel") + def _description(self, part): # First, try to find the partition in some known Root. If we find # it, return the mountpoint as the description. @@ -99,6 +101,8 @@ class ResizeDialog(GUIObject):
self._selectedReclaimableSpace = 0
+ canShrinkSomething = False + # Shouldn't have to do this outside of glade, but see: # https://bugzilla.gnome.org/show_bug.cgi?id=685003 renderer = self.builder.get_object("actionRenderer") @@ -126,6 +130,7 @@ class ResizeDialog(GUIObject): # Devices that are not resizable are still deletable. if dev.resizable: freeSize = dev.size - dev.minSize + canShrinkSomething = True else: freeSize = dev.size
@@ -148,6 +153,20 @@ class ResizeDialog(GUIObject):
self._update_labels(totalDisks, totalReclaimableSpace, 0)
+ description = _("You don't have enough free space available for this installation.\n\n" + "You can remove existing filesystems you no longer need to free up space " + "for this installation. Removing a filesystem will permanently delete all " + "of the data it contains.") + + if canShrinkSomething: + description += "\n\n" + description += _("There is also free space available in pre-existing filesystems. " + "While it's risky and we recommend you back up your data first, you " + "can recover that free disk space and make it available for this " + "installation below.") + + self._reclaimDescLabel.set_text(description) + def _update_labels(self, nDisks=None, totalReclaimable=None, selectedReclaimable=None): if nDisks is not None and totalReclaimable is not None: text = P_("<b>%s disk; %s reclaimable space</b> (in filesystems)",
On Mon, 2012-10-08 at 16:18 -0400, Chris Lumens wrote:
When the custom checkbox is selected, we need to make sure the software spoke is ready when deciding whether the Modify button is sensitive or not.
pyanaconda/ui/gui/spokes/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 3498517..537781a 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -246,7 +246,7 @@ class InstallOptions2Dialog(InstallOptions1Dialog): def on_custom_toggled(self, checkbutton): super(InstallOptions2Dialog, self).on_custom_toggled(checkbutton) self.builder.get_object("options2_cancel_button").set_sensitive(not self.custom)
self.builder.get_object("options2_modify_sw_button").set_sensitive(not self.custom)
self.builder.get_object("options2_modify_sw_button").set_sensitive(not self.custom and self._software_is_ready())
Could you please split this ^^ line into two? Otherwise these all look good to me.
anaconda-patches@lists.fedorahosted.org