* src/GrampsIniKeys.py: provide support for the default schema
* src/GrampsKeys.py: select appropriate backend * various: switch from GrampsGconfKeys to GrampsKeys for normal usage * src/GrampsIniKeys.py: Alternate backend using .ini files instead of gconf svn: r3873
This commit is contained in:
@@ -66,7 +66,7 @@ import Plugins
|
||||
import PluginMgr
|
||||
import Utils
|
||||
import Bookmarks
|
||||
import GrampsGconfKeys
|
||||
import GrampsKeys
|
||||
import GrampsCfg
|
||||
import EditPerson
|
||||
import DbPrompter
|
||||
@@ -133,13 +133,14 @@ class Gramps:
|
||||
|
||||
GrampsCfg.loadConfig()
|
||||
|
||||
if GrampsGconfKeys.get_betawarn() == 0:
|
||||
if GrampsKeys.get_betawarn() == 0:
|
||||
WarningDialog(_("Use at your own risk"),
|
||||
_("This is an unstable development version of GRAMPS. "
|
||||
"It is intended as a technology preview. Do not trust your "
|
||||
"family database to this development version. This version may "
|
||||
"contain bugs which could corrupt your database."))
|
||||
GrampsGconfKeys.save_betawarn(1)
|
||||
GrampsKeys.save_betawarn(1)
|
||||
GrampsKeys.sync()
|
||||
|
||||
self.RelClass = PluginMgr.relationship_class
|
||||
self.relationship = self.RelClass(self.db)
|
||||
@@ -151,27 +152,27 @@ class Gramps:
|
||||
# Don't show main window until ArgHandler is done.
|
||||
# This prevents a window from annoyingly popping up when
|
||||
# the command line args are sufficient to operate without it.
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/researcher",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/researcher",
|
||||
self.researcher_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/statusbar",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/statusbar",
|
||||
self.statusbar_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/toolbar",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/toolbar",
|
||||
self.toolbar_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/toolbar-on",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/toolbar-on",
|
||||
self.toolbar_on_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/filter",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/filter",
|
||||
self.filter_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/view",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/view",
|
||||
self.sidebar_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/interface/familyview",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/interface/familyview",
|
||||
self.familyview_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/preferences/name-format",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/preferences/name-format",
|
||||
self.familyview_key_update)
|
||||
GrampsGconfKeys.client.notify_add("/apps/gramps/preferences/date-format",
|
||||
GrampsKeys.client.notify_add("/apps/gramps/preferences/date-format",
|
||||
self.date_format_key_update)
|
||||
self.topWindow.show()
|
||||
|
||||
if GrampsGconfKeys.get_usetips():
|
||||
if GrampsKeys.get_usetips():
|
||||
TipOfDay.TipOfDay()
|
||||
|
||||
self.db.set_researcher(GrampsCfg.get_researcher())
|
||||
@@ -181,12 +182,12 @@ class Gramps:
|
||||
self.familyview_key_update(client,cnxn_id,entry,data)
|
||||
|
||||
def researcher_key_update(self,client,cnxn_id,entry,data):
|
||||
self.db.set_person_id_prefix(GrampsGconfKeys.get_person_id_prefix())
|
||||
self.db.set_family_id_prefix(GrampsGconfKeys.get_family_id_prefix())
|
||||
self.db.set_source_id_prefix(GrampsGconfKeys.get_source_id_prefix())
|
||||
self.db.set_object_id_prefix(GrampsGconfKeys.get_object_id_prefix())
|
||||
self.db.set_place_id_prefix(GrampsGconfKeys.get_place_id_prefix())
|
||||
self.db.set_event_id_prefix(GrampsGconfKeys.get_event_id_prefix())
|
||||
self.db.set_person_id_prefix(GrampsKeys.get_person_id_prefix())
|
||||
self.db.set_family_id_prefix(GrampsKeys.get_family_id_prefix())
|
||||
self.db.set_source_id_prefix(GrampsKeys.get_source_id_prefix())
|
||||
self.db.set_object_id_prefix(GrampsKeys.get_object_id_prefix())
|
||||
self.db.set_place_id_prefix(GrampsKeys.get_place_id_prefix())
|
||||
self.db.set_event_id_prefix(GrampsKeys.get_event_id_prefix())
|
||||
|
||||
def statusbar_key_update(self,client,cnxn_id,entry,data):
|
||||
self.modify_statusbar()
|
||||
@@ -195,17 +196,17 @@ class Gramps:
|
||||
self.toolbar.set_style(GrampsCfg.get_toolbar_style())
|
||||
|
||||
def toolbar_on_key_update(self,client,cnxn_id,entry,data):
|
||||
is_on = GrampsGconfKeys.get_toolbar_on()
|
||||
is_on = GrampsKeys.get_toolbar_on()
|
||||
self.toolbar_btn.set_active(is_on)
|
||||
self.enable_toolbar(is_on)
|
||||
|
||||
def filter_key_update(self,client,cnxn_id,entry,data):
|
||||
is_on = GrampsGconfKeys.get_filter()
|
||||
is_on = GrampsKeys.get_filter()
|
||||
self.filter_btn.set_active(is_on)
|
||||
self.enable_filter(is_on)
|
||||
|
||||
def sidebar_key_update(self,client,cnxn_id,entry,data):
|
||||
is_on = GrampsGconfKeys.get_view()
|
||||
is_on = GrampsKeys.get_view()
|
||||
self.sidebar_btn.set_active(is_on)
|
||||
self.enable_sidebar(is_on)
|
||||
|
||||
@@ -387,25 +388,25 @@ class Gramps:
|
||||
"on_open_example" : self.open_example,
|
||||
})
|
||||
|
||||
self.filter_btn.set_active(GrampsGconfKeys.get_filter())
|
||||
self.enable_filter(GrampsGconfKeys.get_filter())
|
||||
self.toolbar_btn.set_active(GrampsGconfKeys.get_toolbar_on())
|
||||
self.enable_toolbar(GrampsGconfKeys.get_toolbar_on())
|
||||
self.filter_btn.set_active(GrampsKeys.get_filter())
|
||||
self.enable_filter(GrampsKeys.get_filter())
|
||||
self.toolbar_btn.set_active(GrampsKeys.get_toolbar_on())
|
||||
self.enable_toolbar(GrampsKeys.get_toolbar_on())
|
||||
|
||||
if not GrampsGconfKeys.get_screen_size_checked():
|
||||
GrampsGconfKeys.save_screen_size_checked(1)
|
||||
if not GrampsKeys.get_screen_size_checked():
|
||||
GrampsKeys.save_screen_size_checked(1)
|
||||
if gtk.gdk.screen_width() <= 900:
|
||||
GrampsGconfKeys.save_view(0)
|
||||
self.sidebar_btn.set_active(GrampsGconfKeys.get_view())
|
||||
self.enable_sidebar(GrampsGconfKeys.get_view())
|
||||
GrampsKeys.save_view(0)
|
||||
self.sidebar_btn.set_active(GrampsKeys.get_view())
|
||||
self.enable_sidebar(GrampsKeys.get_view())
|
||||
|
||||
self.find_place = None
|
||||
self.find_source = None
|
||||
self.find_media = None
|
||||
|
||||
if GrampsGconfKeys.get_default_view() == 0:
|
||||
if GrampsKeys.get_default_view() == 0:
|
||||
self.views.set_current_page(PERSON_VIEW)
|
||||
elif GrampsGconfKeys.get_family_view() == 0:
|
||||
elif GrampsKeys.get_family_view() == 0:
|
||||
self.views.set_current_page(FAMILY_VIEW1)
|
||||
else:
|
||||
self.views.set_current_page(FAMILY_VIEW2)
|
||||
@@ -789,7 +790,7 @@ class Gramps:
|
||||
|
||||
def on_sidebar_activate(self,obj):
|
||||
self.enable_sidebar(obj.get_active())
|
||||
GrampsGconfKeys.save_view(obj.get_active())
|
||||
GrampsKeys.save_view(obj.get_active())
|
||||
|
||||
def enable_sidebar(self,val):
|
||||
if val:
|
||||
@@ -806,10 +807,10 @@ class Gramps:
|
||||
self.filterbar.hide()
|
||||
|
||||
def on_filter_activate(self,obj):
|
||||
GrampsGconfKeys.save_filter(obj.get_active())
|
||||
GrampsKeys.save_filter(obj.get_active())
|
||||
|
||||
def on_toolbar_activate(self,obj):
|
||||
GrampsGconfKeys.save_toolbar_on(obj.get_active())
|
||||
GrampsKeys.save_toolbar_on(obj.get_active())
|
||||
|
||||
def enable_toolbar(self,val):
|
||||
if val:
|
||||
@@ -1102,7 +1103,7 @@ class Gramps:
|
||||
name = os.path.basename(filename)
|
||||
self.topWindow.set_title("%s - GRAMPS" % name)
|
||||
else:
|
||||
GrampsGconfKeys.save_last_file("")
|
||||
GrampsKeys.save_last_file("")
|
||||
ErrorDialog(_('Cannot open database'),
|
||||
_('The database file specified could not be opened file.'))
|
||||
return 0
|
||||
@@ -1376,7 +1377,7 @@ class Gramps:
|
||||
if self.active_person == None:
|
||||
self.status_text("")
|
||||
else:
|
||||
if GrampsGconfKeys.get_statusbar() <= 1:
|
||||
if GrampsKeys.get_statusbar() <= 1:
|
||||
pname = NameDisplay.displayer.display(self.active_person)
|
||||
name = "[%s] %s" % (self.active_person.get_gramps_id(),pname)
|
||||
else:
|
||||
@@ -1425,7 +1426,7 @@ class Gramps:
|
||||
|
||||
def on_family_activate(self,obj):
|
||||
"""Switches to the family view"""
|
||||
if GrampsGconfKeys.get_family_view() == 0:
|
||||
if GrampsKeys.get_family_view() == 0:
|
||||
self.on_family1_activate(obj)
|
||||
else:
|
||||
self.on_family2_activate(obj)
|
||||
@@ -1563,7 +1564,7 @@ class Gramps:
|
||||
callback(_('Setting up bookmarks...'))
|
||||
self.setup_bookmarks()
|
||||
|
||||
GrampsGconfKeys.save_last_file(name)
|
||||
GrampsKeys.save_last_file(name)
|
||||
self.gtop.get_widget("filter").set_text("")
|
||||
|
||||
if callback:
|
||||
|
||||
Reference in New Issue
Block a user