* 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:
Don Allingham 2005-01-06 17:28:31 +00:00
parent f0032a4c59
commit 5cb6bd08d5
23 changed files with 211 additions and 191 deletions

View File

@ -1,3 +1,13 @@
2005-01-06 Don Allingham <dallingham@users.sourceforge.net>
* const.py.in: add support for overriding gconf usage
* src/GrampsIniKeys.py: provide support for the default schema
* src/GrampsKeys.py: select appropriate backend
* various: switch from GrampsGconfKeys to GrampsKeys for normal usage
2005-01-05 Douglas S. Blank <dblank@brynmawr.edu>
* src/GrampsIniKeys.py: Alternate backend using .ini files instead
of gconf
2005-01-05 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps_main.py: detect pygtk_version before passing
False for markup on MenuItem

View File

@ -46,7 +46,7 @@ import ReadXML
import GrampsMime
import DbPrompter
import QuestionDialog
import GrampsGconfKeys
import GrampsKeys
import RecentFiles
import PluginMgr
import Report
@ -324,8 +324,8 @@ class ArgHandler:
if self.imports:
self.parent.import_tool_callback()
elif GrampsGconfKeys.get_lastfile() and GrampsGconfKeys.get_autoload():
if self.auto_save_load(GrampsGconfKeys.get_lastfile()) == 0:
elif GrampsKeys.get_lastfile() and GrampsKeys.get_autoload():
if self.auto_save_load(GrampsKeys.get_lastfile()) == 0:
DbPrompter.DbPrompter(self.parent,0)
else:
DbPrompter.DbPrompter(self.parent,0)

View File

@ -123,8 +123,8 @@ except:
parser = DateParser.DateParser()
try:
import GrampsGconfKeys
val = GrampsGconfKeys.get_date_format(_lang_to_display[_lang].formats)
import GrampsKeys
val = GrampsKeys.get_date_format(_lang_to_display[_lang].formats)
except:
val = 0

View File

