* src/DataViews/_RelationshipView.py: Optionally hide Edit buttons
* src/Config/_GrampsConfigKeys.py: Optionally hide Edit buttons * src/GrampsWidgets.py: Allow empty button for LinkBox svn: r7581
This commit is contained in:
parent
f191497468
commit
aa5a41f5cc
@ -1,5 +1,8 @@
|
|||||||
2006-11-07 Don Allingham <don@gramps-project.org>
|
2006-11-07 Don Allingham <don@gramps-project.org>
|
||||||
* src/plugins/RemoveUnused.py: general cleanup
|
* src/plugins/RemoveUnused.py: general cleanup
|
||||||
|
* src/DataViews/_RelationshipView.py: Optionally hide Edit buttons
|
||||||
|
* src/Config/_GrampsConfigKeys.py: Optionally hide Edit buttons
|
||||||
|
* src/GrampsWidgets.py: Allow empty button for LinkBox
|
||||||
|
|
||||||
2006-11-07 Alex Roitman <shura@gramps-project.org>
|
2006-11-07 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/DataViews/_RelationView.py (info_string): Add missing clause.
|
* src/DataViews/_RelationView.py (info_string): Add missing clause.
|
||||||
|
@ -75,9 +75,11 @@ SIDEBAR_TEXT = ('interface','sidebar-text', 0)
|
|||||||
WEBSITE_DIRECTORY = ('paths','website-directory', 2)
|
WEBSITE_DIRECTORY = ('paths','website-directory', 2)
|
||||||
PORT_WARN = ('preferences','port-warn', 0)
|
PORT_WARN = ('preferences','port-warn', 0)
|
||||||
TRANSACTIONS = ('behavior','transactions', 0)
|
TRANSACTIONS = ('behavior','transactions', 0)
|
||||||
|
RELEDITBTN = ('interface','editbutton', 1)
|
||||||
|
|
||||||
|
|
||||||
default_value = {
|
default_value = {
|
||||||
|
RELEDITBTN : False,
|
||||||
DEFAULT_SOURCE : False,
|
DEFAULT_SOURCE : False,
|
||||||
RELATION_SHADE : True,
|
RELATION_SHADE : True,
|
||||||
ONLINE_MAPS : False,
|
ONLINE_MAPS : False,
|
||||||
|
@ -339,7 +339,6 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.attach = AttachList()
|
self.attach = AttachList()
|
||||||
self.row = 1
|
self.row = 1
|
||||||
|
|
||||||
|
|
||||||
family_handle_list = person.get_parent_family_handle_list()
|
family_handle_list = person.get_parent_family_handle_list()
|
||||||
|
|
||||||
sensitive = len(family_handle_list)> 1
|
sensitive = len(family_handle_list)> 1
|
||||||
@ -419,7 +418,10 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
fmt = '<span size="larger" weight="bold">%s</span>'
|
fmt = '<span size="larger" weight="bold">%s</span>'
|
||||||
text = fmt % cgi.escape(name)
|
text = fmt % cgi.escape(name)
|
||||||
label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender])
|
label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender])
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press,person.handle)
|
if Config.get(Config.RELEDITBTN):
|
||||||
|
button = GrampsWidgets.IconButton(self.edit_button_press,person.handle)
|
||||||
|
else:
|
||||||
|
button = None
|
||||||
hbox = GrampsWidgets.LinkBox(label, button)
|
hbox = GrampsWidgets.LinkBox(label, button)
|
||||||
|
|
||||||
table.attach(hbox, 0, 2, 0, 1)
|
table.attach(hbox, 0, 2, 0, 1)
|
||||||
@ -623,14 +625,13 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
child_list = [ref.ref for ref in family.get_child_ref_list()\
|
child_list = [ref.ref for ref in family.get_child_ref_list()\
|
||||||
if ref.ref != active]
|
if ref.ref != active]
|
||||||
|
|
||||||
label = _("Siblings")
|
|
||||||
if child_list:
|
if child_list:
|
||||||
eventbox = gtk.EventBox()
|
eventbox = gtk.EventBox()
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
eventbox.modify_bg(gtk.STATE_NORMAL, self.color)
|
eventbox.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
vbox = gtk.VBox()
|
vbox = gtk.VBox()
|
||||||
label_cell = self.build_label_cell(_('Siblings'))
|
label_cell = self.build_label_cell(_('Siblings'))
|
||||||
label_cell.set_alignment(0,0)
|
label_cell.set_alignment(0, 0)
|
||||||
self.attach.attach(
|
self.attach.attach(
|
||||||
label_cell, _CLABEL_START, _CLABEL_STOP, self.row,
|
label_cell, _CLABEL_START, _CLABEL_STOP, self.row,
|
||||||
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
||||||
@ -656,7 +657,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
label = GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
label = GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
||||||
label.set_alignment(0,0)
|
label.set_alignment(0,0)
|
||||||
label.set_padding(0,5)
|
if Config.get(Config.RELEDITBTN):
|
||||||
|
label.set_padding(0,5)
|
||||||
self.attach.attach(label, _PLABEL_START, _PLABEL_STOP, self.row,
|
self.attach.attach(label, _PLABEL_START, _PLABEL_STOP, self.row,
|
||||||
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
||||||
yoptions=gtk.FILL|gtk.SHRINK)
|
yoptions=gtk.FILL|gtk.SHRINK)
|
||||||
@ -668,7 +670,10 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.button_press, handle)
|
self.button_press, handle)
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
if Config.get(Config.RELEDITBTN):
|
||||||
|
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
||||||
|
else:
|
||||||
|
button = None
|
||||||
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button))
|
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button))
|
||||||
else:
|
else:
|
||||||
link_label = gtk.Label(_('Unknown'))
|
link_label = gtk.Label(_('Unknown'))
|
||||||
@ -698,7 +703,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
format = "%s"
|
format = "%s"
|
||||||
|
|
||||||
lbl = GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
lbl = GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
||||||
lbl.set_padding(0,5)
|
if Config.get(Config.RELEDITBTN):
|
||||||
|
lbl.set_padding(0,5)
|
||||||
return lbl
|
return lbl
|
||||||
|
|
||||||
def write_child(self, vbox, handle, index):
|
def write_child(self, vbox, handle, index):
|
||||||
@ -707,7 +713,10 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
link_label.set_padding(3, 0)
|
link_label.set_padding(3, 0)
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
if Config.get(Config.RELEDITBTN):
|
||||||
|
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
||||||
|
else:
|
||||||
|
button = None
|
||||||
|
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
hbox.pack_start(GrampsWidgets.BasicLabel("%d." % index),
|
hbox.pack_start(GrampsWidgets.BasicLabel("%d." % index),
|
||||||
|
@ -500,12 +500,12 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
|
|||||||
2, Config.SPELLCHECK)
|
2, Config.SPELLCHECK)
|
||||||
self.add_checkbox(table, _('Display Tip of the Day'),
|
self.add_checkbox(table, _('Display Tip of the Day'),
|
||||||
3, Config.USE_TIPS)
|
3, Config.USE_TIPS)
|
||||||
# self.add_checkbox(table, _('Download maps online'),
|
|
||||||
# 4, Config.ONLINE_MAPS)
|
|
||||||
self.add_checkbox(table, _('Use shading in Relationship View'),
|
self.add_checkbox(table, _('Use shading in Relationship View'),
|
||||||
4, Config.RELATION_SHADE)
|
4, Config.RELATION_SHADE)
|
||||||
self.add_checkbox(table, _('Enable database transactions'),
|
self.add_checkbox(table, _('Enable database transactions'),
|
||||||
5, Config.TRANSACTIONS)
|
5, Config.TRANSACTIONS)
|
||||||
|
self.add_checkbox(table, _('Display edit buttons on Relationship View'),
|
||||||
|
6, Config.RELEDITBTN)
|
||||||
|
|
||||||
return table
|
return table
|
||||||
|
|
||||||
|
@ -140,7 +140,8 @@ class LinkBox(gtk.HBox):
|
|||||||
gtk.HBox.__init__(self)
|
gtk.HBox.__init__(self)
|
||||||
self.set_spacing(6)
|
self.set_spacing(6)
|
||||||
self.pack_start(link, False)
|
self.pack_start(link, False)
|
||||||
self.pack_start(button, False)
|
if button:
|
||||||
|
self.pack_start(button, False)
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
class EditLabel(gtk.HBox):
|
class EditLabel(gtk.HBox):
|
||||||
|
@ -638,7 +638,8 @@ class ListView(BookMarkView):
|
|||||||
self.selection.select_path(path)
|
self.selection.select_path(path)
|
||||||
self.list.scroll_to_cell(path,None,1,0.5,0)
|
self.list.scroll_to_cell(path,None,1,0.5,0)
|
||||||
for i in xrange(len(self.columns)):
|
for i in xrange(len(self.columns)):
|
||||||
self.columns[i].set_sort_indicator(i==self.sort_col)
|
enable_sort_flag = (i==self.sort_col)
|
||||||
|
self.columns[i].set_sort_indicator(enable_sort_flag)
|
||||||
self.columns[self.sort_col].set_sort_order(order)
|
self.columns[self.sort_col].set_sort_order(order)
|
||||||
|
|
||||||
def build_columns(self):
|
def build_columns(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user