Skip the filtering UI if there's only one disk in the machine.
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(-)
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:
+ # 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.
# 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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-29-2010, 03:12 PM
Chris Lumens
Skip the filtering UI if there's only one disk in the machine.
> >@@ -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.
Okay, let's address this separately.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list