@ -50,7 +50,7 @@ import PluginMgr
import GrampsBSDDB
import GrampsXMLDB
import GrampsGEDDB
import GrampsGconfKeys
import GrampsKeys
import RecentFiles
#-------------------------------------------------------------------------
@ -162,11 +162,11 @@ class ExistingDbPrompter:
# Suggested folder: try last open file, last import, last export,
# then home.
default_dir = os.path.split(GrampsGconfKeys.get_lastfile())[0] + os.path.sep
default_dir = os.path.split(GrampsKeys.get_lastfile())[0] + os.path.sep
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_import_dir()
default_dir = GrampsKeys.get_last_import_dir()
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_export_dir()
default_dir = GrampsKeys.get_last_export_dir()
if len(default_dir)<=1:
default_dir = '~/'
@ -257,11 +257,11 @@ class ImportDbPrompter:
# Suggested folder: try last open file, import, then last export,
# then home.
default_dir = GrampsGconfKeys.get_last_import_dir()
default_dir = GrampsKeys.get_last_import_dir()
if len(default_dir)<=1:
default_dir = os.path.split(GrampsGconfKeys.get_lastfile())[0] + os.path.sep
default_dir = os.path.split(GrampsKeys.get_lastfile())[0] + os.path.sep
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_export_dir()
default_dir = GrampsKeys.get_last_export_dir()
if len(default_dir)<=1:
default_dir = '~/'
@ -278,7 +278,7 @@ class ImportDbPrompter:
# return True
(the_path,the_file) = os.path.split(filename)
GrampsGconfKeys.save_last_import_dir(the_path)
GrampsKeys.save_last_import_dir(the_path)
for (importData,mime_filter,mime_type,native_format) in PluginMgr.import_list:
if filetype == mime_type or the_file == mime_type:
choose.destroy()
@ -335,11 +335,11 @@ class NewNativeDbPrompter:
# Suggested folder: try last open file, import, then last export,
# then home.
default_dir = os.path.split(GrampsGconfKeys.get_lastfile())[0] + os.path.sep
default_dir = os.path.split(GrampsKeys.get_lastfile())[0] + os.path.sep
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_import_dir()
default_dir = GrampsKeys.get_last_import_dir()
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_export_dir()
default_dir = GrampsKeys.get_last_export_dir()
if len(default_dir)<=1:
default_dir = '~/'
@ -379,7 +379,7 @@ def open_native(parent,filename,filetype):
"""
(the_path,the_file) = os.path.split(filename)
GrampsGconfKeys.save_last_import_dir(the_path)
GrampsKeys.save_last_import_dir(the_path)
success = False
if filetype == const.app_gramps:

View File

@ -48,7 +48,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK, INTERP_BILINEAR, pixbuf_new_from_
#-------------------------------------------------------------------------
import const
import Utils
import GrampsGconfKeys
import GrampsKeys
import GrampsCfg
import GrampsMime
import ImageSelect
@ -331,7 +331,7 @@ class EditPerson:
self.lds_endowment = RelLib.LdsOrd(self.person.get_lds_endowment())
self.lds_sealing = RelLib.LdsOrd(self.person.get_lds_sealing())
if GrampsGconfKeys.get_uselds() \
if GrampsKeys.get_uselds() \
or (not self.lds_baptism.is_empty()) \
or (not self.lds_endowment.is_empty()) \
or (not self.lds_sealing.is_empty()):
@ -1146,7 +1146,7 @@ class EditPerson:
"""If the data has changed, give the user a chance to cancel
the close window"""
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
if self.did_data_change() and not GrampsKeys.get_dont_ask():
n = "<i>%s</i>" % self.person.get_primary_name().get_regular_name()
SaveDialog(_('Save changes to %s?') % n,
_('If you close without saving, the changes you '
@ -1162,7 +1162,7 @@ class EditPerson:
def on_delete_event(self,obj,b):
"""If the data has changed, give the user a chance to cancel
the close window"""
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
if self.did_data_change() and not GrampsKeys.get_dont_ask():
n = "<i>%s</i>" % self.person.get_primary_name().get_regular_name()
SaveDialog(_('Save Changes to %s?') % n,
_('If you close without saving, the changes you '

View File

@ -51,7 +51,7 @@ import const
import Utils
import Plugins
import QuestionDialog
import GrampsGconfKeys
import GrampsKeys
#-------------------------------------------------------------------------
#
@ -205,7 +205,7 @@ class Exporter:
Depending on the success status, set the text for the final page.
"""
filename = self.chooser.get_filename()
GrampsGconfKeys.save_last_export_dir(os.path.split(filename)[0])
GrampsKeys.save_last_export_dir(os.path.split(filename)[0])
ix = self.get_selected_format_index()
if self.exports[ix][3]:
success = self.exports[ix][0](self.parent.db,filename,self.person,
@ -334,9 +334,9 @@ class Exporter:
ext = self.exports[ix][4]
# Suggested folder: try last export, then last import, then home.
default_dir = GrampsGconfKeys.get_last_export_dir()
default_dir = GrampsKeys.get_last_export_dir()
if len(default_dir)<=1:
default_dir = GrampsGconfKeys.get_last_import_dir()
default_dir = GrampsKeys.get_last_import_dir()
if len(default_dir)<=1:
default_dir = '~/'

View File

@ -36,7 +36,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK
#-------------------------------------------------------------------------
import const
import Utils
import GrampsGconfKeys
import GrampsKeys
import GrampsCfg
import AddSpouse
import SelectChild
@ -183,7 +183,7 @@ class FamilyView:
self.sp_drag_data_received)
def init_interface(self):
fv = GrampsGconfKeys.get_family_view()
fv = GrampsKeys.get_family_view()
self.set_widgets(fv)
already_init = self.cadded[fv]
@ -710,7 +710,7 @@ class FamilyView:
return
person = RelLib.Person()
autoname = GrampsGconfKeys.get_lastnamegen()
autoname = GrampsKeys.get_lastnamegen()
if autoname == 0:
name = self.north_american(0)

View File

