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

[PATCH] Add Select All and Deselect All buttons to Add Partition dialog.



Add "Select All" and "Deselect all" buttons for selection handling in checkboxlist.
Screen shot: http://tmlcoch.fedorapeople.org/buttons_1.png
Reference: Bug 641910 (https://bugzilla.redhat.com/show_bug.cgi?id=641910).

---
 pyanaconda/iw/partition_dialog_gui.py |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/iw/partition_dialog_gui.py b/pyanaconda/iw/partition_dialog_gui.py
index 3e4af2b..392daf9 100644
--- a/pyanaconda/iw/partition_dialog_gui.py
+++ b/pyanaconda/iw/partition_dialog_gui.py
@@ -53,6 +53,14 @@ class PartitionEditor:
     def fillmaxszCB(self, widget, spin):
 	spin.set_sensitive(widget.get_active())
 
+    def selectAll(self, widget=None, data=None):
+        for i in xrange(self.driveview.num_rows):
+            self.driveview.set_active(i, True)
+
+    def deselectAll(self, widget=None, data=None):
+        for i in xrange(self.driveview.num_rows):
+            self.driveview.set_active(i, False)
+
     # pass in CB defined above because of two scope limitation of python!
     def createSizeOptionsFrame(self, request, fillmaxszCB):
 	frame = gtk.Frame(_("Additional Size Options"))
@@ -69,7 +77,7 @@ class PartitionEditor:
 	fillmaxszsb = gtk.SpinButton(maxsizeAdj, digits = 0)
 	fillmaxszsb.set_property('numeric', True)
 	fillunlimrb = gtk.RadioButton(group=fixedrb,
-				     label=_("Fill to maximum _allowable "
+				     label=_("Fill to maximum allo_wable "
 					     "size"))
 
 	fillmaxszrb.connect("toggled", fillmaxszCB, fillmaxszsb)
@@ -453,7 +461,7 @@ class PartitionEditor:
 
         # allowable drives
         if not self.origrequest.exists:
-            lbl = createAlignedLabel(_("Allowable _Drives:"))
+            lbl = createAlignedLabel(_("Allowable D_rives:"))
             maintable.attach(lbl, 0, 1, row, row + 1)
 
             req_disk_names = [d.name for d in self.origrequest.req_disks]
@@ -469,6 +477,16 @@ class PartitionEditor:
             self.driveview.set_size_request(375, 80)
 
             row = row + 1
+            
+            btn_selectall = gtk.Button("Select _All")
+            btn_selectall.connect("clicked", self.selectAll)
+            btn_deselectall = gtk.Button("_Deselect All")
+            btn_deselectall.connect("clicked", self.deselectAll)
+            hbox = gtk.HBox(homogeneous=False, spacing=0)
+            hbox.pack_start(btn_selectall, False, False, 2)
+            hbox.pack_start(btn_deselectall, False, False, 2)
+            maintable.attach(hbox, 1, 2, row, row + 1)
+            row = row + 1
 
         # original fs type and label
         if self.origrequest.exists:
-- 
1.7.2.3


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