[PATCH 1/2] Allow disks in the filter and cleardisks UIs to be selected via double-click.

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

 



---
 iw/DeviceSelector.py |    6 ++++++
 iw/cleardisks_gui.py |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/iw/DeviceSelector.py b/iw/DeviceSelector.py
index ba3916a..17b977c 100644
--- a/iw/DeviceSelector.py
+++ b/iw/DeviceSelector.py
@@ -143,6 +143,7 @@ class DeviceSelector(DeviceDisplayer):
 
         self.view.append_column(col)
         self.view.set_headers_clickable(True)
+        self.view.connect("row-activated", self._row_activated, toggledCB, radioButton)
 
     def _all_clicked(self, button, cb=None):
         # This is called when the Add/Remove all button is checked and does
@@ -167,6 +168,11 @@ class DeviceSelector(DeviceDisplayer):
         set = button.get_active()
         self.store.foreach(_toggle_all, set)
 
+    def _row_activated(self, view, row, col, cb, isRadio):
+        # This is called when a row is double-clicked, or selected via space or
+        # enter.  We just want to do the same as if the checkbox were clicked.
+        self._device_toggled(None, row, cb, isRadio)
+
     def _device_toggled(self, button, row, cb, isRadio):
         # This is called when the checkbox for a device is clicked or unclicked.
         model = self.model
diff --git a/iw/cleardisks_gui.py b/iw/cleardisks_gui.py
index 2ac8c68..c227e30 100644
--- a/iw/cleardisks_gui.py
+++ b/iw/cleardisks_gui.py
@@ -143,6 +143,10 @@ class ClearDisksWindow (InstallWindow):
         self.addButton.connect("clicked", self._add_clicked)
         self.removeButton.connect("clicked", self._remove_clicked)
 
+        # Also allow moving devices back and forth with double click, enter, etc.
+        self.leftTreeView.connect("row-activated", self._add_clicked)
+        self.rightTreeView.connect("row-activated", self._remove_clicked)
+
         if self.anaconda.id.storage.clearPartType == CLEARPART_TYPE_LINUX:
             self.installTargetTip.set_markup(_("<b>Tip:</b> All Linux filesystems on install target devices will be reformatted and wiped of any data.  Make sure you have backups."))
         elif self.anaconda.id.storage.clearPartType == CLEARPART_TYPE_ALL:
@@ -152,7 +156,7 @@ class ClearDisksWindow (InstallWindow):
 
         return self.vbox
 
-    def _add_clicked(self, button):
+    def _add_clicked(self, widget, *args, **kwargs):
         (filteredModel, filteredIter) = self.leftTreeView.get_selection().get_selected()
 
         if not filteredIter:
@@ -174,7 +178,7 @@ class ClearDisksWindow (InstallWindow):
         self.leftFilteredModel.refilter()
         self.rightFilteredModel.refilter()
 
-    def _remove_clicked(self, button):
+    def _remove_clicked(self, widget, *args, **kwargs):
         (filteredModel, filteredIter) = self.rightTreeView.get_selection().get_selected()
 
         if not filteredIter:
-- 
1.6.5.1

_______________________________________________
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