@ -43,7 +43,7 @@ import gnome
# gramps modules
#
#-------------------------------------------------------------------------
import GrampsGconfKeys
import GrampsKeys
import RelLib
import const
import Utils
@ -82,12 +82,12 @@ panellist = [
# Not exactly gconf keys, but the functions directly dependent on them
def get_toolbar_style():
saved_toolbar = GrampsGconfKeys.get_toolbar()
saved_toolbar = GrampsKeys.get_toolbar()
if saved_toolbar in range(4):
return saved_toolbar
else:
try:
gnome_toolbar_str = GrampsGconfKeys.client.get_string("/desktop/gnome/interface/toolbar_style")
gnome_toolbar_str = GrampsKeys.client.get_string("/desktop/gnome/interface/toolbar_style")
gnome_toolbar = eval("gtk.TOOLBAR_%s" %
gnome_toolbar_str.replace('-','_').upper())
except:
@ -96,7 +96,7 @@ def get_toolbar_style():
def set_calendar_date_format():
format_list = DateHandler.get_date_formats()
DateHandler.set_format(GrampsGconfKeys.get_date_format(format_list))
DateHandler.set_format(GrampsKeys.get_date_format(format_list))
#-------------------------------------------------------------------------
#
@ -131,14 +131,14 @@ def loadConfig():
#
#-------------------------------------------------------------------------
def get_researcher():
n = GrampsGconfKeys.get_researcher_name()
a = GrampsGconfKeys.get_researcher_addr()
c = GrampsGconfKeys.get_researcher_city()
s = GrampsGconfKeys.get_researcher_state()
ct = GrampsGconfKeys.get_researcher_country()
p = GrampsGconfKeys.get_researcher_postal()
ph = GrampsGconfKeys.get_researcher_phone()
e = GrampsGconfKeys.get_researcher_email()
n = GrampsKeys.get_researcher_name()
a = GrampsKeys.get_researcher_addr()
c = GrampsKeys.get_researcher_city()
s = GrampsKeys.get_researcher_state()
ct = GrampsKeys.get_researcher_country()
p = GrampsKeys.get_researcher_postal()
ph = GrampsKeys.get_researcher_phone()
e = GrampsKeys.get_researcher_email()
owner = RelLib.Researcher()
owner.set(n,a,c,s,ct,p,ph,e)
@ -194,73 +194,73 @@ class GrampsPreferences:
def build(self):
auto = self.top.get_widget("autoload")
auto.set_active(GrampsGconfKeys.get_autoload())
auto.set_active(GrampsKeys.get_autoload())
auto.connect('toggled',
lambda obj: GrampsGconfKeys.save_autoload(obj.get_active()))
lambda obj: GrampsKeys.save_autoload(obj.get_active()))
lds = self.top.get_widget("uselds")
lds.set_active(GrampsGconfKeys.get_uselds())
lds.set_active(GrampsKeys.get_uselds())
lds.connect('toggled',
lambda obj: GrampsGconfKeys.save_uselds(obj.get_active()))
lambda obj: GrampsKeys.save_uselds(obj.get_active()))
ipr = self.top.get_widget("iprefix")
ipr.set_text(GrampsGconfKeys.get_person_id_prefix())
ipr.set_text(GrampsKeys.get_person_id_prefix())
ipr.connect('changed',
lambda obj: GrampsGconfKeys.save_iprefix(obj.get_text()))
lambda obj: GrampsKeys.save_iprefix(obj.get_text()))
opr = self.top.get_widget("oprefix")
opr.set_text(GrampsGconfKeys.get_object_id_prefix())
opr.set_text(GrampsKeys.get_object_id_prefix())
opr.connect('changed',
lambda obj: GrampsGconfKeys.save_oprefix(obj.get_text()))
lambda obj: GrampsKeys.save_oprefix(obj.get_text()))
fpr = self.top.get_widget("fprefix")
fpr.set_text(GrampsGconfKeys.get_family_id_prefix())
fpr.set_text(GrampsKeys.get_family_id_prefix())
fpr.connect('changed',
lambda obj: GrampsGconfKeys.save_fprefix(obj.get_text()))
lambda obj: GrampsKeys.save_fprefix(obj.get_text()))
spr = self.top.get_widget("sprefix")
spr.set_text(GrampsGconfKeys.get_source_id_prefix())
spr.set_text(GrampsKeys.get_source_id_prefix())
spr.connect('changed',
lambda obj: GrampsGconfKeys.save_sprefix(obj.get_text()))
lambda obj: GrampsKeys.save_sprefix(obj.get_text()))
ppr = self.top.get_widget("pprefix")
ppr.set_text(GrampsGconfKeys.get_place_id_prefix())
ppr.set_text(GrampsKeys.get_place_id_prefix())
ppr.connect('changed',
lambda obj: GrampsGconfKeys.save_pprefix(obj.get_text()))
lambda obj: GrampsKeys.save_pprefix(obj.get_text()))
sb2 = self.top.get_widget("stat2")
sb3 = self.top.get_widget("stat3")
if GrampsGconfKeys.get_statusbar() == 0 or GrampsGconfKeys.get_statusbar() == 1:
if GrampsKeys.get_statusbar() == 0 or GrampsKeys.get_statusbar() == 1:
sb2.set_active(1)
else:
sb3.set_active(1)
sb2.connect('toggled',
lambda obj: GrampsGconfKeys.save_statusbar(2-obj.get_active()))
lambda obj: GrampsKeys.save_statusbar(2-obj.get_active()))
toolbarmenu = self.top.get_widget("tooloptmenu")
toolbarmenu.set_active(GrampsGconfKeys.get_toolbar()-1)
print GrampsGconfKeys.get_toolbar()
toolbarmenu.set_active(GrampsKeys.get_toolbar()-1)
print GrampsKeys.get_toolbar()
toolbarmenu.connect('changed',
lambda obj: GrampsGconfKeys.save_toolbar(obj.get_active()+1))
lambda obj: GrampsKeys.save_toolbar(obj.get_active()+1))
pvbutton = self.top.get_widget('pvbutton')
fvbutton = self.top.get_widget('fvbutton')
if GrampsGconfKeys.get_default_view() == 0:
if GrampsKeys.get_default_view() == 0:
pvbutton.set_active(1)
else:
fvbutton.set_active(1)
fvbutton.connect('toggled',
lambda obj: GrampsGconfKeys.save_default_view(obj.get_active()))
lambda obj: GrampsKeys.save_default_view(obj.get_active()))
familyview1 = self.top.get_widget('familyview1')
familyview2 = self.top.get_widget('familyview2')
if GrampsGconfKeys.get_family_view() == 0:
if GrampsKeys.get_family_view() == 0:
familyview1.set_active(1)
else:
familyview2.set_active(1)
familyview2.connect('toggled',
lambda obj: GrampsGconfKeys.save_family_view(obj.get_active()))
lambda obj: GrampsKeys.save_family_view(obj.get_active()))
usetips = self.top.get_widget('usetips')
usetips.set_active(GrampsGconfKeys.get_usetips())
usetips.set_active(GrampsKeys.get_usetips())
usetips.connect('toggled',
lambda obj: GrampsGconfKeys.save_usetips(obj.get_active()))
lambda obj: GrampsKeys.save_usetips(obj.get_active()))
lastnamegen_obj = self.top.get_widget("lastnamegen")
menu = gtk.Menu()
@ -270,11 +270,11 @@ class GrampsPreferences:
item.set_data(DATA,index)
item.show()
menu.append(item)
menu.set_active(GrampsGconfKeys.get_lastnamegen(_surname_styles))
menu.set_active(GrampsKeys.get_lastnamegen(_surname_styles))
lastnamegen_obj.set_menu(menu)
lastnamegen_obj.connect("changed",
lambda obj:
GrampsGconfKeys.save_lastnamegen(obj.get_menu().get_active().get_data(DATA),_surname_styles)
GrampsKeys.save_lastnamegen(obj.get_menu().get_active().get_data(DATA),_surname_styles)
)
date_option = self.top.get_widget("date_format")
@ -288,48 +288,48 @@ class GrampsPreferences:
try:
# Technically, a selected format might be out of range
# for this locale's format list.
date_menu.set_active(GrampsGconfKeys.get_date_format(dlist))
date_menu.set_active(GrampsKeys.get_date_format(dlist))
except:
pass
date_option.set_menu(date_menu)
date_option.connect("changed",
lambda obj:
GrampsGconfKeys.save_date_format(obj.get_menu().get_active().get_data(INDEX),dlist)
GrampsKeys.save_date_format(obj.get_menu().get_active().get_data(INDEX),dlist)
)
resname = self.top.get_widget("resname")
resname.set_text(GrampsGconfKeys.get_researcher_name())
resname.set_text(GrampsKeys.get_researcher_name())
resname.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_name(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_name(obj.get_text()))
resaddr = self.top.get_widget("resaddr")
resaddr.set_text(GrampsGconfKeys.get_researcher_addr())
resaddr.set_text(GrampsKeys.get_researcher_addr())
resaddr.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_addr(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_addr(obj.get_text()))
rescity = self.top.get_widget("rescity")
rescity.set_text(GrampsGconfKeys.get_researcher_city())
rescity.set_text(GrampsKeys.get_researcher_city())
rescity.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_city(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_city(obj.get_text()))
resstate = self.top.get_widget("resstate")
resstate.set_text(GrampsGconfKeys.get_researcher_state())
resstate.set_text(GrampsKeys.get_researcher_state())
resstate.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_state(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_state(obj.get_text()))
rescountry = self.top.get_widget("rescountry")
rescountry.set_text(GrampsGconfKeys.get_researcher_country())
rescountry.set_text(GrampsKeys.get_researcher_country())
rescountry.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_country(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_country(obj.get_text()))
respostal = self.top.get_widget("respostal")
respostal.set_text(GrampsGconfKeys.get_researcher_postal())
respostal.set_text(GrampsKeys.get_researcher_postal())
respostal.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_postal(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_postal(obj.get_text()))
resphone = self.top.get_widget("resphone")
resphone.set_text(GrampsGconfKeys.get_researcher_phone())
resphone.set_text(GrampsKeys.get_researcher_phone())
resphone.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_phone(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_phone(obj.get_text()))
resemail = self.top.get_widget("resemail")
resemail.set_text(GrampsGconfKeys.get_researcher_email())
resemail.set_text(GrampsKeys.get_researcher_email())
resemail.connect('changed',
lambda obj: GrampsGconfKeys.save_researcher_email(obj.get_text()))
lambda obj: GrampsKeys.save_researcher_email(obj.get_text()))
def select(self,obj):
store,node = self.selection.get_selected()

