From 8059e6793882cd5e8493f15f775ad0feed0c42cc Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Thu, 14 Dec 2006 15:32:33 +0000 Subject: [PATCH] * src/DataViews/_PedigreeView.py, * src/DataViews/_RelationView.py, * src/Editors/_EditLdsOrd.py, * src/Editors/_EditSourceRef.py, * src/Editors/_EditAttribute.py, * src/Editors/_EditPerson.py, * src/Editors/_EditEventRef.py, * src/Editors/_EditName.py, * src/DisplayTabs/_ButtonTab.py: Hide some more controls when readonly svn: r7801 --- ChangeLog | 10 ++++++++++ src/DataViews/_PedigreeView.py | 5 +++-- src/DataViews/_RelationView.py | 11 ++++++----- src/DisplayTabs/_ButtonTab.py | 12 ++++++++++-- src/Editors/_EditAttribute.py | 2 +- src/Editors/_EditEventRef.py | 4 ++-- src/Editors/_EditLdsOrd.py | 2 +- src/Editors/_EditName.py | 5 ++--- src/Editors/_EditPerson.py | 3 ++- src/Editors/_EditSourceRef.py | 2 +- 10 files changed, 38 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4dd02659..f9a38e2d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ * src/Selectors/_SelectPerson.py: Enable markup for bith date column to enable birth fallback in italics (closes #763) + * src/DataViews/_PedigreeView.py, + * src/DataViews/_RelationView.py, + * src/Editors/_EditLdsOrd.py, + * src/Editors/_EditSourceRef.py, + * src/Editors/_EditAttribute.py, + * src/Editors/_EditPerson.py, + * src/Editors/_EditEventRef.py, + * src/Editors/_EditName.py, + * src/DisplayTabs/_ButtonTab.py: Hide some more controls when readonly + 2006-12-13 Alex Roitman * src/Filters/Rules/Family/_RegExpFatherName.py: Add new module. * src/Filters/Rules/Family/_RegExpMotherName.py: Add new module. diff --git a/src/DataViews/_PedigreeView.py b/src/DataViews/_PedigreeView.py index 7b4e1e868..7fc7f04d4 100644 --- a/src/DataViews/_PedigreeView.py +++ b/src/DataViews/_PedigreeView.py @@ -797,8 +797,9 @@ class PedigreeView(PageView.PersonNavView): fam = lst[((i+1)/2)-1][2] if fam: fam_h = fam.get_handle() - pw.connect("button-press-event", self.missing_parent_button_press_cb,lst[((i+1)/2)-1][0].get_handle(),fam_h) - pw.force_mouse_over = True + if not self.dbstate.db.readonly: + pw.connect("button-press-event", self.missing_parent_button_press_cb,lst[((i+1)/2)-1][0].get_handle(),fam_h) + pw.force_mouse_over = True if positions[i][0][2] > 1: table_widget.attach(pw,x,x+w,y,y+h,gtk.FILL,gtk.FILL,0,0) else: diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index ba3d62069..a1d686e31 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -646,7 +646,7 @@ class RelationshipView(PageView.PersonNavView): call_fcn = self.add_family del_fcn = self.delete_family - if not self.toolbar_visible: + if not self.toolbar_visible and not self.dbstate.db.readonly: # Show edit-Buttons if toolbar is not visible if self.reorder_sensitive: add = GrampsWidgets.IconButton(self.reorder, None, @@ -668,10 +668,11 @@ class RelationshipView(PageView.PersonNavView): gtk.STOCK_EDIT) self.tooltips.set_tip(edit, edit_msg) hbox.pack_start(edit, False) - delete = GrampsWidgets.IconButton(del_fcn, family.handle, - gtk.STOCK_REMOVE) - self.tooltips.set_tip(delete, del_msg) - hbox.pack_start(delete, False) + if not self.dbstate.db.readonly: + delete = GrampsWidgets.IconButton(del_fcn, family.handle, + gtk.STOCK_REMOVE) + self.tooltips.set_tip(delete, del_msg) + hbox.pack_start(delete, False) self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1) self.row += 1 diff --git a/src/DisplayTabs/_ButtonTab.py b/src/DisplayTabs/_ButtonTab.py index 2cdbbd735..00a78ccd5 100644 --- a/src/DisplayTabs/_ButtonTab.py +++ b/src/DisplayTabs/_ButtonTab.py @@ -102,6 +102,12 @@ class ButtonTab(GrampsTab): else: self.share_btn = None + if self.dbstate.db.readonly: + self.add_btn.set_sensitive(False) + self.del_btn.set_sensitive(False) + if share_button: + self.share_btn.set_sensitive(False) + vbox = gtk.VBox() vbox.set_spacing(6) vbox.pack_start(self.add_btn, False) @@ -159,7 +165,9 @@ class ButtonTab(GrampsTab): # and 0 can be returned if self.get_selected() != None: self.edit_btn.set_sensitive(True) - self.del_btn.set_sensitive(True) + if not self.dbstate.db.readonly: + self.del_btn.set_sensitive(True) else: self.edit_btn.set_sensitive(False) - self.del_btn.set_sensitive(False) + if not self.dbstate.db.readonly: + self.del_btn.set_sensitive(False) diff --git a/src/Editors/_EditAttribute.py b/src/Editors/_EditAttribute.py index 951683246..be8495130 100644 --- a/src/Editors/_EditAttribute.py +++ b/src/Editors/_EditAttribute.py @@ -98,7 +98,7 @@ class EditAttribute(EditSecondary): self.priv = PrivacyButton( self.top.get_widget("private"), - self.obj) + self.obj, self.db.readonly) self.type_selector = MonitoredDataType( self.top.get_widget("attr_menu"), diff --git a/src/Editors/_EditEventRef.py b/src/Editors/_EditEventRef.py index 61b057dff..7027271c9 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/Editors/_EditEventRef.py @@ -94,7 +94,7 @@ class EditEventRef(EditReference): self.ref_privacy = PrivacyButton( self.top.get_widget('eer_ref_priv'), - self.source_ref) + self.source_ref, self.db.readonly) self.descr_field = MonitoredEntry( self.top.get_widget("eer_description"), @@ -120,7 +120,7 @@ class EditEventRef(EditReference): self.ev_privacy = PrivacyButton( self.top.get_widget("eer_ev_priv"), - self.source) + self.source, self.db.readonly) self.role_selector = MonitoredDataType( self.top.get_widget('eer_role_combo'), diff --git a/src/Editors/_EditLdsOrd.py b/src/Editors/_EditLdsOrd.py index 55566a1ef..71cbd942d 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/Editors/_EditLdsOrd.py @@ -173,7 +173,7 @@ class EditLdsOrd(EditSecondary): self.priv = PrivacyButton( self.top.get_widget("private"), - self.obj) + self.obj, self.db.readonly) self.date_field = MonitoredDate( self.top.get_widget("date"), diff --git a/src/Editors/_EditName.py b/src/Editors/_EditName.py index 0e9aa8bf0..59ce98bd4 100644 --- a/src/Editors/_EditName.py +++ b/src/Editors/_EditName.py @@ -177,7 +177,8 @@ class EditName(EditSecondary): ) self.privacy = PrivacyButton( - self.top.get_widget("priv"), self.obj) + self.top.get_widget("priv"), self.obj, + self.db.readonly) def _create_tabbed_pages(self): @@ -247,5 +248,3 @@ class EditName(EditSecondary): if self.callback: self.callback(self.obj) self.close() - - diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index 3d0d6a0fe..cd7df27f9 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -173,7 +173,8 @@ class EditPerson(EditPrimary): self.private = GrampsWidgets.PrivacyButton( self.top.get_widget('private'), - self.obj) + self.obj, + self.db.readonly) self.gender = GrampsWidgets.MonitoredMenu( self.top.get_widget('gender'), diff --git a/src/Editors/_EditSourceRef.py b/src/Editors/_EditSourceRef.py index 8fd80b53b..130b421f1 100644 --- a/src/Editors/_EditSourceRef.py +++ b/src/Editors/_EditSourceRef.py @@ -85,7 +85,7 @@ class EditSourceRef(EditReference): def _setup_fields(self): self.ref_privacy = PrivacyButton( - self.top.get_widget('privacy'), self.source_ref) + self.top.get_widget('privacy'), self.source_ref, self.db.readonly) self.volume = MonitoredEntry( self.top.get_widget("volume"), self.source_ref.set_page,