* 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
This commit is contained in:
Martin Hawlisch 2006-12-14 15:32:33 +00:00
parent 60736742c3
commit 66f31e75e5
10 changed files with 38 additions and 18 deletions

View File

@ -2,6 +2,16 @@
* src/Selectors/_SelectPerson.py: Enable markup for bith date column * src/Selectors/_SelectPerson.py: Enable markup for bith date column
to enable birth fallback in italics (closes #763) 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 <shura@gramps-project.org> 2006-12-13 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Family/_RegExpFatherName.py: Add new module. * src/Filters/Rules/Family/_RegExpFatherName.py: Add new module.
* src/Filters/Rules/Family/_RegExpMotherName.py: Add new module. * src/Filters/Rules/Family/_RegExpMotherName.py: Add new module.

View File

@ -797,6 +797,7 @@ class PedigreeView(PageView.PersonNavView):
fam = lst[((i+1)/2)-1][2] fam = lst[((i+1)/2)-1][2]
if fam: if fam:
fam_h = fam.get_handle() fam_h = fam.get_handle()
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.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 pw.force_mouse_over = True
if positions[i][0][2] > 1: if positions[i][0][2] > 1:

View File

@ -646,7 +646,7 @@ class RelationshipView(PageView.PersonNavView):
call_fcn = self.add_family call_fcn = self.add_family
del_fcn = self.delete_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 # Show edit-Buttons if toolbar is not visible
if self.reorder_sensitive: if self.reorder_sensitive:
add = GrampsWidgets.IconButton(self.reorder, None, add = GrampsWidgets.IconButton(self.reorder, None,
@ -668,6 +668,7 @@ class RelationshipView(PageView.PersonNavView):
gtk.STOCK_EDIT) gtk.STOCK_EDIT)
self.tooltips.set_tip(edit, edit_msg) self.tooltips.set_tip(edit, edit_msg)
hbox.pack_start(edit, False) hbox.pack_start(edit, False)
if not self.dbstate.db.readonly:
delete = GrampsWidgets.IconButton(del_fcn, family.handle, delete = GrampsWidgets.IconButton(del_fcn, family.handle,
gtk.STOCK_REMOVE) gtk.STOCK_REMOVE)
self.tooltips.set_tip(delete, del_msg) self.tooltips.set_tip(delete, del_msg)

View File

@ -102,6 +102,12 @@ class ButtonTab(GrampsTab):
else: else:
self.share_btn = None 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 = gtk.VBox()
vbox.set_spacing(6) vbox.set_spacing(6)
vbox.pack_start(self.add_btn, False) vbox.pack_start(self.add_btn, False)
@ -159,7 +165,9 @@ class ButtonTab(GrampsTab):
# and 0 can be returned # and 0 can be returned
if self.get_selected() != None: if self.get_selected() != None:
self.edit_btn.set_sensitive(True) self.edit_btn.set_sensitive(True)
if not self.dbstate.db.readonly:
self.del_btn.set_sensitive(True) self.del_btn.set_sensitive(True)
else: else:
self.edit_btn.set_sensitive(False) self.edit_btn.set_sensitive(False)
if not self.dbstate.db.readonly:
self.del_btn.set_sensitive(False) self.del_btn.set_sensitive(False)

View File

@ -98,7 +98,7 @@ class EditAttribute(EditSecondary):
self.priv = PrivacyButton( self.priv = PrivacyButton(
self.top.get_widget("private"), self.top.get_widget("private"),
self.obj) self.obj, self.db.readonly)
self.type_selector = MonitoredDataType( self.type_selector = MonitoredDataType(
self.top.get_widget("attr_menu"), self.top.get_widget("attr_menu"),

View File

@ -94,7 +94,7 @@ class EditEventRef(EditReference):
self.ref_privacy = PrivacyButton( self.ref_privacy = PrivacyButton(
self.top.get_widget('eer_ref_priv'), self.top.get_widget('eer_ref_priv'),
self.source_ref) self.source_ref, self.db.readonly)
self.descr_field = MonitoredEntry( self.descr_field = MonitoredEntry(
self.top.get_widget("eer_description"), self.top.get_widget("eer_description"),
@ -120,7 +120,7 @@ class EditEventRef(EditReference):
self.ev_privacy = PrivacyButton( self.ev_privacy = PrivacyButton(
self.top.get_widget("eer_ev_priv"), self.top.get_widget("eer_ev_priv"),
self.source) self.source, self.db.readonly)
self.role_selector = MonitoredDataType( self.role_selector = MonitoredDataType(
self.top.get_widget('eer_role_combo'), self.top.get_widget('eer_role_combo'),

View File

@ -173,7 +173,7 @@ class EditLdsOrd(EditSecondary):
self.priv = PrivacyButton( self.priv = PrivacyButton(
self.top.get_widget("private"), self.top.get_widget("private"),
self.obj) self.obj, self.db.readonly)
self.date_field = MonitoredDate( self.date_field = MonitoredDate(
self.top.get_widget("date"), self.top.get_widget("date"),

View File

@ -177,7 +177,8 @@ class EditName(EditSecondary):
) )
self.privacy = PrivacyButton( 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): def _create_tabbed_pages(self):
@ -247,5 +248,3 @@ class EditName(EditSecondary):
if self.callback: if self.callback:
self.callback(self.obj) self.callback(self.obj)
self.close() self.close()

View File

@ -173,7 +173,8 @@ class EditPerson(EditPrimary):
self.private = GrampsWidgets.PrivacyButton( self.private = GrampsWidgets.PrivacyButton(
self.top.get_widget('private'), self.top.get_widget('private'),
self.obj) self.obj,
self.db.readonly)
self.gender = GrampsWidgets.MonitoredMenu( self.gender = GrampsWidgets.MonitoredMenu(
self.top.get_widget('gender'), self.top.get_widget('gender'),

View File

@ -85,7 +85,7 @@ class EditSourceRef(EditReference):
def _setup_fields(self): def _setup_fields(self):
self.ref_privacy = PrivacyButton( 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.volume = MonitoredEntry(
self.top.get_widget("volume"), self.source_ref.set_page, self.top.get_widget("volume"), self.source_ref.set_page,