View File

@ -41,7 +41,7 @@ import os
import md5
import gtk
import GrampsGconfKeys
import GrampsKeys
import Utils
#-------------------------------------------------------------------------
@ -123,12 +123,12 @@ class GrampsDbBase:
self.lmap_index = 0
self.omap_index = 0
self.set_person_id_prefix(GrampsGconfKeys.get_person_id_prefix())
self.set_object_id_prefix(GrampsGconfKeys.get_object_id_prefix())
self.set_family_id_prefix(GrampsGconfKeys.get_family_id_prefix())
self.set_source_id_prefix(GrampsGconfKeys.get_source_id_prefix())
self.set_place_id_prefix(GrampsGconfKeys.get_place_id_prefix())
self.set_event_id_prefix(GrampsGconfKeys.get_event_id_prefix())
self.set_person_id_prefix(GrampsKeys.get_person_id_prefix())
self.set_object_id_prefix(GrampsKeys.get_object_id_prefix())
self.set_family_id_prefix(GrampsKeys.get_family_id_prefix())
self.set_source_id_prefix(GrampsKeys.get_source_id_prefix())
self.set_place_id_prefix(GrampsKeys.get_place_id_prefix())
self.set_event_id_prefix(GrampsKeys.get_event_id_prefix())
self.open = 0
self.genderStats = GenderStats()

