2001-05-13 07:26:57 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
|
|
|
# Copyright (C) 2000 Donald N. Allingham
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Standard python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import string
|
|
|
|
import os
|
|
|
|
|
2001-05-30 09:54:27 +05:30
|
|
|
import PaperMenu
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GTK/Gnome modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2001-11-02 23:16:33 +05:30
|
|
|
import gtk
|
2001-05-13 07:26:57 +05:30
|
|
|
import libglade
|
2001-11-02 23:16:33 +05:30
|
|
|
from gnome.config import get_string, get_bool, get_int, set_string, sync, set_bool, set_int
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# gramps modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
from RelLib import *
|
2001-06-18 00:26:22 +05:30
|
|
|
from Date import *
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
import const
|
|
|
|
import utils
|
|
|
|
import ListColors
|
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
from intl import gettext
|
|
|
|
_ = gettext
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
_date_format_list = [
|
2001-07-01 19:50:51 +05:30
|
|
|
_("Month Day, Year"),
|
|
|
|
_("MON Day, Year"),
|
|
|
|
_("Day MON Year"),
|
|
|
|
_("MM/DD/YYYY"),
|
|
|
|
_("MM-DD-YYYY"),
|
|
|
|
_("DD/MM/YYYY"),
|
|
|
|
_("DD-MM-YYYY"),
|
|
|
|
_("MM.DD.YYYY"),
|
|
|
|
_("DD.MM.YYYY"),
|
2001-07-13 05:31:04 +05:30
|
|
|
_("DD. Month Year"),
|
|
|
|
_("YYYY/MM/DD"),
|
|
|
|
_("YYYY-MM-DD"),
|
|
|
|
_("YYYY.MM.DD"),
|
2001-05-13 07:26:57 +05:30
|
|
|
]
|
|
|
|
|
|
|
|
_date_entry_list = [
|
2001-07-01 19:50:51 +05:30
|
|
|
_("MM/DD/YYYY, MM.DD.YYYY, or MM-DD-YYYY"),
|
2001-07-13 05:31:04 +05:30
|
|
|
_("DD/MM/YYYY, DD.MM.YYYY, or DD-MM-YYYY"),
|
|
|
|
_("YYYY/MM/DD, YYYY.MM.DD, or YYYY-MM-DD"),
|
2001-05-13 07:26:57 +05:30
|
|
|
]
|
|
|
|
|
|
|
|
_name_format_list = [
|
|
|
|
(_("Firstname Surname"), utils.normal_name),
|
|
|
|
(_("Surname, Firstname"), utils.phonebook_name),
|
|
|
|
]
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Visible globals
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2001-08-31 09:10:23 +05:30
|
|
|
owner = Researcher()
|
2001-08-10 10:02:31 +05:30
|
|
|
prefsTop = None
|
2001-10-20 20:33:23 +05:30
|
|
|
iprefix = "I"
|
|
|
|
oprefix = "O"
|
|
|
|
sprefix = "S"
|
|
|
|
pprefix = "P"
|
|
|
|
fprefix = "F"
|
2001-05-13 07:26:57 +05:30
|
|
|
autoload = 0
|
|
|
|
usetabs = 0
|
2001-10-04 09:52:41 +05:30
|
|
|
usevc = 0
|
2001-10-04 19:36:21 +05:30
|
|
|
vc_comment = 0
|
2001-07-30 04:57:42 +05:30
|
|
|
uncompress = 0
|
2001-06-10 06:56:09 +05:30
|
|
|
show_detail = 0
|
2001-05-13 07:26:57 +05:30
|
|
|
hide_altnames = 0
|
|
|
|
lastfile = None
|
|
|
|
nameof = utils.normal_name
|
2001-05-25 08:07:40 +05:30
|
|
|
display_attr = 0
|
|
|
|
attr_name = ""
|
2001-05-30 09:54:27 +05:30
|
|
|
status_bar = 0
|
2001-11-21 06:46:32 +05:30
|
|
|
calendar = 0
|
2001-05-30 09:54:27 +05:30
|
|
|
paper_preference = None
|
|
|
|
output_preference = None
|
2001-07-01 19:50:51 +05:30
|
|
|
report_dir = "./"
|
2001-07-02 03:01:52 +05:30
|
|
|
web_dir = "./"
|
2001-07-01 19:50:51 +05:30
|
|
|
db_dir = "./"
|
2001-07-13 05:31:04 +05:30
|
|
|
id_visible = 0
|
2001-09-22 04:05:23 +05:30
|
|
|
id_edit = 0
|
2001-10-30 09:28:40 +05:30
|
|
|
index_visible = 0
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Globals
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
_name_format = 0
|
|
|
|
_callback = None
|
|
|
|
_druid = None
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Constants
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
ODDFGCOLOR = "oddForeground"
|
|
|
|
ODDBGCOLOR = "oddBackground"
|
|
|
|
EVENFGCOLOR = "evenForeground"
|
|
|
|
EVENBGCOLOR = "evenBackground"
|
2001-11-02 10:43:06 +05:30
|
|
|
ANCESTORFGCOLOR = "ancestorForeground"
|
2001-08-22 04:12:33 +05:30
|
|
|
INDEX = "i"
|
|
|
|
OBJECT = "o"
|
|
|
|
DATA = "d"
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# make_path -
|
|
|
|
# Creates a directory if it does not already exist. Assumes that the
|
|
|
|
# parent directory already exits
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def make_path(path):
|
|
|
|
if not os.path.isdir(path):
|
|
|
|
os.mkdir(path)
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def loadConfig(call):
|
|
|
|
global autoload
|
|
|
|
global owner
|
|
|
|
global usetabs
|
2001-11-21 06:46:32 +05:30
|
|
|
global calendar
|
2001-10-04 09:52:41 +05:30
|
|
|
global usevc
|
2001-10-20 20:33:23 +05:30
|
|
|
global iprefix
|
|
|
|
global fprefix
|
|
|
|
global pprefix
|
|
|
|
global oprefix
|
|
|
|
global sprefix
|
2001-10-04 19:36:21 +05:30
|
|
|
global vc_comment
|
2001-07-30 04:57:42 +05:30
|
|
|
global uncompress
|
2001-07-13 05:31:04 +05:30
|
|
|
global id_visible
|
2001-09-22 04:05:23 +05:30
|
|
|
global id_edit
|
2001-10-30 09:28:40 +05:30
|
|
|
global index_visible
|
2001-06-10 06:56:09 +05:30
|
|
|
global show_detail
|
2001-05-13 07:26:57 +05:30
|
|
|
global hide_altnames
|
|
|
|
global lastfile
|
|
|
|
global nameof
|
2001-05-25 08:07:40 +05:30
|
|
|
global display_attr
|
|
|
|
global attr_name
|
2001-05-13 07:26:57 +05:30
|
|
|
global _druid
|
|
|
|
global _name_format
|
|
|
|
global _callback
|
2001-05-30 09:54:27 +05:30
|
|
|
global paper_preference
|
|
|
|
global output_preference
|
2001-06-28 20:50:41 +05:30
|
|
|
global report_dir
|
2001-07-02 03:01:52 +05:30
|
|
|
global web_dir
|
2001-06-28 20:50:41 +05:30
|
|
|
global db_dir
|
2001-05-30 09:54:27 +05:30
|
|
|
global status_bar
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
_callback = call
|
2001-11-02 23:16:33 +05:30
|
|
|
lastfile = get_string("/gramps/data/LastFile")
|
|
|
|
usetabs = get_bool("/gramps/config/UseTabs")
|
2001-11-21 06:46:32 +05:30
|
|
|
calendar = get_bool("/gramps/config/ShowCalendar")
|
2001-11-02 23:16:33 +05:30
|
|
|
usevc = get_bool("/gramps/config/UseVersionControl")
|
|
|
|
vc_comment = get_bool("/gramps/config/UseComment")
|
|
|
|
uncompress = get_bool("/gramps/config/DontCompressXML")
|
|
|
|
id_visible = get_bool("/gramps/config/IdVisible")
|
|
|
|
id_edit = get_bool("/gramps/config/IdEdit")
|
|
|
|
index_visible = get_bool("/gramps/config/IndexVisible")
|
|
|
|
show_detail = get_bool("/gramps/config/ShowDetail")
|
|
|
|
status_bar = get_int("/gramps/config/StatusBar")
|
|
|
|
display_attr = get_bool("/gramps/config/DisplayAttr")
|
|
|
|
attr_name = get_string("/gramps/config/DisplayAttrName")
|
2001-05-25 08:07:40 +05:30
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
hide_altnames = get_bool("/gramps/config/DisplayAltNames")
|
|
|
|
autoload = get_bool("/gramps/config/autoLoad")
|
|
|
|
dateFormat = get_int("/gramps/config/dateFormat")
|
|
|
|
dateEntry = get_int("/gramps/config/dateEntry")
|
|
|
|
paper_preference = get_string("/gramps/config/paperPreference")
|
|
|
|
output_preference = get_string("/gramps/config/outputPreference")
|
|
|
|
_name_format = get_int("/gramps/config/nameFormat")
|
|
|
|
|
|
|
|
iprefix = get_string("/gramps/config/iprefix")
|
|
|
|
fprefix = get_string("/gramps/config/fprefix")
|
|
|
|
sprefix = get_string("/gramps/config/sprefix")
|
|
|
|
oprefix = get_string("/gramps/config/oprefix")
|
|
|
|
pprefix = get_string("/gramps/config/pprefix")
|
|
|
|
|
|
|
|
report_dir = get_string("/gramps/config/ReportDirectory")
|
|
|
|
web_dir = get_string("/gramps/config/WebsiteDirectory")
|
|
|
|
db_dir = get_string("/gramps/config/DbDirectory")
|
2001-06-28 20:50:41 +05:30
|
|
|
|
|
|
|
if report_dir == None:
|
2001-07-01 04:31:38 +05:30
|
|
|
report_dir = "./"
|
2001-06-30 07:22:47 +05:30
|
|
|
else:
|
2001-07-01 04:31:38 +05:30
|
|
|
report_dir = os.path.normpath(report_dir) + os.sep
|
2001-07-02 03:01:52 +05:30
|
|
|
|
|
|
|
if web_dir == None:
|
|
|
|
web_dir = "./"
|
|
|
|
else:
|
|
|
|
web_dir = os.path.normpath(web_dir) + os.sep
|
2001-06-30 07:22:47 +05:30
|
|
|
|
2001-06-28 20:50:41 +05:30
|
|
|
if db_dir == None:
|
2001-07-01 04:31:38 +05:30
|
|
|
db_dir = "./"
|
2001-06-30 07:22:47 +05:30
|
|
|
else:
|
2001-07-01 04:31:38 +05:30
|
|
|
db_dir = os.path.normpath(db_dir) + os.sep
|
2001-06-28 20:50:41 +05:30
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
name = get_string("/gramps/researcher/name")
|
|
|
|
addr = get_string("/gramps/researcher/addr")
|
|
|
|
city = get_string("/gramps/researcher/city")
|
|
|
|
state = get_string("/gramps/researcher/state")
|
|
|
|
country = get_string("/gramps/researcher/country")
|
|
|
|
postal = get_string("/gramps/researcher/postal")
|
|
|
|
phone = get_string("/gramps/researcher/phone")
|
|
|
|
email = get_string("/gramps/researcher/email")
|
2001-05-13 07:26:57 +05:30
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
en = get_bool("/gramps/color/enableColors")
|
2001-06-17 19:10:13 +05:30
|
|
|
if en == None:
|
|
|
|
en = 0
|
|
|
|
|
|
|
|
ListColors.set_enable(en)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
ListColors.oddfg = get_config_color(ODDFGCOLOR,(0,0,0))
|
|
|
|
ListColors.oddbg = get_config_color(ODDBGCOLOR,(0xffff,0xffff,0xffff))
|
|
|
|
ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0))
|
|
|
|
ListColors.evenbg = get_config_color(EVENBGCOLOR,(0xffff,0xffff,0xffff))
|
2001-11-02 10:43:06 +05:30
|
|
|
ListColors.ancestorfg = get_config_color(ANCESTORFGCOLOR,(0,0,0))
|
2001-05-13 07:26:57 +05:30
|
|
|
|
2001-05-30 09:54:27 +05:30
|
|
|
if paper_preference == None:
|
|
|
|
paper_preference = "Letter"
|
|
|
|
|
|
|
|
if output_preference == None:
|
|
|
|
output_preference = "OpenOffice"
|
|
|
|
|
2001-10-20 20:33:23 +05:30
|
|
|
if iprefix == None:
|
|
|
|
iprefix = "I"
|
|
|
|
if fprefix == None:
|
|
|
|
fprefix = "F"
|
|
|
|
if sprefix == None:
|
|
|
|
sprefix = "S"
|
|
|
|
if pprefix == None:
|
|
|
|
pprefix = "P"
|
|
|
|
if oprefix == None:
|
|
|
|
oprefix = "O"
|
|
|
|
|
2001-05-25 08:07:40 +05:30
|
|
|
if display_attr == None:
|
|
|
|
display_attr = 0
|
|
|
|
|
|
|
|
if attr_name == None:
|
|
|
|
attr_name = ""
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
if autoload == None:
|
|
|
|
autoload = 1
|
|
|
|
if usetabs == None:
|
|
|
|
usetabs = 0
|
2001-11-21 06:46:32 +05:30
|
|
|
if calendar == None:
|
|
|
|
calendar = 0
|
2001-10-04 09:52:41 +05:30
|
|
|
if usevc == None:
|
|
|
|
usevc = 0
|
2001-10-04 19:36:21 +05:30
|
|
|
if vc_comment == None:
|
|
|
|
vc_comment = 0
|
2001-07-30 04:57:42 +05:30
|
|
|
if uncompress == None:
|
|
|
|
uncompress = 0
|
2001-07-13 05:31:04 +05:30
|
|
|
if id_visible == None:
|
|
|
|
id_visible = 0
|
2001-09-22 04:05:23 +05:30
|
|
|
if id_edit == None:
|
|
|
|
id_edit = 0
|
2001-10-30 09:28:40 +05:30
|
|
|
if index_visible == None:
|
|
|
|
index_visible = 0
|
2001-06-10 06:56:09 +05:30
|
|
|
if show_detail == None:
|
|
|
|
show_detail = 0
|
2001-05-30 09:54:27 +05:30
|
|
|
if status_bar == None:
|
|
|
|
status_bar = 0
|
2001-05-13 07:26:57 +05:30
|
|
|
if hide_altnames == None:
|
|
|
|
hide_altnames = 0
|
|
|
|
if dateFormat == None:
|
|
|
|
dateFormat = 0
|
|
|
|
if dateEntry == None:
|
|
|
|
dateEntry = 0
|
|
|
|
|
2001-06-17 19:10:13 +05:30
|
|
|
set_format_code(dateFormat)
|
2001-05-13 07:26:57 +05:30
|
|
|
Date.entryCode = dateEntry
|
|
|
|
|
|
|
|
if _name_format == None or _name_format == 0:
|
|
|
|
_name_format = 0
|
|
|
|
nameof = utils.normal_name
|
|
|
|
else:
|
|
|
|
nameof = utils.phonebook_name
|
|
|
|
|
|
|
|
if name == None:
|
|
|
|
_druid = libglade.GladeXML(const.configFile,"initDruid")
|
|
|
|
_druid.signal_autoconnect({
|
|
|
|
"destroy_passed_object" : druid_cancel_clicked,
|
|
|
|
"on_initDruid_finish" : on_initDruid_finish
|
|
|
|
})
|
|
|
|
else:
|
|
|
|
owner.set(name,addr,city,state,country,postal,phone,email)
|
|
|
|
|
|
|
|
make_path(os.path.expanduser("~/.gramps"))
|
|
|
|
make_path(os.path.expanduser("~/.gramps/filters"))
|
|
|
|
make_path(os.path.expanduser("~/.gramps/plugins"))
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def save_last_file(file):
|
2001-11-02 23:16:33 +05:30
|
|
|
set_string("/gramps/data/LastFile",file)
|
|
|
|
sync()
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_initDruid_finish(obj,b):
|
|
|
|
global owner
|
|
|
|
|
|
|
|
name = _druid.get_widget("dresname").get_text()
|
|
|
|
addr = _druid.get_widget("dresaddr").get_text()
|
|
|
|
city = _druid.get_widget("drescity").get_text()
|
|
|
|
state = _druid.get_widget("dresstate").get_text()
|
|
|
|
country = _druid.get_widget("drescountry").get_text()
|
|
|
|
postal = _druid.get_widget("drespostal").get_text()
|
|
|
|
phone = _druid.get_widget("dresphone").get_text()
|
|
|
|
email = _druid.get_widget("dresemail").get_text()
|
|
|
|
|
|
|
|
owner.set(name,addr,city,state,country,postal,phone,email)
|
|
|
|
store_researcher(owner)
|
|
|
|
utils.destroy_passed_object(obj)
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def store_researcher(res):
|
2001-11-02 23:16:33 +05:30
|
|
|
set_string("/gramps/researcher/name",res.name)
|
|
|
|
set_string("/gramps/researcher/addr",res.addr)
|
|
|
|
set_string("/gramps/researcher/city",res.city)
|
|
|
|
set_string("/gramps/researcher/state",res.state)
|
|
|
|
set_string("/gramps/researcher/country",res.country)
|
|
|
|
set_string("/gramps/researcher/postal",res.postal)
|
|
|
|
set_string("/gramps/researcher/phone",res.phone)
|
|
|
|
set_string("/gramps/researcher/email",res.email)
|
|
|
|
sync()
|
2001-08-22 09:14:17 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_propertybox_help(obj,page):
|
|
|
|
import gnome.help
|
|
|
|
|
2001-09-10 06:24:30 +05:30
|
|
|
gnome.help.display('gramps-manual','prefs.html')
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Apply values set in the property box. For simplicity, only apply the
|
|
|
|
# values when the page is -1 (the box has been closed).
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_propertybox_apply(obj,page):
|
|
|
|
global nameof
|
|
|
|
global owner
|
|
|
|
global usetabs
|
2001-11-21 06:46:32 +05:30
|
|
|
global calendar
|
2001-10-04 09:52:41 +05:30
|
|
|
global usevc
|
2001-10-20 20:33:23 +05:30
|
|
|
global iprefix
|
|
|
|
global fprefix
|
|
|
|
global pprefix
|
|
|
|
global sprefix
|
|
|
|
global oprefix
|
2001-10-04 19:36:21 +05:30
|
|
|
global vc_comment
|
2001-07-30 04:57:42 +05:30
|
|
|
global uncompress
|
2001-07-13 05:31:04 +05:30
|
|
|
global id_visible
|
2001-09-22 04:05:23 +05:30
|
|
|
global id_edit
|
2001-10-30 09:28:40 +05:30
|
|
|
global index_visible
|
2001-05-30 09:54:27 +05:30
|
|
|
global status_bar
|
2001-05-25 08:07:40 +05:30
|
|
|
global display_attr
|
|
|
|
global attr_name
|
2001-05-13 07:26:57 +05:30
|
|
|
global hide_altnames
|
2001-05-31 19:08:24 +05:30
|
|
|
global paper_preference
|
|
|
|
global output_preference
|
2001-06-10 06:56:09 +05:30
|
|
|
global show_detail
|
2001-06-28 20:50:41 +05:30
|
|
|
global report_dir
|
2001-07-02 03:01:52 +05:30
|
|
|
global web_dir
|
2001-06-28 20:50:41 +05:30
|
|
|
global db_dir
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
if page != -1:
|
|
|
|
return
|
|
|
|
|
2001-06-10 06:56:09 +05:30
|
|
|
show_detail = prefsTop.get_widget("showdetail").get_active()
|
2001-05-13 07:26:57 +05:30
|
|
|
autoload = prefsTop.get_widget("autoload").get_active()
|
2001-05-25 08:07:40 +05:30
|
|
|
display_attr = prefsTop.get_widget("attr_display").get_active()
|
|
|
|
attr_name = string.strip(prefsTop.get_widget("attr_name").get_text())
|
2001-05-13 07:26:57 +05:30
|
|
|
usetabs = prefsTop.get_widget("usetabs").get_active()
|
2001-11-21 06:46:32 +05:30
|
|
|
calendar = prefsTop.get_widget("calendar").get_active()
|
2001-10-04 09:52:41 +05:30
|
|
|
usevc = prefsTop.get_widget("use_vc").get_active()
|
2001-10-04 19:36:21 +05:30
|
|
|
vc_comment = prefsTop.get_widget("vc_comment").get_active()
|
2001-07-30 04:57:42 +05:30
|
|
|
uncompress = prefsTop.get_widget("uncompress").get_active()
|
2001-07-13 05:31:04 +05:30
|
|
|
id_visible = prefsTop.get_widget("gid_visible").get_active()
|
2001-09-22 04:05:23 +05:30
|
|
|
id_edit = prefsTop.get_widget("gid_edit").get_active()
|
2001-10-30 09:28:40 +05:30
|
|
|
index_visible = prefsTop.get_widget("show_child_id").get_active()
|
2001-05-13 07:26:57 +05:30
|
|
|
hide_altnames = prefsTop.get_widget("display_altnames").get_active()
|
2001-05-30 09:54:27 +05:30
|
|
|
paper_obj = prefsTop.get_widget("paper_size").get_menu().get_active()
|
|
|
|
output_obj = prefsTop.get_widget("output_format").get_menu().get_active()
|
|
|
|
|
|
|
|
if prefsTop.get_widget("stat1").get_active():
|
|
|
|
status_bar = 0
|
|
|
|
elif prefsTop.get_widget("stat2").get_active():
|
|
|
|
status_bar = 1
|
|
|
|
else:
|
|
|
|
status_bar = 2
|
2001-06-28 20:50:41 +05:30
|
|
|
|
2001-10-20 20:33:23 +05:30
|
|
|
iprefix = prefsTop.get_widget("iprefix").get_text()
|
|
|
|
if iprefix == "":
|
|
|
|
iprefix = "I"
|
|
|
|
sprefix = prefsTop.get_widget("sprefix").get_text()
|
|
|
|
if sprefix == "":
|
|
|
|
sprefix = "S"
|
|
|
|
oprefix = prefsTop.get_widget("oprefix").get_text()
|
|
|
|
if oprefix == "":
|
|
|
|
oprefix = "O"
|
|
|
|
fprefix = prefsTop.get_widget("fprefix").get_text()
|
|
|
|
if fprefix == "":
|
|
|
|
fprefix = "F"
|
|
|
|
pprefix = prefsTop.get_widget("pprefix").get_text()
|
|
|
|
if pprefix == "":
|
|
|
|
pprefix = "P"
|
|
|
|
|
2001-06-28 20:50:41 +05:30
|
|
|
dbdir_temp = prefsTop.get_widget("dbdir").get_full_path(1)
|
2001-07-08 20:08:53 +05:30
|
|
|
if dbdir_temp != None and os.path.isdir(dbdir_temp):
|
2001-07-01 04:31:38 +05:30
|
|
|
db_dir = os.path.normpath(dbdir_temp) + os.sep
|
2001-06-28 20:50:41 +05:30
|
|
|
|
|
|
|
repdir_temp = prefsTop.get_widget("repdir").get_full_path(1)
|
2001-07-08 20:08:53 +05:30
|
|
|
if repdir_temp != None and os.path.isdir(repdir_temp):
|
2001-07-01 04:31:38 +05:30
|
|
|
report_dir = os.path.normpath(repdir_temp) + os.sep
|
2001-07-02 03:01:52 +05:30
|
|
|
|
|
|
|
webdir_temp = prefsTop.get_widget("htmldir").get_full_path(1)
|
2001-07-08 20:08:53 +05:30
|
|
|
if webdir_temp != None and os.path.isdir(webdir_temp):
|
2001-07-02 03:01:52 +05:30
|
|
|
web_dir = os.path.normpath(webdir_temp) + os.sep
|
|
|
|
|
2001-08-22 04:12:33 +05:30
|
|
|
paper_preference = paper_obj.get_data(DATA)
|
|
|
|
output_preference = output_obj.get_data(DATA)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
set_bool("/gramps/config/UseTabs",usetabs)
|
2001-11-21 06:46:32 +05:30
|
|
|
set_bool("/gramps/config/ShowCalendar",calendar)
|
2001-11-02 23:16:33 +05:30
|
|
|
set_bool("/gramps/config/UseVersionControl",usevc)
|
|
|
|
set_bool("/gramps/config/UseComment",vc_comment)
|
|
|
|
set_bool("/gramps/config/DontCompressXML",uncompress)
|
|
|
|
set_bool("/gramps/config/IdVisible",id_visible)
|
|
|
|
set_bool("/gramps/config/IdEdit",id_edit)
|
|
|
|
set_bool("/gramps/config/IndexVisible",index_visible)
|
|
|
|
set_bool("/gramps/config/ShowDetail",show_detail)
|
|
|
|
set_int("/gramps/config/StatusBar",status_bar)
|
|
|
|
set_bool("/gramps/config/DisplayAttr",display_attr)
|
|
|
|
set_string("/gramps/config/DisplayAttrName",attr_name)
|
|
|
|
set_string("/gramps/config/paperPreference",paper_preference)
|
|
|
|
set_string("/gramps/config/outputPreference",output_preference)
|
|
|
|
set_bool("/gramps/config/autoLoad",autoload)
|
|
|
|
set_bool("/gramps/config/DisplayAltNames",hide_altnames)
|
|
|
|
set_string("/gramps/config/ReportDirectory",report_dir)
|
|
|
|
set_string("/gramps/config/WebsiteDirectory",web_dir)
|
|
|
|
set_string("/gramps/config/DbDirectory",db_dir)
|
|
|
|
set_string("/gramps/config/iprefix",iprefix)
|
|
|
|
set_string("/gramps/config/fprefix",fprefix)
|
|
|
|
set_string("/gramps/config/pprefix",pprefix)
|
|
|
|
set_string("/gramps/config/oprefix",oprefix)
|
|
|
|
set_string("/gramps/config/sprefix",sprefix)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
# search for the active date format selection
|
|
|
|
|
|
|
|
format_menu = prefsTop.get_widget("date_format").get_menu()
|
2001-08-22 04:12:33 +05:30
|
|
|
active = format_menu.get_active().get_data(INDEX)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
2001-06-17 19:10:13 +05:30
|
|
|
set_format_code(active)
|
2001-11-02 23:16:33 +05:30
|
|
|
set_int("/gramps/config/dateFormat",active)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
format_menu = prefsTop.get_widget("date_entry_format").get_menu()
|
2001-08-22 04:12:33 +05:30
|
|
|
entry_active = format_menu.get_active().get_data(INDEX)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
Date.entryCode = entry_active
|
2001-11-02 23:16:33 +05:30
|
|
|
set_int("/gramps/config/dateEntry",entry_active)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
# get the name format
|
|
|
|
|
|
|
|
format_menu = prefsTop.get_widget("name_format").get_menu()
|
2001-08-22 04:12:33 +05:30
|
|
|
active_name = format_menu.get_active().get_data(INDEX)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
name_tuple = _name_format_list[active_name]
|
|
|
|
nameof = name_tuple[1]
|
2001-11-02 23:16:33 +05:30
|
|
|
set_int("/gramps/config/nameFormat",active_name)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
name = prefsTop.get_widget("resname").get_text()
|
|
|
|
addr = prefsTop.get_widget("resaddr").get_text()
|
|
|
|
city = prefsTop.get_widget("rescity").get_text()
|
|
|
|
state = prefsTop.get_widget("resstate").get_text()
|
|
|
|
country = prefsTop.get_widget("rescountry").get_text()
|
|
|
|
postal = prefsTop.get_widget("respostal").get_text()
|
|
|
|
phone = prefsTop.get_widget("resphone").get_text()
|
|
|
|
email = prefsTop.get_widget("resemail").get_text()
|
|
|
|
|
2001-06-17 19:10:13 +05:30
|
|
|
ListColors.set_enable(prefsTop.get_widget("enableColors").get_active())
|
2001-11-02 23:16:33 +05:30
|
|
|
set_bool("/gramps/color/enableColors",ListColors.get_enable())
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
ListColors.oddfg = prefsTop.get_widget(ODDFGCOLOR).get_i16()
|
|
|
|
ListColors.oddbg = prefsTop.get_widget(ODDBGCOLOR).get_i16()
|
|
|
|
ListColors.evenfg = prefsTop.get_widget(EVENFGCOLOR).get_i16()
|
|
|
|
ListColors.evenbg = prefsTop.get_widget(EVENBGCOLOR).get_i16()
|
2001-11-02 10:43:06 +05:30
|
|
|
ListColors.ancestorfg = prefsTop.get_widget(ANCESTORFGCOLOR).get_i16()
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
save_config_color(ODDFGCOLOR,ListColors.oddfg)
|
|
|
|
save_config_color(ODDBGCOLOR,ListColors.oddbg)
|
|
|
|
save_config_color(EVENFGCOLOR,ListColors.evenfg)
|
|
|
|
save_config_color(EVENBGCOLOR,ListColors.evenbg)
|
2001-11-02 10:43:06 +05:30
|
|
|
save_config_color(ANCESTORFGCOLOR,ListColors.ancestorfg)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
owner.set(name,addr,city,state,country,postal,phone,email)
|
|
|
|
store_researcher(owner)
|
|
|
|
|
2001-10-20 20:33:23 +05:30
|
|
|
db = obj.get_data("db")
|
|
|
|
db.set_iprefix(iprefix)
|
|
|
|
db.set_fprefix(fprefix)
|
|
|
|
db.set_sprefix(sprefix)
|
|
|
|
db.set_oprefix(oprefix)
|
|
|
|
db.set_pprefix(pprefix)
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
# update the config file
|
|
|
|
|
2001-11-02 23:16:33 +05:30
|
|
|
sync()
|
2001-05-13 07:26:57 +05:30
|
|
|
_callback()
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def save_config_color(name,color):
|
2001-11-02 23:16:33 +05:30
|
|
|
set_int("/gramps/color/" + name + ".r",color[0])
|
|
|
|
set_int("/gramps/color/" + name + ".g",color[1])
|
|
|
|
set_int("/gramps/color/" + name + ".b",color[2])
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Called by the elements on the property box to set the changed flag,
|
|
|
|
# so that the property box knows to set the Apply button
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_object_toggled(obj):
|
|
|
|
obj.changed()
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Called by the elements on the property box to set the changed flag,
|
|
|
|
# so that the property box knows to set the Apply button
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_format_toggled(obj):
|
2001-08-22 04:12:33 +05:30
|
|
|
obj.get_data(OBJECT).changed()
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Called by the elements on the property box to set the changed flag,
|
|
|
|
# so that the property box knows to set the Apply button
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_color_toggled(obj):
|
|
|
|
active = prefsTop.get_widget("enableColors").get_active()
|
|
|
|
prefsTop.get_widget(ODDFGCOLOR).set_sensitive(active)
|
|
|
|
prefsTop.get_widget(ODDBGCOLOR).set_sensitive(active)
|
|
|
|
prefsTop.get_widget(EVENFGCOLOR).set_sensitive(active)
|
|
|
|
prefsTop.get_widget(EVENBGCOLOR).set_sensitive(active)
|
2001-11-02 10:43:06 +05:30
|
|
|
prefsTop.get_widget(ANCESTORFGCOLOR).set_sensitive(active)
|
2001-05-13 07:26:57 +05:30
|
|
|
obj.changed()
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Called by the elements on the property box to set the changed flag,
|
|
|
|
# so that the property box knows to set the Apply button
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def on_color_set(obj,r,g,b,a):
|
|
|
|
obj.changed()
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Create the property box, and set the elements off the current values
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2001-10-20 20:33:23 +05:30
|
|
|
def display_preferences_box(db):
|
2001-05-13 07:26:57 +05:30
|
|
|
global prefsTop
|
|
|
|
|
|
|
|
prefsTop = libglade.GladeXML(const.configFile,"propertybox")
|
|
|
|
prefsTop.signal_autoconnect({
|
|
|
|
"destroy_passed_object" : utils.destroy_passed_object,
|
|
|
|
"on_propertybox_apply" : on_propertybox_apply,
|
2001-08-22 09:14:17 +05:30
|
|
|
"on_propertybox_help" : on_propertybox_help,
|
2001-05-13 07:26:57 +05:30
|
|
|
"on_color_toggled" : on_color_toggled,
|
|
|
|
"on_color_set" : on_color_set,
|
|
|
|
"on_object_toggled" : on_object_toggled
|
|
|
|
})
|
|
|
|
|
|
|
|
pbox = prefsTop.get_widget("propertybox")
|
2001-10-20 20:33:23 +05:30
|
|
|
pbox.set_data("db",db)
|
2001-05-13 07:26:57 +05:30
|
|
|
auto = prefsTop.get_widget("autoload")
|
2001-07-13 05:31:04 +05:30
|
|
|
vis = prefsTop.get_widget("gid_visible")
|
2001-09-22 04:05:23 +05:30
|
|
|
idedit = prefsTop.get_widget("gid_edit")
|
2001-10-30 09:28:40 +05:30
|
|
|
index_vis = prefsTop.get_widget("show_child_id")
|
2001-05-13 07:26:57 +05:30
|
|
|
tabs = prefsTop.get_widget("usetabs")
|
2001-11-21 06:46:32 +05:30
|
|
|
cal = prefsTop.get_widget("calendar")
|
2001-10-04 09:52:41 +05:30
|
|
|
vc = prefsTop.get_widget("use_vc")
|
2001-10-04 19:36:21 +05:30
|
|
|
vcom = prefsTop.get_widget("vc_comment")
|
2001-07-30 04:57:42 +05:30
|
|
|
compress = prefsTop.get_widget("uncompress")
|
2001-06-10 06:56:09 +05:30
|
|
|
detail = prefsTop.get_widget("showdetail")
|
2001-05-25 08:07:40 +05:30
|
|
|
display_attr_obj = prefsTop.get_widget("attr_display")
|
2001-05-13 07:26:57 +05:30
|
|
|
display_altnames = prefsTop.get_widget("display_altnames")
|
|
|
|
auto.set_active(autoload)
|
2001-06-10 06:56:09 +05:30
|
|
|
detail.set_active(show_detail)
|
2001-05-13 07:26:57 +05:30
|
|
|
tabs.set_active(usetabs)
|
2001-11-21 06:46:32 +05:30
|
|
|
cal.set_active(calendar)
|
2001-10-04 09:52:41 +05:30
|
|
|
vc.set_active(usevc)
|
2001-10-04 19:36:21 +05:30
|
|
|
vcom.set_active(vc_comment)
|
2001-07-30 04:57:42 +05:30
|
|
|
compress.set_active(uncompress)
|
2001-07-13 05:31:04 +05:30
|
|
|
vis.set_active(id_visible)
|
2001-09-22 04:05:23 +05:30
|
|
|
idedit.set_active(id_edit)
|
2001-10-30 09:28:40 +05:30
|
|
|
index_vis.set_active(index_visible)
|
2001-05-25 08:07:40 +05:30
|
|
|
|
2001-10-20 20:33:23 +05:30
|
|
|
prefsTop.get_widget("iprefix").set_text(iprefix)
|
|
|
|
prefsTop.get_widget("oprefix").set_text(oprefix)
|
|
|
|
prefsTop.get_widget("fprefix").set_text(fprefix)
|
|
|
|
prefsTop.get_widget("sprefix").set_text(sprefix)
|
|
|
|
prefsTop.get_widget("pprefix").set_text(pprefix)
|
|
|
|
|
2001-07-08 20:08:53 +05:30
|
|
|
if status_bar == 0:
|
|
|
|
prefsTop.get_widget("stat1").set_active(1)
|
|
|
|
elif status_bar == 1:
|
|
|
|
prefsTop.get_widget("stat2").set_active(1)
|
|
|
|
else:
|
|
|
|
prefsTop.get_widget("stat3").set_active(1)
|
|
|
|
|
2001-05-25 08:07:40 +05:30
|
|
|
display_attr_obj.set_active(display_attr)
|
|
|
|
prefsTop.get_widget("attr_name").set_text(attr_name)
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
display_altnames.set_active(hide_altnames)
|
|
|
|
|
2001-05-30 09:54:27 +05:30
|
|
|
paper_obj = prefsTop.get_widget("paper_size")
|
2001-11-02 23:16:33 +05:30
|
|
|
menu = gtk.GtkMenu()
|
2001-05-30 09:54:27 +05:30
|
|
|
choice = 0
|
|
|
|
for index in range(0,len(PaperMenu.paper_sizes)):
|
|
|
|
name = PaperMenu.paper_sizes[index].get_name()
|
|
|
|
if name == paper_preference:
|
|
|
|
choice = index
|
2001-11-02 23:16:33 +05:30
|
|
|
item = gtk.GtkMenuItem(name)
|
2001-08-22 04:12:33 +05:30
|
|
|
item.set_data(OBJECT,pbox)
|
|
|
|
item.set_data(DATA,name)
|
2001-05-30 09:54:27 +05:30
|
|
|
item.connect("activate", on_format_toggled)
|
|
|
|
item.show()
|
|
|
|
menu.append(item)
|
|
|
|
menu.set_active(choice)
|
|
|
|
paper_obj.set_menu(menu)
|
|
|
|
|
|
|
|
output_obj = prefsTop.get_widget("output_format")
|
2001-11-02 23:16:33 +05:30
|
|
|
menu = gtk.GtkMenu()
|
2001-05-30 09:54:27 +05:30
|
|
|
choice = 0
|
|
|
|
|
|
|
|
choice = 0
|
|
|
|
index = 0
|
|
|
|
for name in const.output_formats:
|
|
|
|
if name == output_preference:
|
|
|
|
choice = index
|
2001-11-02 23:16:33 +05:30
|
|
|
item = gtk.GtkMenuItem(name)
|
2001-08-22 04:12:33 +05:30
|
|
|
item.set_data(OBJECT,pbox)
|
|
|
|
item.set_data(DATA,name)
|
2001-05-30 09:54:27 +05:30
|
|
|
item.connect("activate", on_format_toggled)
|
|
|
|
item.show()
|
|
|
|
menu.append(item)
|
|
|
|
index = index + 1
|
|
|
|
menu.set_active(choice)
|
|
|
|
output_obj.set_menu(menu)
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
date_option = prefsTop.get_widget("date_format")
|
2001-11-02 23:16:33 +05:30
|
|
|
date_menu = gtk.GtkMenu()
|
2001-05-13 07:26:57 +05:30
|
|
|
for index in range(0,len(_date_format_list)):
|
2001-11-02 23:16:33 +05:30
|
|
|
item = gtk.GtkMenuItem(_date_format_list[index])
|
2001-08-22 04:12:33 +05:30
|
|
|
item.set_data(INDEX,index)
|
|
|
|
item.set_data(OBJECT,pbox)
|
2001-05-13 07:26:57 +05:30
|
|
|
item.connect("activate", on_format_toggled)
|
|
|
|
item.show()
|
|
|
|
date_menu.append(item)
|
2001-06-18 00:26:22 +05:30
|
|
|
date_menu.set_active(get_format_code())
|
2001-05-13 07:26:57 +05:30
|
|
|
date_option.set_menu(date_menu)
|
|
|
|
|
|
|
|
date_entry = prefsTop.get_widget("date_entry_format")
|
2001-11-02 23:16:33 +05:30
|
|
|
date_menu = gtk.GtkMenu()
|
2001-05-13 07:26:57 +05:30
|
|
|
for index in range(0,len(_date_entry_list)):
|
2001-11-02 23:16:33 +05:30
|
|
|
item = gtk.GtkMenuItem(_date_entry_list[index])
|
2001-08-22 04:12:33 +05:30
|
|
|
item.set_data(INDEX,index)
|
|
|
|
item.set_data(OBJECT,pbox)
|
2001-05-13 07:26:57 +05:30
|
|
|
item.connect("activate", on_format_toggled)
|
|
|
|
item.show()
|
|
|
|
date_menu.append(item)
|
|
|
|
date_menu.set_active(Date.entryCode)
|
|
|
|
date_entry.set_menu(date_menu)
|
|
|
|
|
|
|
|
name_option = prefsTop.get_widget("name_format")
|
2001-11-02 23:16:33 +05:30
|
|
|
name_menu = gtk.GtkMenu()
|
2001-05-13 07:26:57 +05:30
|
|
|
for index in range(0,len(_name_format_list)):
|
|
|
|
name_tuple = _name_format_list[index]
|
2001-11-02 23:16:33 +05:30
|
|
|
item = gtk.GtkMenuItem(name_tuple[0])
|
2001-08-22 04:12:33 +05:30
|
|
|
item.set_data(INDEX,index)
|
|
|
|
item.set_data(OBJECT,pbox)
|
2001-05-13 07:26:57 +05:30
|
|
|
item.connect("activate", on_format_toggled)
|
|
|
|
item.show()
|
|
|
|
name_menu.append(item)
|
|
|
|
name_menu.set_active(_name_format)
|
|
|
|
name_option.set_menu(name_menu)
|
|
|
|
|
|
|
|
prefsTop.get_widget("resname").set_text(owner.getName())
|
|
|
|
prefsTop.get_widget("resaddr").set_text(owner.getAddress())
|
|
|
|
prefsTop.get_widget("rescity").set_text(owner.getCity())
|
|
|
|
prefsTop.get_widget("resstate").set_text(owner.getState())
|
|
|
|
prefsTop.get_widget("rescountry").set_text(owner.getCountry())
|
|
|
|
prefsTop.get_widget("respostal").set_text(owner.getPostalCode())
|
|
|
|
prefsTop.get_widget("resphone").set_text(owner.getPhone())
|
|
|
|
prefsTop.get_widget("resemail").set_text(owner.getEmail())
|
|
|
|
|
|
|
|
cwidget = prefsTop.get_widget(ODDFGCOLOR)
|
|
|
|
cwidget.set_i16(ListColors.oddfg[0],ListColors.oddfg[1],\
|
|
|
|
ListColors.oddfg[2],0xffff)
|
|
|
|
|
|
|
|
cwidget = prefsTop.get_widget(ODDBGCOLOR)
|
|
|
|
cwidget.set_i16(ListColors.oddbg[0],ListColors.oddbg[1],\
|
|
|
|
ListColors.oddbg[2],0xffff)
|
|
|
|
|
|
|
|
cwidget = prefsTop.get_widget(EVENFGCOLOR)
|
|
|
|
cwidget.set_i16(ListColors.evenfg[0],ListColors.evenfg[1],\
|
|
|
|
ListColors.evenfg[2],0xffff)
|
|
|
|
|
|
|
|
cwidget = prefsTop.get_widget(EVENBGCOLOR)
|
|
|
|
cwidget.set_i16(ListColors.evenbg[0],ListColors.evenbg[1],\
|
|
|
|
ListColors.evenbg[2],0xffff)
|
|
|
|
|
2001-11-02 10:43:06 +05:30
|
|
|
cwidget = prefsTop.get_widget(ANCESTORFGCOLOR)
|
|
|
|
cwidget.set_i16(ListColors.ancestorfg[0],ListColors.ancestorfg[1],\
|
|
|
|
ListColors.ancestorfg[2],0xffff)
|
|
|
|
|
2001-06-17 19:10:13 +05:30
|
|
|
prefsTop.get_widget("enableColors").set_active(ListColors.get_enable())
|
|
|
|
prefsTop.get_widget(ODDFGCOLOR).set_sensitive(ListColors.get_enable())
|
|
|
|
prefsTop.get_widget(ODDBGCOLOR).set_sensitive(ListColors.get_enable())
|
|
|
|
prefsTop.get_widget(EVENBGCOLOR).set_sensitive(ListColors.get_enable())
|
|
|
|
prefsTop.get_widget(EVENFGCOLOR).set_sensitive(ListColors.get_enable())
|
2001-11-02 10:43:06 +05:30
|
|
|
prefsTop.get_widget(ANCESTORFGCOLOR).set_sensitive(ListColors.get_enable())
|
2001-06-28 20:50:41 +05:30
|
|
|
|
|
|
|
prefsTop.get_widget("dbdir").gtk_entry().set_text(db_dir)
|
|
|
|
prefsTop.get_widget("repdir").gtk_entry().set_text(report_dir)
|
2001-07-02 03:01:52 +05:30
|
|
|
prefsTop.get_widget("htmldir").gtk_entry().set_text(web_dir)
|
2001-05-13 07:26:57 +05:30
|
|
|
|
|
|
|
pbox.set_modified(0)
|
|
|
|
pbox.show()
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def get_config_color(name,defval):
|
2001-11-02 23:16:33 +05:30
|
|
|
r = get_int("/gramps/color/" + name + ".r")
|
|
|
|
g = get_int("/gramps/color/" + name + ".g")
|
|
|
|
b = get_int("/gramps/color/" + name + ".b")
|
2001-07-13 08:34:39 +05:30
|
|
|
if r == None:
|
2001-05-13 07:26:57 +05:30
|
|
|
return defval
|
|
|
|
else:
|
|
|
|
return (r,g,b)
|
2001-11-06 21:20:42 +05:30
|
|
|
|
|
|
|
def get_sort_cols(name,col,dir):
|
|
|
|
c = get_int("/gramps/sort/%s_col" % name)
|
|
|
|
if c == None:
|
|
|
|
c = col
|
|
|
|
d = get_int("/gramps/sort/%s_dir" % name)
|
|
|
|
if d == None:
|
|
|
|
d = dir
|
|
|
|
return (c,d)
|
|
|
|
|
|
|
|
def save_sort_cols(name,col,dir):
|
|
|
|
set_int("/gramps/sort/%s_col" % name, col)
|
|
|
|
set_int("/gramps/sort/%s_dir" % name, dir)
|
|
|
|
sync()
|
|
|
|
|
2001-05-13 07:26:57 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
def druid_cancel_clicked(obj,a):
|
|
|
|
utils.destroy_passed_object(obj)
|
|
|
|
|
|
|
|
|
|
|
|
|