From 1226c0d55a0aaec68481ec9d6aa5e0cbb785a0a2 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 17 Jan 2006 05:03:30 +0000 Subject: [PATCH] * src/AddMedia.py: glade path * src/AddrEdit.py: glade path * src/AttrEdit.py: glade path * src/DateEdit.py: glade path * src/EventEdit.py: glade path * src/GrampsCfg.py: glade path * src/ImageSelect.py: glade path * src/Sources.py: glade path * src/StyleEditor.py: glade path * src/const.py.in: glade path * src/Marriage.py: glade path * src/unlocked.png: added * src/GrampsDb/_ReadGedcom.py: optimize UI updates, add test code svn: r5772 --- ChangeLog | 14 +++++++++- src/AddMedia.py | 2 +- src/AddrEdit.py | 2 +- src/AttrEdit.py | 2 +- src/DateEdit.py | 2 +- src/EditFamily.py | 19 ++++++++++++-- src/EditPlace.py | 2 +- src/EventEdit.py | 4 +-- src/GrampsCfg.py | 2 +- src/GrampsDb/_ReadGedcom.py | 4 +-- src/ImageSelect.py | 6 ++--- src/LocEdit.py | 2 +- src/Marriage.py | 2 +- src/NameEdit.py | 2 +- src/QuestionDialog.py | 16 ++++++------ src/Sources.py | 4 +-- src/StyleEditor.py | 4 +-- src/UrlEdit.py | 2 +- src/Witness.py | 2 +- src/const.py.in | 50 +++++++++++++++--------------------- src/gramps.glade | 4 +-- src/unlocked.png | Bin 0 -> 833 bytes 22 files changed, 83 insertions(+), 64 deletions(-) create mode 100644 src/unlocked.png diff --git a/ChangeLog b/ChangeLog index 1c4507433..89e34d99c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,18 @@ 2006-01-16 Don Allingham + * src/AddMedia.py: glade path + * src/AddrEdit.py: glade path + * src/AttrEdit.py: glade path + * src/DateEdit.py: glade path + * src/EventEdit.py: glade path + * src/GrampsCfg.py: glade path + * src/ImageSelect.py: glade path + * src/Sources.py: glade path + * src/StyleEditor.py: glade path + * src/const.py.in: glade path + * src/Marriage.py: glade path + * src/unlocked.png: added * src/gramps.glade: remove lock border - * src/GrampsDb/_ReadGedcom.py: optimize UI updates + * src/GrampsDb/_ReadGedcom.py: optimize UI updates, add test code 2006-01-16 Alex Roitman * src/ViewManager: Remov unused code. diff --git a/src/AddMedia.py b/src/AddMedia.py index 3e6f5f549..c06ad2fa4 100644 --- a/src/AddMedia.py +++ b/src/AddMedia.py @@ -79,7 +79,7 @@ class AddMediaObject: db - the database in which the new object is to be stored """ self.db = db - self.glade = gtk.glade.XML(const.imageselFile,"imageSelect","gramps") + self.glade = gtk.glade.XML(const.gladeFile,"imageSelect","gramps") self.window = self.glade.get_widget("imageSelect") self.description = self.glade.get_widget("photoDescription") self.image = self.glade.get_widget("image") diff --git a/src/AddrEdit.py b/src/AddrEdit.py index 07943c7bb..683fd3c50 100644 --- a/src/AddrEdit.py +++ b/src/AddrEdit.py @@ -86,7 +86,7 @@ class AddressEditor(DisplayState.ManagedWindow): return # Get the important widgets from the glade description - self.top = gtk.glade.XML(const.dialogFile, "addr_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "addr_edit","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("addr_edit") diff --git a/src/AttrEdit.py b/src/AttrEdit.py index 505a0f19a..b39c23544 100644 --- a/src/AttrEdit.py +++ b/src/AttrEdit.py @@ -92,7 +92,7 @@ class AttributeEditor(DisplayState.ManagedWindow): if self.already_exist: return - self.top = gtk.glade.XML(const.dialogFile, "attr_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "attr_edit","gramps") self.slist = self.top.get_widget("slist") self.value_field = self.top.get_widget("attr_value") self.note_field = self.top.get_widget("attr_note") diff --git a/src/DateEdit.py b/src/DateEdit.py index 4db35a787..c76ac0a7c 100644 --- a/src/DateEdit.py +++ b/src/DateEdit.py @@ -187,7 +187,7 @@ class DateEditorDialog: # Create self.date as a copy of the given Date object. self.date = Date.Date(date) - self.top = gtk.glade.XML(const.dialogFile, "date_edit","gramps" ) + self.top = gtk.glade.XML(const.gladeFile, "date_edit","gramps" ) self.top_window = self.top.get_widget('date_edit') self.top_window.hide() title = self.top.get_widget('title') diff --git a/src/EditFamily.py b/src/EditFamily.py index 11e0087cd..077f6a311 100644 --- a/src/EditFamily.py +++ b/src/EditFamily.py @@ -26,7 +26,7 @@ # #------------------------------------------------------------------------- import cPickle as pickle -import gc +import os import sys from gettext import gettext as _ @@ -166,7 +166,7 @@ class EditFamily(DisplayState.ManagedWindow): def build_interface(self): - self.top = gtk.glade.XML(const.placesFile,"marriageEditor","gramps") + self.top = gtk.glade.XML(const.gladeFile,"marriageEditor","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("marriageEditor") @@ -191,6 +191,8 @@ class EditFamily(DisplayState.ManagedWindow): self.vbox = self.top.get_widget('vbox') self.child_list = self.top.get_widget('child_list') + self.private= self.top.get_widget('private') + rel_types = dict(Utils.family_relations) mtype = self.family.get_relationship() @@ -242,6 +244,19 @@ class EditFamily(DisplayState.ManagedWindow): self.notebook.set_tab_label(self.gallery_tab,self.gallery_tab.get_tab_widget()) self.gid.set_text(self.family.get_gramps_id()) + self.private.connect('toggled',self.privacy_toggled) + self.private.set_active(self.family.get_privacy()) + + def privacy_toggled(self,obj): + for o in obj.get_children(): + obj.remove(o) + img = gtk.Image() + if obj.get_active(): + img.set_from_file(os.path.join(const.rootDir,"locked.png")) + else: + img.set_from_file(os.path.join(const.rootDir,"unlocked.png")) + img.show() + obj.add(img) def update_father(self,handle): self.load_parent(handle, self.fbox, self.fbirth, self.fdeath, self.fbutton) diff --git a/src/EditPlace.py b/src/EditPlace.py index b0eb33e6d..74ecf46a7 100644 --- a/src/EditPlace.py +++ b/src/EditPlace.py @@ -86,7 +86,7 @@ class EditPlace(DisplayState.ManagedWindow): else: self.srcreflist = [] - self.top = gtk.glade.XML(const.placesFile,"placeEditor","gramps") + self.top = gtk.glade.XML(const.gladeFile,"placeEditor","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("placeEditor") diff --git a/src/EventEdit.py b/src/EventEdit.py index ef72f4502..5bdb495c8 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -134,7 +134,7 @@ class EventEditor(DisplayState.ManagedWindow): self.srcreflist = [] self.date = Date.Date(None) - self.top = gtk.glade.XML(const.dialogFile, "event_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "event_edit","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("event_edit") @@ -426,7 +426,7 @@ class EventRefEditor(DisplayState.ManagedWindow): self.title = _('Event Reference Editor') - self.top = gtk.glade.XML(const.dialogFile, "event_eref_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "event_eref_edit","gramps") self.window = self.top.get_widget('event_eref_edit') self.ref_note_field = self.top.get_widget('eer_ref_note') self.role_combo = self.top.get_widget('eer_role_combo') diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 54847ec2a..4ff694637 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -145,7 +145,7 @@ class GrampsPreferences: def __init__(self,db): self.built = 0 self.db = db - self.top = gtk.glade.XML(const.prefsFile,"preferences","gramps") + self.top = gtk.glade.XML(const.gladeFile,"preferences","gramps") self.gladeif = GladeIf(self.top) self.gladeif.connect('button6','clicked',self.on_close_clicked) diff --git a/src/GrampsDb/_ReadGedcom.py b/src/GrampsDb/_ReadGedcom.py index 49c807829..220d50364 100644 --- a/src/GrampsDb/_ReadGedcom.py +++ b/src/GrampsDb/_ReadGedcom.py @@ -493,8 +493,8 @@ class GedcomParser: def update(self,field,text): field.set_text(text) - while gtk.events_pending(): - gtk.main_iteration() +# while gtk.events_pending(): +# gtk.main_iteration() def get_next(self): if self.backoff == 0: diff --git a/src/ImageSelect.py b/src/ImageSelect.py index 50c41f55e..d5c050669 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -116,7 +116,7 @@ class ImageSelect: if self.path == '': return - self.glade = gtk.glade.XML(const.imageselFile,"imageSelect","gramps") + self.glade = gtk.glade.XML(const.gladeFile,"imageSelect","gramps") self.window = self.glade.get_widget("imageSelect") self.fname = self.glade.get_widget("fname") @@ -695,7 +695,7 @@ class LocalMediaProperties: self.lists_changed = 0 fname = self.obj.get_path() - self.change_dialog = gtk.glade.XML(const.imageselFile, + self.change_dialog = gtk.glade.XML(const.gladeFile, "change_description","gramps") title = _('Media Reference Editor') @@ -981,7 +981,7 @@ class GlobalMediaProperties(DisplayState.ManagedWindow): self.refmodel = None # this becomes the model for the references self.path = self.db.get_save_path() - self.change_dialog = gtk.glade.XML(const.imageselFile, + self.change_dialog = gtk.glade.XML(const.gladeFile, "change_global","gramps") self.gladeif = GladeIf(self.change_dialog) diff --git a/src/LocEdit.py b/src/LocEdit.py index 07f8d44bf..f034a220d 100644 --- a/src/LocEdit.py +++ b/src/LocEdit.py @@ -59,7 +59,7 @@ class LocationEditor: else: self.win_key = self self.location = location - self.top = gtk.glade.XML(const.dialogFile, "loc_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "loc_edit","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("loc_edit") diff --git a/src/Marriage.py b/src/Marriage.py index ab1b25b6a..c1d9f21b0 100644 --- a/src/Marriage.py +++ b/src/Marriage.py @@ -111,7 +111,7 @@ class Marriage: p = db.get_place_from_handle(key).get_display_info() self.pmap[p[0]] = key - self.top = gtk.glade.XML(const.marriageFile,"marriageEditor","gramps") + self.top = gtk.glade.XML(const.gladeFile,"marriageEditor","gramps") self.gladeif = GladeIf(self.top) self.window = self.get_widget("marriageEditor") diff --git a/src/NameEdit.py b/src/NameEdit.py index 66faffe79..9d1281ccc 100644 --- a/src/NameEdit.py +++ b/src/NameEdit.py @@ -75,7 +75,7 @@ class NameEditor(DisplayState.ManagedWindow): return self.name = name - self.top = gtk.glade.XML(const.dialogFile, "name_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "name_edit","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("name_edit") self.given_field = self.top.get_widget("alt_given") diff --git a/src/QuestionDialog.py b/src/QuestionDialog.py index 3092afbd1..9db10ea06 100644 --- a/src/QuestionDialog.py +++ b/src/QuestionDialog.py @@ -51,7 +51,7 @@ except: class SaveDialog: def __init__(self,msg1,msg2,task1,task2,parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"savedialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"savedialog","gramps") self.top = self.xml.get_widget('savedialog') self.top.set_icon(ICON) self.dontask = self.xml.get_widget('dontask') @@ -79,7 +79,7 @@ class SaveDialog: class QuestionDialog: def __init__(self,msg1,msg2,label,task,parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"questiondialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"questiondialog","gramps") self.top = self.xml.get_widget('questiondialog') self.top.set_icon(ICON) self.top.set_title('') @@ -104,7 +104,7 @@ class QuestionDialog: class QuestionDialog2: def __init__(self,msg1,msg2,label_msg1,label_msg2,parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"questiondialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"questiondialog","gramps") self.top = self.xml.get_widget('questiondialog') self.top.set_icon(ICON) self.top.set_title('') @@ -130,7 +130,7 @@ class QuestionDialog2: class OptionDialog: def __init__(self,msg1,msg2,btnmsg1,task1,btnmsg2,task2,parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"optiondialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"optiondialog","gramps") self.top = self.xml.get_widget('optiondialog') self.top.set_icon(ICON) self.top.set_title('') @@ -163,7 +163,7 @@ class OptionDialog: class ErrorDialog: def __init__(self,msg1,msg2="",parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"errdialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"errdialog","gramps") self.top = self.xml.get_widget('errdialog') self.top.set_icon(ICON) @@ -181,7 +181,7 @@ class ErrorDialog: class WarningDialog: def __init__(self,msg1,msg2="",parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"warndialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"warndialog","gramps") self.top = self.xml.get_widget('warndialog') self.top.set_icon(ICON) @@ -199,7 +199,7 @@ class WarningDialog: class OkDialog: def __init__(self,msg1,msg2="",parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"okdialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"okdialog","gramps") self.top = self.xml.get_widget('okdialog') self.top.set_icon(ICON) @@ -216,7 +216,7 @@ class OkDialog: class MissingMediaDialog: def __init__(self,msg1,msg2,task1,task2,task3,parent=None): - self.xml = gtk.glade.XML(const.errdialogsFile,"missmediadialog","gramps") + self.xml = gtk.glade.XML(const.gladeFile,"missmediadialog","gramps") self.top = self.xml.get_widget('missmediadialog') self.top.set_icon(ICON) self.task1 = task1 diff --git a/src/Sources.py b/src/Sources.py index 0e589bdb3..8fdf92fc6 100644 --- a/src/Sources.py +++ b/src/Sources.py @@ -87,7 +87,7 @@ class SourceSelector(DisplayState.ManagedWindow): for s in self.orig: self.list.append(RelLib.SourceRef(s)) self.update=update - self.top = gtk.glade.XML(const.srcselFile,"sourcesel","gramps") + self.top = gtk.glade.XML(const.gladeFile,"sourcesel","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("sourcesel") @@ -356,7 +356,7 @@ class SourceEditor(DisplayState.ManagedWindow): self.update = update self.source_ref = srcref - self.showSource = gtk.glade.XML(const.srcselFile, + self.showSource = gtk.glade.XML(const.gladeFile, "sourceDisplay","gramps") self.window = self.get_widget("sourceDisplay") diff --git a/src/StyleEditor.py b/src/StyleEditor.py index 13c9a3a98..cb2de16a6 100644 --- a/src/StyleEditor.py +++ b/src/StyleEditor.py @@ -77,7 +77,7 @@ class StyleListDisplay: self.callback = callback self.sheetlist = stylesheetlist - self.top = gtk.glade.XML(const.stylesFile,"styles","gramps") + self.top = gtk.glade.XML(const.gladeFile,"styles","gramps") self.window = self.top.get_widget('styles') Utils.set_titles(self.window, @@ -185,7 +185,7 @@ class StyleEditor: self.original_style = style self.style = BaseDoc.StyleSheet(style) self.parent = parent - self.top = gtk.glade.XML(const.stylesFile,"editor","gramps") + self.top = gtk.glade.XML(const.gladeFile,"editor","gramps") self.top.signal_autoconnect({ "on_save_style_clicked" : self.on_save_style_clicked, diff --git a/src/UrlEdit.py b/src/UrlEdit.py index 08c58f8a2..d19b69bc1 100644 --- a/src/UrlEdit.py +++ b/src/UrlEdit.py @@ -70,7 +70,7 @@ class UrlEditor(DisplayState.ManagedWindow): self.url = url self.callback = callback - self.top = gtk.glade.XML(const.dialogFile, "url_edit","gramps") + self.top = gtk.glade.XML(const.gladeFile, "url_edit","gramps") self.gladeif = GladeIf(self.top) self.window = self.top.get_widget("url_edit") diff --git a/src/Witness.py b/src/Witness.py index c49768b3c..76de5df4c 100644 --- a/src/Witness.py +++ b/src/Witness.py @@ -144,7 +144,7 @@ class WitnessEditor: self.win_key = self self.update = update self.ref = ref - self.show_witness = gtk.glade.XML(const.dialogFile, + self.show_witness = gtk.glade.XML(const.gladeFile, "witness_edit","gramps") self.gladeif = GladeIf(self.show_witness) diff --git a/src/const.py.in b/src/const.py.in index 419d60bbe..c27c143ac 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -93,42 +93,34 @@ if os.environ.has_key('GRAMPSDIR'): else: rootDir = "." -good_xpm = "%s/good.png" % rootDir -bad_xpm = "%s/bad.png" % rootDir -caution_xpm = "%s/caution.png" % rootDir +good_xpm = os.path.join(rootDir,"good.png") +bad_xpm = os.path.join(rootDir,"bad.png") +caution_xpm = os.path.join(rootDir,"caution.png") -system_filters = "%s/system_filters.xml" % rootDir +system_filters = os.path.join(rootDir,"system_filters.xml") custom_filters = "~/.gramps/custom_filters.xml" report_options = "~/.gramps/report_options.xml" tool_options = "~/.gramps/tool_options.xml" bsddbenv_dir = "~/.gramps/bsddbenv" -icon = "%s/gramps.png" % rootDir -logo = "%s/logo.png" % rootDir -splash = "%s/splash.jpg" % rootDir -license = "%s/COPYING" % rootDir -gladeFile = "%s/gramps.glade" % rootDir -placesFile = "%s/gramps.glade" % rootDir -imageselFile = "%s/gramps.glade" % rootDir -marriageFile = "%s/gramps.glade" % rootDir -editPersonFile = "%s/edit_person.glade" % rootDir -pluginsFile = "%s/plugins.glade" % rootDir -prefsFile = "%s/gramps.glade" % rootDir -stylesFile = "%s/gramps.glade" % rootDir -dialogFile = "%s/gramps.glade" % rootDir -srcselFile = "%s/gramps.glade" % rootDir -mergeFile = "%s/mergedata.glade" % rootDir -merge2File = "%s/merge.glade" % rootDir -filterFile = "%s/rule.glade" % rootDir -errdialogsFile = "%s/gramps.glade" % rootDir +icon = os.path.join(rootDir,"gramps.png") +logo = os.path.join(rootDir,"logo.png") +splash = os.path.join(rootDir,"splash.jpg") +license = os.path.join(rootDir,"COPYING") +gladeFile = os.path.join(rootDir,"gramps.glade") +editPersonFile = os.path.join(rootDir,"edit_person.glade") +pluginsFile = os.path.join(rootDir,"plugins.glade") +mergeFile = os.path.join(rootDir,"mergedata.glade") +merge2File = os.path.join(rootDir,"merge.glade") +filterFile = os.path.join(rootDir,"rule.glade") -pluginsDir = "%s/plugins" % rootDir -datesDir = "%s/dates" % rootDir -docgenDir = "%s/docgen" % rootDir -dataDir = "%s/data" % rootDir -template_dir = "%s/templates" % dataDir +pluginsDir = os.path.join(rootDir,"plugins") +datesDir = os.path.join(rootDir,"dates") +docgenDir = os.path.join(rootDir,"docgen") +dataDir = os.path.join(rootDir,"data") +template_dir = os.path.join(dataDir,"templates") papersize = "file:%s/papersize.xml" % dataDir -tipdata = "%s/tips.xml" % dataDir -fdl = "%s/fdl.txt" % dataDir +tipdata = os.path.join(dataDir,"tips.xml") +fdl = os.path.join(dataDir,"fdl.txt") startup = 1 dnd_images = 1 diff --git a/src/gramps.glade b/src/gramps.glade index aef291181..d7a0e9e2e 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -2420,7 +2420,7 @@ - + True True GTK_RELIEF_NONE @@ -2431,7 +2431,7 @@ True - locked.png + unlocked.png 0.5 0.5 0 diff --git a/src/unlocked.png b/src/unlocked.png new file mode 100644 index 0000000000000000000000000000000000000000..5fc07f926c9533b1073e15ddf041f9143bf15b34 GIT binary patch literal 833 zcmV-H1HSx;P)MzCV_|S*E^l&Yo9;Xs0008iNklwyo>;yXXi2Oo(D?ltEY z&+5i-eZJKic_~fOv3@`AudZIZxVE;oaQf64zT?yPIZpTPdtiCG{m7h&3Th?+OTdE< zP0WI162Q?rUUe_P*!b8d&pb6dCtzIt_3HN*E_^w^ytH)QmQLE!Q?I;x{GCVd3plrU zmfBP8*9u!;?f3O>R#sMCc>AsS&(_yB-uPo<}@m}qb!Wuw{Bnh z_@fgQ0GvK`Mj+CSjR6q~q7Rl!OA{Z&N&WDl(TB&hp35pMvh?I1_>w?*p_s z{ zvH9Hjll6sT@AXb-01$2VO-vrWabP;Fcl*hZb=G8QimWk<{ZmH}8wQKR$R3LjZX)lF z<2S*`-3SyBi}IDd;Yfy(A1*GNLx-P*wH?^}7J_yNzK`I0@V*CE7yyO_01;5pFLXps z<&J3oe1kz@)c z0=x&b2YkgK(olqOH-dnQd{=2@6*FPH>CjBKk@x?GFLqIs9R#*uW-xnHWdmSV1AzBI z`rF@iYQ_#r)*On65rT!55+OK19KaXC_Kcwaz87LhODgM(5Iic2W(u(O*Ke_h{NCn7^40wPkM zzmMlhMMv_|WVuyoFXuG3T=SJE5SL1ci?!G|7F#;3e!7USMa2CBn=xfK_`$f`00000 LNkvXXu0mjft2=^2 literal 0 HcmV?d00001