* src/Editors/_EditSourceRef.py,
* src/Editors/_EditRepoRef.py, * src/Editors/_EditUrl.py, * src/Editors/_EditMediaRef.py, * src/Editors/_EditEventRef.py, * src/Editors/_EditFamily.py, * src/DisplayTabs/_NameEmbedList.py, * src/DisplayTabs/_EmbeddedList.py, * src/DisplayTabs/_GalleryTab.py, * src/DisplayTabs/_DataEmbedList.py: Disable some more controls when readonly svn: r7804
This commit is contained in:
parent
1e8a8d0160
commit
a78af64666
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2006-12-15 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/Editors/_EditSourceRef.py,
|
||||
* src/Editors/_EditRepoRef.py,
|
||||
* src/Editors/_EditUrl.py,
|
||||
* src/Editors/_EditMediaRef.py,
|
||||
* src/Editors/_EditEventRef.py,
|
||||
* src/Editors/_EditFamily.py,
|
||||
* src/DisplayTabs/_NameEmbedList.py,
|
||||
* src/DisplayTabs/_EmbeddedList.py,
|
||||
* src/DisplayTabs/_GalleryTab.py,
|
||||
* src/DisplayTabs/_DataEmbedList.py: Disable some more controls when
|
||||
readonly
|
||||
|
||||
2006-12-14 Alex Roitman <shura@gramps-project.org>
|
||||
* src/plugins/ChangeNames.py (toggled): Add method;
|
||||
(display): Connect renderer to the handling method.
|
||||
|
@ -63,7 +63,7 @@ class DataEmbedList(EmbeddedList):
|
||||
# and connect renderers to the 'edited' signal
|
||||
for colno in range(len(self.columns)):
|
||||
for renderer in self.columns[colno].get_cell_renderers():
|
||||
renderer.set_property('editable',True)
|
||||
renderer.set_property('editable',not self.dbstate.db.readonly)
|
||||
renderer.connect('edited',self.edit_inline,colno)
|
||||
|
||||
def get_data(self):
|
||||
|
@ -98,28 +98,30 @@ class EmbeddedList(ButtonTab):
|
||||
def get_popup_menu_items(self):
|
||||
if self.share_btn:
|
||||
itemlist = [
|
||||
(True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(False, _('Share'), self.edit_button_clicked),
|
||||
(True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, False, _('Share'), self.edit_button_clicked),
|
||||
(False,True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
]
|
||||
else:
|
||||
itemlist = [
|
||||
(True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(False,True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
]
|
||||
return itemlist
|
||||
|
||||
def right_click(self, obj, event):
|
||||
|
||||
menu = gtk.Menu()
|
||||
for (image, title, func) in self.get_popup_menu_items():
|
||||
for (needs_write_access, image, title, func) in self.get_popup_menu_items():
|
||||
if image:
|
||||
item = gtk.ImageMenuItem(stock_id=title)
|
||||
else:
|
||||
item = gtk.MenuItem(title)
|
||||
item.connect('activate', func)
|
||||
if needs_write_access and self.dbstate.db.readonly:
|
||||
item.set_sensitive(False)
|
||||
item.show()
|
||||
menu.append(item)
|
||||
menu.popup(None, None, None, event.button, event.time)
|
||||
@ -148,7 +150,8 @@ class EmbeddedList(ButtonTab):
|
||||
[self._DND_TYPE.target()],
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.tree.connect('drag_data_get', self.drag_data_get)
|
||||
self.tree.connect('drag_data_received', self.drag_data_received)
|
||||
if not self.dbstate.db.readonly:
|
||||
self.tree.connect('drag_data_received', self.drag_data_received)
|
||||
|
||||
def drag_data_get(self, widget, context, sel_data, info, time):
|
||||
"""
|
||||
|
@ -93,10 +93,10 @@ class GalleryTab(ButtonTab):
|
||||
|
||||
def right_click(self, obj, event):
|
||||
itemlist = [
|
||||
(True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(False, _('Share'), self.edit_button_clicked),
|
||||
(True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, False, _('Share'), self.edit_button_clicked),
|
||||
(False,True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
]
|
||||
|
||||
menu = gtk.Menu()
|
||||
@ -115,12 +115,14 @@ class GalleryTab(ButtonTab):
|
||||
item.show()
|
||||
menu.append(item)
|
||||
|
||||
for (image, title, func) in itemlist:
|
||||
for (needs_write_access, image, title, func) in itemlist:
|
||||
if image:
|
||||
item = gtk.ImageMenuItem(stock_id=title)
|
||||
else:
|
||||
item = gtk.MenuItem(title)
|
||||
item.connect('activate', func)
|
||||
if needs_write_access and self.dbstate.db.readonly:
|
||||
item.set_sensitive(False)
|
||||
item.show()
|
||||
menu.append(item)
|
||||
menu.popup(None, None, None, event.button, event.time)
|
||||
@ -284,7 +286,8 @@ class GalleryTab(ButtonTab):
|
||||
[self._DND_TYPE.target()],
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.iconlist.connect('drag_data_get', self.drag_data_get)
|
||||
self.iconlist.connect('drag_data_received', self.drag_data_received)
|
||||
if not self.dbstate.db.readonly:
|
||||
self.iconlist.connect('drag_data_received', self.drag_data_received)
|
||||
|
||||
def drag_data_get(self, widget, context, sel_data, info, time):
|
||||
"""
|
||||
@ -435,4 +438,3 @@ class GalleryTab(ButtonTab):
|
||||
returns the index of the object within the associated data
|
||||
"""
|
||||
return self.get_data().index(obj)
|
||||
|
||||
|
@ -76,10 +76,10 @@ class NameEmbedList(EmbeddedList):
|
||||
|
||||
def get_popup_menu_items(self):
|
||||
return [
|
||||
(True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(False, _('Set as default name'), self.name_button_clicked),
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(False,True, gtk.STOCK_EDIT, self.edit_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(True, False, _('Set as default name'), self.name_button_clicked),
|
||||
]
|
||||
|
||||
def name_button_clicked(self, obj):
|
||||
|
@ -134,6 +134,7 @@ class EditEventRef(EditReference):
|
||||
self.top.get_widget("eer_type_combo"),
|
||||
self.source.set_type,
|
||||
self.source.get_type,
|
||||
self.db.readonly,
|
||||
custom_values=self.get_custom_events())
|
||||
|
||||
date_entry = self.top.get_widget("eer_date")
|
||||
|
@ -118,11 +118,11 @@ class ChildEmbedList(EmbeddedList):
|
||||
|
||||
def get_popup_menu_items(self):
|
||||
return [
|
||||
(True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(False, _('Share'), self.edit_button_clicked),
|
||||
(True, _('Edit relationship'), self.edit_button_clicked),
|
||||
(True, _('Edit child'), self.edit_child_button_clicked),
|
||||
(True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, False, _('Share'), self.edit_button_clicked),
|
||||
(False,True, _('Edit relationship'), self.edit_button_clicked),
|
||||
(False,True, _('Edit child'), self.edit_child_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
]
|
||||
|
||||
def find_index(self,obj):
|
||||
|
@ -92,6 +92,11 @@ class EditMediaRef(EditReference):
|
||||
self.top.get_widget("uppery").set_value(coord[1])
|
||||
self.top.get_widget("lowerx").set_value(coord[2])
|
||||
self.top.get_widget("lowery").set_value(coord[3])
|
||||
if self.dbstate.db.readonly:
|
||||
self.top.get_widget("upperx").set_sensitive(False)
|
||||
self.top.get_widget("uppery").set_sensitive(False)
|
||||
self.top.get_widget("lowerx").set_sensitive(False)
|
||||
self.top.get_widget("lowery").set_sensitive(False)
|
||||
|
||||
self.descr_window = MonitoredEntry(
|
||||
self.top.get_widget("description"),
|
||||
|
@ -78,14 +78,16 @@ class EditRepoRef(EditReference):
|
||||
|
||||
def _setup_fields(self):
|
||||
self.callno = MonitoredEntry(
|
||||
self.top.get_widget("call_number"), self.source_ref.set_call_number,
|
||||
self.source_ref.get_call_number, False)
|
||||
self.top.get_widget("call_number"),
|
||||
self.source_ref.set_call_number,
|
||||
self.source_ref.get_call_number,
|
||||
self.db.readonly)
|
||||
|
||||
self.gid = MonitoredEntry(
|
||||
self.top.get_widget('gid'),
|
||||
self.source.set_gramps_id,
|
||||
self.source.get_gramps_id,
|
||||
False)
|
||||
self.db.readonly)
|
||||
|
||||
self.privacy = PrivacyButton(
|
||||
self.top.get_widget("private"),
|
||||
@ -96,7 +98,7 @@ class EditRepoRef(EditReference):
|
||||
self.top.get_widget('repo_name'),
|
||||
self.source.set_name,
|
||||
self.source.get_name,
|
||||
False)
|
||||
self.db.readonly)
|
||||
|
||||
self.type_selector = MonitoredDataType(
|
||||
self.top.get_widget("media_type"),
|
||||
@ -172,4 +174,3 @@ class EditRepoRef(EditReference):
|
||||
self.update((self.source_ref,self.source))
|
||||
|
||||
self.close()
|
||||
|
||||
|
@ -89,11 +89,11 @@ class EditSourceRef(EditReference):
|
||||
|
||||
self.volume = MonitoredEntry(
|
||||
self.top.get_widget("volume"), self.source_ref.set_page,
|
||||
self.source_ref.get_page, False)
|
||||
self.source_ref.get_page, self.db.readonly)
|
||||
|
||||
self.gid = MonitoredEntry(
|
||||
self.top.get_widget('gid'), self.source.set_gramps_id,
|
||||
self.source.get_gramps_id,False)
|
||||
self.source.get_gramps_id,self.db.readonly)
|
||||
|
||||
self.source_privacy = PrivacyButton(
|
||||
self.top.get_widget("private"),
|
||||
@ -101,19 +101,19 @@ class EditSourceRef(EditReference):
|
||||
|
||||
self.title = MonitoredEntry(
|
||||
self.top.get_widget('title'), self.source.set_title,
|
||||
self.source.get_title,False)
|
||||
self.source.get_title,self.db.readonly)
|
||||
|
||||
self.abbrev = MonitoredEntry(
|
||||
self.top.get_widget('abbrev'), self.source.set_abbreviation,
|
||||
self.source.get_abbreviation,False)
|
||||
self.source.get_abbreviation,self.db.readonly)
|
||||
|
||||
self.author = MonitoredEntry(
|
||||
self.top.get_widget('author'), self.source.set_author,
|
||||
self.source.get_author,False)
|
||||
self.source.get_author,self.db.readonly)
|
||||
|
||||
self.pubinfo = MonitoredEntry(
|
||||
self.top.get_widget('pub_info'), self.source.set_publication_info,
|
||||
self.source.get_publication_info,False)
|
||||
self.source.get_publication_info,self.db.readonly)
|
||||
|
||||
self.type_mon = MonitoredMenu(
|
||||
self.top.get_widget('confidence'),
|
||||
@ -123,7 +123,8 @@ class EditSourceRef(EditReference):
|
||||
(_('Low'), RelLib.SourceRef.CONF_LOW),
|
||||
(_('Normal'), RelLib.SourceRef.CONF_NORMAL),
|
||||
(_('High'), RelLib.SourceRef.CONF_HIGH),
|
||||
(_('Very High'), RelLib.SourceRef.CONF_VERY_HIGH)])
|
||||
(_('Very High'), RelLib.SourceRef.CONF_VERY_HIGH)],
|
||||
self.db.readonly)
|
||||
|
||||
self.date = MonitoredDate(
|
||||
self.top.get_widget("date"),
|
||||
|
@ -92,7 +92,7 @@ class EditUrl(EditSecondary):
|
||||
self.top.get_widget("type"),
|
||||
self.obj.set_type,
|
||||
self.obj.get_type,
|
||||
)
|
||||
self.db.readonly)
|
||||
|
||||
def build_menu_names(self,obj):
|
||||
etitle =_('Internet Address Editor')
|
||||
|
Loading…
Reference in New Issue
Block a user