View File

@ -48,7 +48,7 @@ import gtk.glade
#-------------------------------------------------------------------------
import const
import Utils
import GrampsGconfKeys
import GrampsKeys
import NameDisplay
import Plugins
import RelLib
@ -470,12 +470,12 @@ class Gallery(ImageSelect):
(root,ext) = os.path.splitext(basename)
photo.set_description(root)
self.savephoto(photo)
if GrampsGconfKeys.get_media_reference() == 0:
if GrampsKeys.get_media_reference() == 0:
self.db.set_thumbnail_image(photo.get_handle(),
self.path)
photo.set_path(name)
self.parent.lists_changed = 1
if GrampsGconfKeys.get_media_global():
if GrampsKeys.get_media_global():
GlobalMediaProperties(self.db,photo,None,
self,self.parent_window)
elif protocol != "":
@ -505,7 +505,7 @@ class Gallery(ImageSelect):
return
self.add_thumbnail(oref)
self.parent.lists_changed = 1
if GrampsGconfKeys.get_media_global():
if GrampsKeys.get_media_global():
GlobalMediaProperties(self.db,photo,None,
self,self.parent_window)
else:
@ -535,7 +535,7 @@ class Gallery(ImageSelect):
self.dataobj.add_media_reference(oref)
self.add_thumbnail(oref)
self.parent.lists_changed = 1
if GrampsGconfKeys.get_media_global():
if GrampsKeys.get_media_global():
LocalMediaProperties(oref,self.path,self,self.parent_window)
def on_photolist_drag_data_get(self,w, context, selection_data, info, time):

View File

