FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 01-28-2010, 11:40 AM
Hans de Goede
 
Default cleardisk_gui: Base autoselection of bootdev on detected BIOS order

Hi,

On 01/27/2010 05:26 PM, Chris Lumens wrote:

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.getDeviceByNam e(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.



As discussed on irc a new version of this patch removing the sorting
of the store is coming up.


@@ -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



Ah yes that is much better, will change in next revision of the patch.


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?


In this case the first drive according to our fallback sorting (used when
no EDD info is present) gets auto selected (if added to the right column),
like it was autoselected in the old auto_part_type UI.


Does the "You must select one drive to
boot from" message still appear?


If no drive is selected because the first drive according to the compareDisks
sort order is not added to the right pane, yes (I tested this to make sure).

Regards,

Hans

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

Thread Tools




All times are GMT. The time now is 05:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org