Re: [PATCH 1/2] cleardisk_gui: Base autoselection of bootdev on detected BIOS order

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

 



> diff --git a/iw/cleardisks_gui.py b/iw/cleardisks_gui.py
> index 4f26560..10ffdcb 100644
> --- a/iw/cleardisks_gui.py
> +++ b/iw/cleardisks_gui.py
> @@ -88,7 +88,6 @@ class ClearDisksWindow (InstallWindow):
>                                     gobject.TYPE_STRING, gobject.TYPE_STRING,
>                                     gobject.TYPE_STRING, gobject.TYPE_STRING,
>                                     gobject.TYPE_STRING)
> -        self.store.set_sort_column_id(5, gtk.SORT_ASCENDING)
>  
>          # The left view shows all the drives that will just be mounted, but
>          # can still be moved to the right hand side.
> @@ -130,7 +129,13 @@ class ClearDisksWindow (InstallWindow):
>          # of all the disks we should use later on.  Now we need to go get those,
>          # look up some more information in the devicetree, and set up the
>          # selector.
> -        for d in self.anaconda.id.storage.exclusiveDisks:
> +        disks = self.anaconda.id.storage.exclusiveDisks
> +        disks.sort(self.anaconda.id.storage.compareDisks)
> +        # Store the first disk for auto boot device selection, the order
> +        # in the store may change if the users changes the sorting
> +        self.bootDisk = disks[0]
> +
> +        for d in disks:
>              device = self.anaconda.id.storage.devicetree.getDeviceByName(d)
>              if not device:
>                  continue

You're putting things into the store sorted in a special order that has
no corresponding column, but then leaving the possibility open to the
user to sort in a different way by clicking on the column headers.
However, there's no way for the user to restore the default ordering no
matter what they click on.

> @@ -160,19 +165,21 @@ class ClearDisksWindow (InstallWindow):
>  
>          return self.vbox
>  
> +    def _autoSelectBootDisk(self):
> +        if self.rightDS.getSelected():
> +            return
> +
> +        for i in range(0, len(self.store)):
> +            if self.store[i][OBJECT_COL].name == self.bootDisk and \
> +                    self.store[i][self.rightVisible]:
> +                self.store[i][self.rightActive] = True

gtk.WhateverStores are iterable, so this can be simplified down to:

    for row in self.store:
        if row[OBJECT_COL].name == self.bootDisk and row[self.rightVisible]:
            row[self.rightActive] = True

I didn't do this everywhere I could have in the filtering UI, for
reasons which probably no longer make sense.

What happens to the UI if I'm on a machine with no preset boot disk, but
then I add several things to the right panel and click next?  Do any of
the radio buttons get updated?  Does the "You must select one drive to
boot from" message still appear?

- Chris

_______________________________________________
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