@ -47,7 +47,7 @@ import RelLib
import ImageSelect
import DateHandler
import Sources
import GrampsGconfKeys
import GrampsKeys
import NameDisplay
from QuestionDialog import QuestionDialog, WarningDialog, SaveDialog
@ -556,7 +556,7 @@ class Marriage:
self.close(0)
def on_cancel_edit(self,obj):
if self.did_data_change() and not GrampsGconfKeys.get_dont_ask():
if self.did_data_change() and not GrampsKeys.get_dont_ask():
global quit
self.quit = obj
SaveDialog(_('Save Changes?'),

View File

@ -43,7 +43,7 @@ import gtk.gdk
#-------------------------------------------------------------------------
import RelLib
import Utils
import GrampsGconfKeys
import GrampsKeys
import const
import ImageSelect
import RelImage
@ -389,13 +389,13 @@ class MediaView:
photo.set_description(description)
trans = self.db.transaction_begin()
self.db.add_object(photo,trans)
if GrampsGconfKeys.get_media_reference() == 0:
if GrampsKeys.get_media_reference() == 0:
self.db.set_thumbnail_image(photo.get_handle(),name)
self.db.commit_media_object(photo,trans)
self.db.transaction_commit(trans,_("Add Media Object"))
self.build_tree()
if GrampsGconfKeys.get_media_global():
if GrampsKeys.get_media_global():
ImageSelect.GlobalMediaProperties(self.db,photo,
self.update_display,
self,self.topWindow)
@ -427,7 +427,7 @@ class MediaView:
self.db.commit_media_object(photo,trans)
self.db.transaction_commit(trans,_("Add Media Object"))
if GrampsGconfKeys.get_media_global():
if GrampsKeys.get_media_global():
ImageSelect.GlobalMediaProperties(self.db,photo,None,
self,self.topWindow)

View File

@ -45,7 +45,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import const
import GrampsGconfKeys
import GrampsKeys
import Errors
#-------------------------------------------------------------------------
@ -133,7 +133,7 @@ def load_plugins(direct):
except:
failmsg_list.append((filename,sys.exc_info()))
if GrampsGconfKeys.get_pop_plugin_status() and len(expect_list)+len(failmsg_list):
if GrampsKeys.get_pop_plugin_status() and len(expect_list)+len(failmsg_list):
PluginStatus()
#-------------------------------------------------------------------------
@ -199,7 +199,7 @@ def reload_plugins(obj=None,junk1=None,junk2=None,junk3=None):
except:
failmsg_list.append((filename,sys.exc_info()))
if GrampsGconfKeys.get_pop_plugin_status():
if GrampsKeys.get_pop_plugin_status():
global status_up
if len(failmsg_list):
PluginStatus()

View File

@ -57,7 +57,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
import const
import Utils
import GrampsGconfKeys
import GrampsKeys
import Errors
import Report
import PluginMgr
@ -361,13 +361,13 @@ class PluginStatus:
self.top.set_title("%s - GRAMPS" % _('Plugin status'))
window = self.glade.get_widget("text")
self.pop_button = self.glade.get_widget("pop_button")
if GrampsGconfKeys.get_pop_plugin_status():
if GrampsKeys.get_pop_plugin_status():
self.pop_button.set_active(1)
else:
self.pop_button.set_active(0)
self.pop_button.connect('toggled',
lambda obj: GrampsGconfKeys.save_pop_plugin_status(self.pop_button.get_active()))
GrampsGconfKeys.client.notify_add("/apps/gramps/behavior/pop-plugin-status",
lambda obj: GrampsKeys.save_pop_plugin_status(self.pop_button.get_active()))
GrampsKeys.client.notify_add("/apps/gramps/behavior/pop-plugin-status",
self.pop_button_update)
self.glade.signal_autoconnect({
'on_close_clicked' : self.close,
@ -408,7 +408,7 @@ class PluginStatus:
gnome.help_display('gramps-manual','gramps-getting-started')
def pop_button_update(self, client,cnxn_id,entry,data):
self.pop_button.set_active(GrampsGconfKeys.get_pop_plugin_status())
self.pop_button.set_active(GrampsKeys.get_pop_plugin_status())
#-------------------------------------------------------------------------
#
@ -509,7 +509,7 @@ class GrampsTextFormatComboBox(gtk.ComboBox):
self.pack_start(cell,True)
self.add_attribute(cell,'text',0)
out_pref = GrampsGconfKeys.get_output_preference()
out_pref = GrampsKeys.get_output_preference()
index = 0
_textdoc.sort()
active_index = 0
@ -554,7 +554,7 @@ class GrampsDrawFormatComboBox(gtk.ComboBox):
self.pack_start(cell,True)
self.add_attribute(cell,'text',0)
out_pref = GrampsGconfKeys.get_output_preference()
out_pref = GrampsKeys.get_output_preference()
index = 0
_drawdoc.sort()
active_index = 0
@ -599,7 +599,7 @@ class GrampsBookFormatComboBox(gtk.ComboBox):
self.pack_start(cell,True)
self.add_attribute(cell,'text',0)
out_pref = GrampsGconfKeys.get_output_preference()
out_pref = GrampsKeys.get_output_preference()
index = 0
_drawdoc.sort()
active_index = 0

View File

@ -21,7 +21,7 @@
import gtk
import gtk.glade
import const
import GrampsGconfKeys
import GrampsKeys
from gettext import gettext as _
@ -50,7 +50,7 @@ class SaveDialog:
elif response == gtk.RESPONSE_YES:
self.task2()
GrampsGconfKeys.save_dont_ask(self.dontask.get_active())
GrampsKeys.save_dont_ask(self.dontask.get_active())
self.top.destroy()
class QuestionDialog:

View File

@ -52,7 +52,7 @@ import Utils
import Plugins
import BaseDoc
import StyleEditor
import GrampsGconfKeys
import GrampsKeys
import PaperMenu
import Errors
import GenericFilter
@ -962,7 +962,7 @@ class ReportDialog(BareReportDialog):
"""Get the name of the directory to which the target dialog
box should default. This value can be set in the preferences
panel."""
return GrampsGconfKeys.get_report_dir()
return GrampsKeys.get_report_dir()
def set_default_directory(self, value):
"""Save the name of the current directory, so that any future
@ -972,7 +972,7 @@ class ReportDialog(BareReportDialog):
This means that the last directory used will only be
remembered for this session of gramps unless the user saves
his/her preferences."""
GrampsGconfKeys.save_report_dir(value)
GrampsKeys.save_report_dir(value)
#------------------------------------------------------------------------
#

View File

@ -49,7 +49,7 @@ except:
#
#-------------------------------------------------------------------------
import const
import GrampsGconfKeys
import GrampsKeys
import Utils
import BaseDoc
@ -188,7 +188,7 @@ class OptionListCollection:
# Default values for common options
default_style_name = "default"
default_paper_name = GrampsGconfKeys.get_paper_preference()
default_paper_name = GrampsKeys.get_paper_preference()
default_template_name = ""
default_orientation = BaseDoc.PAPER_PORTRAIT
default_format_name = _('Print...')

View File

@ -26,12 +26,12 @@ import gtk.glade
import gnome
import gnome.ui
import GrampsGconfKeys
import GrampsKeys
from gettext import gettext as _
def need_to_run():
val = GrampsGconfKeys.get_startup()
val = GrampsKeys.get_startup()
if val < const.startup:
return 1
return 0
@ -95,18 +95,19 @@ class StartupDialog:
return p
def complete(self,obj,obj2):
GrampsGconfKeys.save_researcher_name(unicode(self.name.get_text()))
GrampsGconfKeys.save_researcher_addr(unicode(self.addr.get_text()))
GrampsGconfKeys.save_researcher_city(unicode(self.city.get_text()))
GrampsGconfKeys.save_researcher_state(unicode(self.state.get_text()))
GrampsGconfKeys.save_researcher_postal(unicode(self.postal.get_text()))
GrampsGconfKeys.save_researcher_country(unicode(self.country.get_text()))
GrampsGconfKeys.save_researcher_phone(unicode(self.phone.get_text()))
GrampsGconfKeys.save_researcher_email(unicode(self.email.get_text()))
GrampsKeys.save_researcher_name(unicode(self.name.get_text()))
GrampsKeys.save_researcher_addr(unicode(self.addr.get_text()))
GrampsKeys.save_researcher_city(unicode(self.city.get_text()))
GrampsKeys.save_researcher_state(unicode(self.state.get_text()))
GrampsKeys.save_researcher_postal(unicode(self.postal.get_text()))
GrampsKeys.save_researcher_country(unicode(self.country.get_text()))
GrampsKeys.save_researcher_phone(unicode(self.phone.get_text()))
GrampsKeys.save_researcher_email(unicode(self.email.get_text()))
GrampsGconfKeys.save_uselds(self.lds.get_active())
GrampsGconfKeys.save_startup(const.startup)
self.w.destroy()
GrampsKeys.save_uselds(self.lds.get_active())
GrampsKeys.save_startup(const.startup)
self.w.destroy()
GrampsKeys.sync()
self.task(self.args)
def build_page2(self):
@ -143,7 +144,7 @@ class StartupDialog:
box.add(table)
box.show_all()
name = GrampsGconfKeys.get_researcher_name()
name = GrampsKeys.get_researcher_name()
if not name or name.strip() == "":
import pwd
import os
@ -154,13 +155,13 @@ class StartupDialog:
name = ""
self.name.set_text(name)
self.addr.set_text(GrampsGconfKeys.get_researcher_addr())
self.city.set_text(GrampsGconfKeys.get_researcher_city())
self.state.set_text(GrampsGconfKeys.get_researcher_state())
self.postal.set_text(GrampsGconfKeys.get_researcher_postal())
self.country.set_text(GrampsGconfKeys.get_researcher_country())
self.phone.set_text(GrampsGconfKeys.get_researcher_phone())
self.email.set_text(GrampsGconfKeys.get_researcher_email())
self.addr.set_text(GrampsKeys.get_researcher_addr())
self.city.set_text(GrampsKeys.get_researcher_city())
self.state.set_text(GrampsKeys.get_researcher_state())
self.postal.set_text(GrampsKeys.get_researcher_postal())
self.country.set_text(GrampsKeys.get_researcher_country())
self.phone.set_text(GrampsKeys.get_researcher_phone())
self.email.set_text(GrampsKeys.get_researcher_email())
return p
@ -188,7 +189,7 @@ class StartupDialog:
self.lds = gtk.CheckButton(label=_("Enable LDS ordinance support"))
self.lds.set_active(GrampsGconfKeys.get_uselds())
self.lds.set_active(GrampsKeys.get_uselds())
align.add(self.lds)

View File

@ -42,7 +42,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import GrampsGconfKeys
import GrampsKeys
#-------------------------------------------------------------------------
#
@ -58,7 +58,7 @@ class TipOfDay:
tp = TipParser()
tip_list = tp.get()
use.set_active(GrampsGconfKeys.get_usetips())
use.set_active(GrampsKeys.get_usetips())
new_index = range(len(tip_list))
Random().shuffle(new_index)
@ -74,7 +74,7 @@ class TipOfDay:
else:
index += 1
GrampsGconfKeys.save_usetips(use.get_active())
GrampsKeys.save_usetips(use.get_active())
top.destroy()
#-------------------------------------------------------------------------

View File

@ -224,9 +224,9 @@ def view_photo(photo):
os.execvp(args[0],args)
def nautilus_icon(icon,mime_type):
import GrampsGconfKeys
import GrampsKeys
theme = GrampsGconfKeys.client.get_string("/desktop/gnome/file_views/icon_theme")
theme = GrampsKeys.client.get_string("/desktop/gnome/file_views/icon_theme")
if icon :
newicon = "%s/%s/%s.png" % (const.nautdir,theme,icon)

View File

@ -60,6 +60,14 @@ nautdir = "/usr/share/pixmaps/nautilus"
prefixdir = "@GPREFIX@"
#-------------------------------------------------------------------------
#
# Configuration database options - True means drop down to .INI files
#
#-------------------------------------------------------------------------
no_gconf = False
#-------------------------------------------------------------------------
#
# Paths to files - assumes that files reside in the same directory as

View File

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

View File

@ -50,7 +50,7 @@ import RelLib
import HtmlDoc
import BaseDoc
import const
import GrampsGconfKeys
import GrampsKeys
import GenericFilter
import DateHandler
import Sort
@ -1327,7 +1327,7 @@ class WebReportDialog(Report.ReportDialog):
"""Get the name of the directory to which the target dialog
box should default. This value can be set in the preferences
panel."""
return GrampsGconfKeys.get_web_dir()
return GrampsKeys.get_web_dir()
def set_default_directory(self, value):
"""Save the name of the current directory, so that any future
@ -1337,7 +1337,7 @@ class WebReportDialog(Report.ReportDialog):
This means that the last directory used will only be
remembered for this session of gramps unless the user saves
his/her preferences."""
GrampsGconfKeys.save_web_dir(value)
GrampsKeys.save_web_dir(value)
def make_default_style(self):
"""Make the default output style for the Web Pages Report."""