* src/ViewManager.py (preferences_activate): Use uistate to emit.
* src/DisplayState.py (DisplayState.__signals__): Add new signal. * src/GrampsCfg.py (cb_name_changed): Use uistate to emit signal. svn: r7265
This commit is contained in:
parent
9081b54202
commit
2e34d583c8
@ -1,4 +1,7 @@
|
||||
2006-08-25 Alex Roitman <shura@gramps-project.org>
|
||||
* src/ViewManager.py (preferences_activate): Use uistate to emit.
|
||||
* src/DisplayState.py (DisplayState.__signals__): Add new signal.
|
||||
* src/GrampsCfg.py (cb_name_changed): Use uistate to emit signal.
|
||||
* src/plugins/ChangeTypes.py: Clean up type name conversions; work
|
||||
over all the events, regardless of who references them.
|
||||
* src/RelLib/_GrampsType.py (get_standard_names, get_standard_xml):
|
||||
|
@ -249,6 +249,7 @@ class DisplayState(GrampsDb.GrampsDBCallback):
|
||||
|
||||
__signals__ = {
|
||||
'filters-changed' : (str,),
|
||||
'nameformat-changed' : None,
|
||||
}
|
||||
|
||||
def __init__(self, window, status, progress, warnbtn, uimanager):
|
||||
|
@ -46,7 +46,6 @@ from RelLib import Name
|
||||
import ManagedWindow
|
||||
from GrampsWidgets import *
|
||||
import QuestionDialog
|
||||
from GrampsDb import GrampsDBCallback
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -92,18 +91,13 @@ def get_researcher():
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class GrampsPreferences(ManagedWindow.ManagedWindow,GrampsDBCallback):
|
||||
|
||||
__signals__ = {
|
||||
'nameformat-changed': None,
|
||||
}
|
||||
|
||||
class GrampsPreferences(ManagedWindow.ManagedWindow):
|
||||
def __init__(self, uistate, dbstate):
|
||||
GrampsDBCallback.__init__(self)
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],GrampsPreferences)
|
||||
|
||||
self.dbstate = dbstate
|
||||
|
||||
|
||||
tlabel = gtk.Label()
|
||||
self.set_window(
|
||||
gtk.Dialog(_('Preferences'),
|
||||
@ -351,7 +345,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow,GrampsDBCallback):
|
||||
new_idx = the_list.get_value(the_iter,COL_NUM)
|
||||
Config.set(Config.NAME_FORMAT,new_idx)
|
||||
_nd.set_default_format(new_idx)
|
||||
self.emit('nameformat-changed')
|
||||
self.uistate.emit('nameformat-changed')
|
||||
|
||||
def cb_format_tree_select(self, tree_selection):
|
||||
"""
|
||||
|
@ -189,8 +189,8 @@ class ViewManager:
|
||||
self.active_page = None
|
||||
self.views = []
|
||||
self.pages = []
|
||||
self._key = None
|
||||
self.file_loaded = False
|
||||
self._prefs = None
|
||||
self._build_main_window()
|
||||
self._connect_signals()
|
||||
self.do_load_plugins()
|
||||
@ -518,9 +518,9 @@ class ViewManager:
|
||||
|
||||
def preferences_activate(self, obj):
|
||||
try:
|
||||
self._prefs = GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
||||
self._key = self._prefs.connect('nameformat-changed',
|
||||
self.active_page.build_tree)
|
||||
GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
||||
self._key = self.uistate.connect('nameformat-changed',
|
||||
self.active_page.build_tree)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
@ -739,10 +739,10 @@ class ViewManager:
|
||||
gtk.main_iteration()
|
||||
|
||||
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)
|
||||
if self._key:
|
||||
self.uistate.disconnect(self._key)
|
||||
self._key = self.uistate.connect('nameformat-changed',
|
||||
self.active_page.build_tree)
|
||||
|
||||
def import_data(self, obj):
|
||||
if self.state.db.db_is_open:
|
||||
|
Loading…
Reference in New Issue
Block a user