From ee0bc905daad4dd0c18824db8d39c4daf1520027 Mon Sep 17 00:00:00 2001 From: Matt Keenan Date: Tue, 31 Mar 2015 10:21:29 -0700 Subject: [PATCH] 8468: GuiColorOption missing avail-changed event handler --- src/gui/plug/_guioptions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/plug/_guioptions.py b/src/gui/plug/_guioptions.py index b297d5d52..a5ad509df 100644 --- a/src/gui/plug/_guioptions.py +++ b/src/gui/plug/_guioptions.py @@ -237,6 +237,9 @@ class GuiColorOption(gtk.ColorButton): self.changekey = self.connect('color-set', self.__color_changed) self.valuekey = self.__option.connect('value-changed', self.__value_changed) + self.conkey = self.__option.connect('avail-changed', self.__update_avail) + self.__update_avail() + self.set_tooltip_text(self.__option.get_help()) def __color_changed(self, obj): # IGNORE:W0613 - obj is unused @@ -253,6 +256,13 @@ class GuiColorOption(gtk.ColorButton): self.__option.set_value(value) self.__option.enable_signals() + def __update_avail(self): + """ + Update the availability (sensitivity) of this widget. + """ + avail = self.__option.get_available() + self.set_sensitive(avail) + def __value_changed(self): """ Handle the change made programmatically @@ -266,6 +276,7 @@ class GuiColorOption(gtk.ColorButton): remove stuff that blocks garbage collection """ self.__option.disconnect(self.valuekey) + self.__option.disconnect(self.conkey) self.__option = None #-------------------------------------------------------------------------