[PATCH] Allow clicking on environment and addon text to toggle them (#928010).
Chris Lumens
clumens at redhat.com
Tue Apr 16 19:35:29 UTC 2013
---
pyanaconda/ui/gui/spokes/software.glade | 8 ++++++--
pyanaconda/ui/gui/spokes/software.py | 17 +++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.glade b/pyanaconda/ui/gui/spokes/software.glade
index 0dbee9d..bda4f9e 100644
--- a/pyanaconda/ui/gui/spokes/software.glade
+++ b/pyanaconda/ui/gui/spokes/software.glade
@@ -137,7 +137,9 @@
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection2"/>
+ <object class="GtkTreeSelection" id="addonSelector">
+ <signal name="changed" handler="on_addon_selection_changed" swapped="no"/>
+ </object>
</child>
<child>
<object class="GtkTreeViewColumn" id="addonSelectedCol">
@@ -201,7 +203,9 @@
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="environmentSelector"/>
+ <object class="GtkTreeSelection" id="environmentSelector">
+ <signal name="changed" handler="on_environment_selection_changed" swapped="no"/>
+ </object>
</child>
<child>
<object class="GtkTreeViewColumn" id="environmentSelectedCol">
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 55af428..4d95ba1 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -316,6 +316,15 @@ class SoftwareSelectionSpoke(NormalSpoke):
self.environment = self._environmentStore[path][2]
self.refreshAddons()
+ def on_environment_selection_changed(self, selection):
+ (model, itr) = selection.get_selected()
+ if not itr:
+ return
+
+ # Only do something if the row's not previously been selected.
+ if not model[itr][0]:
+ self.on_environment_toggled(None, model.get_path(itr))
+
def on_addon_toggled(self, renderer, path):
selected = not self._addonStore[path][0]
group = self._addonStore[path][2]
@@ -330,6 +339,14 @@ class SoftwareSelectionSpoke(NormalSpoke):
elif not selected and group in self.selectedGroups:
self.selectedGroups.remove(group)
+ def on_addon_selection_changed(self, selection):
+ (model, itr) = selection.get_selected()
+ if not itr:
+ return
+
+ # Always do something here, since addons can be toggled.
+ self.on_addon_toggled(None, model.get_path(itr))
+
def on_custom_clicked(self, button):
with enlightbox(self.window, self._addRepoDialog.window):
response = self._addRepoDialog.run()
--
1.8.1.2
More information about the anaconda-patches
mailing list