* 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:
Alex Roitman 2006-08-25 23:46:19 +00:00
parent 41e26b13bb
commit 46248ee75f
4 changed files with 16 additions and 18 deletions

View File

@ -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):

View File

@ -249,6 +249,7 @@ class DisplayState(GrampsDb.GrampsDBCallback):
__signals__ = {
'filters-changed' : (str,),
'nameformat-changed' : None,
}
def __init__(self, window, status, progress, warnbtn, uimanager):

View File

@ -46,7 +46,6 @@ from RelLib import Name
import ManagedWindow
from GrampsWidgets import *
import QuestionDialog
from GrampsDb import GrampsDBCallback
#-------------------------------------------------------------------------
#
@ -92,14 +91,9 @@ 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
@ -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):
"""

View File

@ -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,8 +518,8 @@ class ViewManager:
def preferences_activate(self, obj):
try:
self._prefs = GrampsCfg.GrampsPreferences(self.uistate,self.state)
self._key = self._prefs.connect('nameformat-changed',
GrampsCfg.GrampsPreferences(self.uistate,self.state)
self._key = self.uistate.connect('nameformat-changed',
self.active_page.build_tree)
except Errors.WindowActiveError:
pass
@ -739,9 +739,9 @@ 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',
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):