2006-08-25 Zsolt Foldvari <zsolt.foldvari@nokia.com>
* src/GrampsCfg.py: Implement callback mechanism for dynamic name format change. * src/ViewManager.py (__init__, preferences_activate, change_page): Rebuild the active page after name fomat changed by connecting to GrampsPreferences' signal svn: r7262
This commit is contained in:
parent
d02a945b7a
commit
bd377f63a0
@ -1,3 +1,10 @@
|
|||||||
|
2006-08-25 Zsolt Foldvari <zsolt.foldvari@nokia.com>
|
||||||
|
* src/GrampsCfg.py: Implement callback mechanism for dynamic name format
|
||||||
|
change.
|
||||||
|
* src/ViewManager.py (__init__, preferences_activate, change_page):
|
||||||
|
Rebuild the active page after name fomat changed by connecting to
|
||||||
|
GrampsPreferences' signal
|
||||||
|
|
||||||
2006-08-24 Alex Roitman <shura@gramps-project.org>
|
2006-08-24 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/GrampsDb/_GrampsInMemDB.py (undo_data): Add method to take
|
* src/GrampsDb/_GrampsInMemDB.py (undo_data): Add method to take
|
||||||
care of secondary indices on undo/redo;
|
care of secondary indices on undo/redo;
|
||||||
|
@ -46,6 +46,7 @@ from RelLib import Name
|
|||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from GrampsWidgets import *
|
from GrampsWidgets import *
|
||||||
import QuestionDialog
|
import QuestionDialog
|
||||||
|
from GrampsDb import GrampsDBCallback
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -91,13 +92,18 @@ def get_researcher():
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class GrampsPreferences(ManagedWindow.ManagedWindow):
|
class GrampsPreferences(ManagedWindow.ManagedWindow,GrampsDBCallback):
|
||||||
def __init__(self, uistate, dbstate):
|
|
||||||
|
|
||||||
|
__signals__ = {
|
||||||
|
'nameformat-changed': None,
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, uistate, dbstate):
|
||||||
|
GrampsDBCallback.__init__(self)
|
||||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],GrampsPreferences)
|
ManagedWindow.ManagedWindow.__init__(self,uistate,[],GrampsPreferences)
|
||||||
|
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
|
|
||||||
tlabel = gtk.Label()
|
tlabel = gtk.Label()
|
||||||
self.set_window(
|
self.set_window(
|
||||||
gtk.Dialog(_('Preferences'),
|
gtk.Dialog(_('Preferences'),
|
||||||
@ -345,6 +351,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
|
|||||||
new_idx = the_list.get_value(the_iter,COL_NUM)
|
new_idx = the_list.get_value(the_iter,COL_NUM)
|
||||||
Config.set(Config.NAME_FORMAT,new_idx)
|
Config.set(Config.NAME_FORMAT,new_idx)
|
||||||
_nd.set_default_format(new_idx)
|
_nd.set_default_format(new_idx)
|
||||||
|
self.emit('nameformat-changed')
|
||||||
|
|
||||||
def cb_format_tree_select(self, tree_selection):
|
def cb_format_tree_select(self, tree_selection):
|
||||||
"""
|
"""
|
||||||
|
@ -190,6 +190,7 @@ class ViewManager:
|
|||||||
self.views = []
|
self.views = []
|
||||||
self.pages = []
|
self.pages = []
|
||||||
self.file_loaded = False
|
self.file_loaded = False
|
||||||
|
self._prefs = None
|
||||||
self._build_main_window()
|
self._build_main_window()
|
||||||
self._connect_signals()
|
self._connect_signals()
|
||||||
self.do_load_plugins()
|
self.do_load_plugins()
|
||||||
@ -517,7 +518,9 @@ class ViewManager:
|
|||||||
|
|
||||||
def preferences_activate(self, obj):
|
def preferences_activate(self, obj):
|
||||||
try:
|
try:
|
||||||
GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
self._prefs = GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
||||||
|
self._key = self._prefs.connect('nameformat-changed',
|
||||||
|
self.active_page.build_tree)
|
||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -735,7 +738,11 @@ class ViewManager:
|
|||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
|
|
||||||
self.pages[num].change_page()
|
self.active_page.change_page()
|
||||||
|
if self._prefs:
|
||||||
|
self._prefs.disconnect(self._key)
|
||||||
|
self._key = self._prefs.connect('nameformat-changed',
|
||||||
|
self.active_page.build_tree)
|
||||||
|
|
||||||
def import_data(self, obj):
|
def import_data(self, obj):
|
||||||
if self.state.db.db_is_open:
|
if self.state.db.db_is_open:
|
||||||
|
Loading…
Reference in New Issue
Block a user