* 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
41e26b13bb
commit
46248ee75f
@ -1,4 +1,7 @@
|
|||||||
2006-08-25 Alex Roitman <shura@gramps-project.org>
|
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
|
* src/plugins/ChangeTypes.py: Clean up type name conversions; work
|
||||||
over all the events, regardless of who references them.
|
over all the events, regardless of who references them.
|
||||||
* src/RelLib/_GrampsType.py (get_standard_names, get_standard_xml):
|
* src/RelLib/_GrampsType.py (get_standard_names, get_standard_xml):
|
||||||
|
@ -249,6 +249,7 @@ class DisplayState(GrampsDb.GrampsDBCallback):
|
|||||||
|
|
||||||
__signals__ = {
|
__signals__ = {
|
||||||
'filters-changed' : (str,),
|
'filters-changed' : (str,),
|
||||||
|
'nameformat-changed' : None,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, window, status, progress, warnbtn, uimanager):
|
def __init__(self, window, status, progress, warnbtn, uimanager):
|
||||||
|
@ -46,7 +46,6 @@ from RelLib import Name
|
|||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from GrampsWidgets import *
|
from GrampsWidgets import *
|
||||||
import QuestionDialog
|
import QuestionDialog
|
||||||
from GrampsDb import GrampsDBCallback
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -92,14 +91,9 @@ def get_researcher():
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class GrampsPreferences(ManagedWindow.ManagedWindow,GrampsDBCallback):
|
class GrampsPreferences(ManagedWindow.ManagedWindow):
|
||||||
|
|
||||||
__signals__ = {
|
|
||||||
'nameformat-changed': None,
|
|
||||||
}
|
|
||||||
|
|
||||||
def __init__(self, uistate, dbstate):
|
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
|
||||||
@ -351,7 +345,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow,GrampsDBCallback):
|
|||||||
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')
|
self.uistate.emit('nameformat-changed')
|
||||||
|
|
||||||
def cb_format_tree_select(self, tree_selection):
|
def cb_format_tree_select(self, tree_selection):
|
||||||
"""
|
"""
|
||||||
|
@ -189,8 +189,8 @@ class ViewManager:
|
|||||||
self.active_page = None
|
self.active_page = None
|
||||||
self.views = []
|
self.views = []
|
||||||
self.pages = []
|
self.pages = []
|
||||||
|
self._key = None
|
||||||
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()
|
||||||
@ -518,9 +518,9 @@ class ViewManager:
|
|||||||
|
|
||||||
def preferences_activate(self, obj):
|
def preferences_activate(self, obj):
|
||||||
try:
|
try:
|
||||||
self._prefs = GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
GrampsCfg.GrampsPreferences(self.uistate,self.state)
|
||||||
self._key = self._prefs.connect('nameformat-changed',
|
self._key = self.uistate.connect('nameformat-changed',
|
||||||
self.active_page.build_tree)
|
self.active_page.build_tree)
|
||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -739,10 +739,10 @@ class ViewManager:
|
|||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
|
|
||||||
self.active_page.change_page()
|
self.active_page.change_page()
|
||||||
if self._prefs:
|
if self._key:
|
||||||
self._prefs.disconnect(self._key)
|
self.uistate.disconnect(self._key)
|
||||||
self._key = self._prefs.connect('nameformat-changed',
|
self._key = self.uistate.connect('nameformat-changed',
|
||||||
self.active_page.build_tree)
|
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