Fix 0001659: NumberOption fields on report dialogs

svn: r9941
This commit is contained in:
Brian Matherly 2008-01-28 05:12:09 +00:00
parent 212cb34365
commit 79174e7114
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2008-01-27 Brian Matherly <brian@gramps-project.org>
* src/PluginUtils/_GuiOptions.py:
Fix 0001659: NumberOption fields on report dialogs
2008-01-27 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_GraphvizReportDialog.py: Fix 0001656: New menu item

View File

@ -219,16 +219,18 @@ class GuiNumberOption(gtk.SpinButton):
decimals = int(math.log10(step) * -1)
gtk.SpinButton.__init__(self, adj, digits=decimals)
gtk.SpinButton.set_numeric(self, True)
self.set_value(self.__option.get_value())
self.connect('changed', self.__value_changed)
self.connect('value_changed', self.__value_changed)
tooltip.set_tip(self, self.__option.get_help())
def __value_changed(self, obj): # IGNORE:W0613 - obj is unused
"""
Handle the change of the value.
"""
self.__option.set_value( int(self.get_value_as_int()) )
vtype = type(self.__option.get_value())
self.__option.set_value( vtype(self.get_value()) )
#-------------------------------------------------------------------------
#