Re: [PATCH 2/4] Skip the filtering UI if there's only one disk in the machine.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 01/28/2010 05:54 PM, Chris Lumens wrote:
For the common home/laptop use case, the user likely only has one disk.  If
that's the case and they pick the Basic filtering UI (indicating they don't
want to add fcoe/iscsi/whatever disks), then there's no point in showing
these UI components.
---
  iw/cleardisks_gui.py |    7 +++++++
  iw/filter_gui.py     |   26 +++++++++++++++++---------
  2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/iw/cleardisks_gui.py b/iw/cleardisks_gui.py
index dfad7d6..bab9c51 100644
--- a/iw/cleardisks_gui.py
+++ b/iw/cleardisks_gui.py
@@ -64,6 +64,13 @@ class ClearDisksWindow (InstallWindow):
          self.anaconda.id.bootloader.drivelist = [bootDisk] + cleardisks

      def getScreen (self, anaconda):
+        # Skip this screen as well if we only had one disk available in the
+        # filtering UI.
+        if len(anaconda.id.storage.exclusiveDisks) == 1:
+            anaconda.id.storage.clearPartDisks = anaconda.id.storage.exclusiveDisks
+            anaconda.id.bootloader.drivelist = anaconda.id.storage.exclusiveDisks
+            return None
+
          (xml, self.vbox) = gui.getGladeWidget("cleardisks.glade", "vbox")
          self.leftScroll = xml.get_widget("leftScroll")
          self.rightScroll = xml.get_widget("rightScroll")
diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 4ba32a7..5c13787 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -515,15 +515,6 @@ class FilterWindow(InstallWindow):
                                     gobject.TYPE_STRING)
          self.store.set_sort_column_id(MODEL_COL, gtk.SORT_ASCENDING)

-        if anaconda.id.simpleFilter:
-            self.pages = [self._makeBasic()]
-            self.notebook.set_show_border(False)
-            self.notebook.set_show_tabs(False)
-        else:
-            self.pages = [self._makeBasic(), self._makeRAID(),
-                          self._makeMPath(), self._makeOther(),
-                          self._makeSearch()]
-
          udev_trigger(subsystem="block")
          disks = filter(udev_device_is_disk, udev_get_block_devices())
          (singlepaths, mpaths, partitions) = identifyMultipaths(disks)
@@ -534,6 +525,23 @@ class FilterWindow(InstallWindow):
          (raids, nonraids) = self.split_list(lambda d: isRAID(d) and not isCCISS(d),
                                              singlepaths)

+        if anaconda.id.simpleFilter:
+            # In the typical use case, the user likely only has one drive and
+            # there's no point showing either the filtering UI or the
+            # cleardisks UI.  Unfortunately, that means we need to duplicate
+            # some of the getNext method.
+            if len(singlepaths) == 1:
+                anaconda.id.storage.exclusiveDisks = [udev_device_get_name(singlepaths[0])]
+                return None
+

Note if we decide to also show BIOS RAID in the simple view this if needs to change.

+            self.pages = [self._makeBasic()]
+            self.notebook.set_show_border(False)
+            self.notebook.set_show_tabs(False)
+        else:
+            self.pages = [self._makeBasic(), self._makeRAID(),
+                          self._makeMPath(), self._makeOther(),
+                          self._makeSearch()]
+
          self.populate(nonraids, mpaths, raids)

          # If the "Add Advanced" button is ever clicked, we need to have a list

Ack!

Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux