[sulfur.events] enable/disable "Edit Set" button automatically when needed
This commit is contained in:
@@ -639,6 +639,24 @@ class SulfurApplicationEventsMixin:
|
||||
break
|
||||
self.load_package_info_menu(obj)
|
||||
|
||||
def on_pkg_click(self, widget):
|
||||
"""
|
||||
When Packages View gtk.TreeView elements are single clicked.
|
||||
"""
|
||||
objs = self.pkgView.collect_selected_items()
|
||||
obj = None
|
||||
for x in objs:
|
||||
if x.is_pkgset_cat:
|
||||
obj = x
|
||||
break
|
||||
if obj is None:
|
||||
# disable edit set button
|
||||
self.ui.pkgsetEditButton.set_sensitive(False)
|
||||
else:
|
||||
# enable edit set button
|
||||
self.ui.pkgsetEditButton.set_sensitive(True)
|
||||
|
||||
|
||||
def on_license_double_clicked( self, widget, iterator, path ):
|
||||
( model, iterator ) = widget.get_selection().get_selected()
|
||||
if model != None and iterator != None:
|
||||
@@ -823,8 +841,9 @@ class SulfurApplicationEventsMixin:
|
||||
# pull the set list
|
||||
objs = self.pkgView.collect_selected_items()
|
||||
obj = None
|
||||
for obj in objs:
|
||||
if obj.pkgset:
|
||||
for x in objs:
|
||||
if x.is_pkgset_cat:
|
||||
obj = x
|
||||
break
|
||||
if obj is None:
|
||||
return # sorry
|
||||
|
||||
@@ -630,6 +630,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="rules_hint">True</property>
|
||||
<property name="rubber_banding">True</property>
|
||||
<signal name="cursor_changed" handler="on_pkg_click"/>
|
||||
<signal name="row_activated" handler="on_pkg_doubleclick"/>
|
||||
</widget>
|
||||
</child>
|
||||
@@ -976,6 +977,7 @@
|
||||
<child>
|
||||
<widget class="GtkButton" id="pkgsetEditButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="on_pkgsetEditButton_clicked"/>
|
||||
|
||||
Reference in New Issue
Block a user