2007-12-12 Douglas S. Blank <dblank@cs.brynmawr.edu>

* src/GrampsCfg.py: fixed bug #1305, refresh view after name change

	
2007-12-12  Douglas S. Blank  <dblank@cs.brynmawr.edu>


svn: r9497
This commit is contained in:
Doug Blank 2007-12-13 02:22:06 +00:00
parent 05575ad026
commit 6d3e7465d3
2 changed files with 26 additions and 2 deletions

View File

@ -1,8 +1,11 @@
2007-12-12 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/GrampsCfg.py: fixed bug #1305, refresh view after name change
2007-12-12 Brian Matherly <brian@gramps-project.org> 2007-12-12 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_DocReportDialog.py: Added. * src/ReportBase/_DocReportDialog.py: Added.
* many, many other files: Refactor various aspects of the report system. * many, many other files: Refactor various aspects of the report system.
2007-12-12 Douglas S. Blank <dblank@doraemon.brynmawr.edu> 2007-12-12 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/GrampsCfg.py: added Translation -> Pattern -> Translation * src/GrampsCfg.py: added Translation -> Pattern -> Translation
so that one can see fully translated text, even if they type in so that one can see fully translated text, even if they type in
English, or %codes English, or %codes

View File

@ -104,6 +104,8 @@ def get_researcher():
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class DisplayNameEditor(ManagedWindow.ManagedWindow): class DisplayNameEditor(ManagedWindow.ManagedWindow):
def __init__(self, uistate, dbstate, track, dialog): def __init__(self, uistate, dbstate, track, dialog):
# Assumes that there are two methods: dialog.name_changed_check(),
# and dialog._build_custom_name_ui()
ManagedWindow.ManagedWindow.__init__(self, uistate, [], DisplayNameEditor) ManagedWindow.ManagedWindow.__init__(self, uistate, [], DisplayNameEditor)
self.dialog = dialog self.dialog = dialog
self.dbstate = dbstate self.dbstate = dbstate
@ -117,6 +119,10 @@ class DisplayNameEditor(ManagedWindow.ManagedWindow):
self.window.set_default_size(600, 300) self.window.set_default_size(600, 300)
self.window.connect('response', self.close) self.window.connect('response', self.close)
self.show() self.show()
def close(self, *obj):
self.dialog.name_changed_check()
ManagedWindow.ManagedWindow.close(self, *obj)
def build_menu_names(self, obj): def build_menu_names(self, obj):
return (_(" Name Editor"), _("Preferences")) return (_(" Name Editor"), _("Preferences"))
@ -432,6 +438,18 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.name_column = name_column self.name_column = name_column
return table return table
def name_changed_check(self):
"""
Method to check for a name change. Called by Name Edit Dialog.
"""
obj = self.fmt_obox
the_list = obj.get_model()
the_iter = obj.get_active_iter()
format = the_list.get_value(the_iter, COL_FMT)
if format != self.old_format:
# Yes a change; call the callback
self.cb_name_changed(obj)
def cb_name_changed(self, obj): def cb_name_changed(self, obj):
""" """
Preset name format ComboBox callback Preset name format ComboBox callback
@ -609,6 +627,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
return table return table
def cb_name_dialog(self, obj): def cb_name_dialog(self, obj):
the_list = self.fmt_obox.get_model()
the_iter = self.fmt_obox.get_active_iter()
self.old_format = the_list.get_value(the_iter, COL_FMT)
win = DisplayNameEditor(self.uistate, self.dbstate, self.track, self) win = DisplayNameEditor(self.uistate, self.dbstate, self.track, self)
def date_format_changed(self, obj): def date_format_changed(self, obj):