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

[rhel5-branch] 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


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