Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   Do not lose selection in the bootloader's drive order dialog (#583837). (http://www.linux-archive.org/archlinux-pacman-development/494074-do-not-lose-selection-bootloaders-drive-order-dialog-583837-a.html)

Ales Kozumplik 02-25-2011 01:29 PM

Do not lose selection in the bootloader's drive order dialog (#583837).
 
---
iw/driveorderwidget.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/iw/driveorderwidget.py b/iw/driveorderwidget.py
index 0bd58fb..c2979f0 100644
--- a/iw/driveorderwidget.py
+++ b/iw/driveorderwidget.py
@@ -101,13 +101,16 @@ class DriveOrderWidget:
# there has got to be a better way to do this =
drive = model.get_value(iter, 0)[5:]
index = self.driveOrder.index(drive)
- if direction == gtk.ARROW_DOWN:
+ if direction == gtk.ARROW_DOWN and index < len(self.driveOrder) - 1:
+ previous = self.driveOrderStore.get_iter(index + 1)
+ self.driveOrderStore.swap(previous, iter)
self.driveOrder.remove(drive)
self.driveOrder.insert(index + 1, drive)
- elif direction == gtk.ARROW_UP:
+ elif direction == gtk.ARROW_UP and index > 0:
+ next = self.driveOrderStore.get_iter(index - 1)
+ self.driveOrderStore.swap(next, iter)
self.driveOrder.remove(drive)
self.driveOrder.insert(index - 1, drive)
- self.makeDriveOrderStore()

# make the store for the drive order
def makeDriveOrderStore(self):
--
1.7.3.3

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


All times are GMT. The time now is 04:45 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.