* src/ImageSelect.py (GlobalMediaProperties.__init__): Find labels from

XML; (redraw_attr_list): Change attribute label; (display_refs): Change
references label; (on_notebook_switch_page): change notes label.
* src/imagesel.glade: Set meaningful label ids, remove bold markup.

* src/docgen/HtmlDoc.py (start_bold, end_bold): Add functions (closes
bug #841277).

* src/EditSource.py (__init__): Find labels from XML.
* src/EventEdit.py: (__init__): Find labels from XML;
* src/NameEdit.py: (__init__): Find labels from XML;


svn: r2330
This commit is contained in:
Alex Roitman 2003-11-13 18:50:01 +00:00
parent 5a64444135
commit 80297accda
4 changed files with 57 additions and 12 deletions

View File

@ -1,3 +1,12 @@
2003-11-13 Alex Roitman <shura@alex.neuro.umn.edu>
* src/ImageSelect.py (GlobalMediaProperties.__init__): Find labels from
XML; (redraw_attr_list): Change attribute label; (display_refs): Change
references label; (on_notebook_switch_page): change notes label.
* src/imagesel.glade: Set meaningful label ids, remove bold markup.
* src/docgen/HtmlDoc.py (start_bold, end_bold): Add functions (closes
bug #841277).
2003-11-12 Don Allingham <dallingham@users.sourceforge.net> 2003-11-12 Don Allingham <dallingham@users.sourceforge.net>
* src/FamilyView.py: Change column sizes on the FamilyView to * src/FamilyView.py: Change column sizes on the FamilyView to
fit with the new column fit with the new column
@ -18,12 +27,12 @@
* src/Marriage.py (__init__): Find soucre label from XML; * src/Marriage.py (__init__): Find soucre label from XML;
(on_switch_page): Add function. (on_switch_page): Add function.
* src/marriage.glade: Set meaningful label ids, remove bold markup. * src/marriage.glade: Set meaningful label ids, remove bold markup.
* src/EditSource.py (__init__): Find soucre label from XML. * src/EditSource.py (__init__): Find labels from XML.
* src/gramps.glade: Set meaningful label ids, remove bold markup. * src/gramps.glade: Set meaningful label ids, remove bold markup.
* src/EventEdit.py: (__init__): Find soucre label from XML; * src/EventEdit.py: (__init__): Find labels from XML;
(on_switch_page): Add function. (on_switch_page): Add function.
* src/Witness.py (WitnessTab.redraw): Change label upon redraw. * src/Witness.py (WitnessTab.redraw): Change label upon redraw.
* src/NameEdit.py: (__init__): Find soucre label from XML; * src/NameEdit.py: (__init__): Find labels from XML;
(on_switch_page): Add function. (on_switch_page): Add function.
2003-11-12 Tim Waugh <twaugh@redhat.com> 2003-11-12 Tim Waugh <twaugh@redhat.com>

View File

@ -779,6 +779,10 @@ class GlobalMediaProperties:
self.attr_list = self.change_dialog.get_widget("attr_list") self.attr_list = self.change_dialog.get_widget("attr_list")
self.attr_label = self.change_dialog.get_widget("attrGlobal")
self.notes_label = self.change_dialog.get_widget("notesGlobal")
self.refs_label = self.change_dialog.get_widget("refsGlobal")
titles = [(_('Attribute'),0,150),(_('Value'),1,100)] titles = [(_('Attribute'),0,150),(_('Value'),1,100)]
self.atree = ListModel.ListModel(self.attr_list,titles, self.atree = ListModel.ListModel(self.attr_list,titles,
@ -797,6 +801,9 @@ class GlobalMediaProperties:
self.change_dialog.get_widget("type").set_text(Utils.get_mime_description(mtype)) self.change_dialog.get_widget("type").set_text(Utils.get_mime_description(mtype))
self.notes.get_buffer().set_text(self.object.getNote()) self.notes.get_buffer().set_text(self.object.getNote())
if self.object.getNote():
Utils.bold_label(self.notes_label)
self.change_dialog.signal_autoconnect({ self.change_dialog.signal_autoconnect({
"on_cancel_clicked" : Utils.destroy_passed_object, "on_cancel_clicked" : Utils.destroy_passed_object,
"on_up_clicked" : self.on_up_clicked, "on_up_clicked" : self.on_up_clicked,
@ -810,6 +817,7 @@ class GlobalMediaProperties:
"on_update_attr_clicked" : self.on_update_attr_clicked, "on_update_attr_clicked" : self.on_update_attr_clicked,
}) })
self.redraw_attr_list() self.redraw_attr_list()
self.display_refs()
def on_up_clicked(self,obj): def on_up_clicked(self,obj):
store,iter = self.atree.get_selected() store,iter = self.atree.get_selected()
@ -851,6 +859,11 @@ class GlobalMediaProperties:
d = [attr.getType(),attr.getValue()] d = [attr.getType(),attr.getValue()]
iter = self.atree.add(d,attr) iter = self.atree.add(d,attr)
self.amap[str(attr)] = iter self.amap[str(attr)] = iter
if self.alist:
Utils.bold_label(self.attr_label)
else:
Utils.unbold_label(self.attr_label)
def button_press(self,obj): def button_press(self,obj):
store,iter = self.refmodel.selection.get_selected() store,iter = self.refmodel.selection.get_selected()
@ -865,29 +878,44 @@ class GlobalMediaProperties:
titles = [(_('Type'),0,150),(_('ID'),1,75),(_('Value'),2,100)] titles = [(_('Type'),0,150),(_('ID'),1,75),(_('Value'),2,100)]
self.refmodel = ListModel.ListModel(self.change_dialog.get_widget("refinfo"), self.refmodel = ListModel.ListModel(self.change_dialog.get_widget("refinfo"),
titles,event_func=self.button_press) titles,event_func=self.button_press)
any = 0
for key in self.db.getPersonKeys(): for key in self.db.getPersonKeys():
p = self.db.getPerson(key) p = self.db.getPerson(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
self.refmodel.add([_("Person"),p.getId(),GrampsCfg.nameof(p)]) self.refmodel.add([_("Person"),p.getId(),GrampsCfg.nameof(p)])
any = 1
for p in self.db.getFamilyMap().values(): for p in self.db.getFamilyMap().values():
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
self.refmodel.add([_("Family"),p.getId(),Utils.family_name(p)]) self.refmodel.add([_("Family"),p.getId(),Utils.family_name(p)])
any = 1
for key in self.db.getSourceKeys(): for key in self.db.getSourceKeys():
p = self.db.getSource(key) p = self.db.getSource(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
self.refmodel.add([_("Source"),p.getId(),p.getTitle()]) self.refmodel.add([_("Source"),p.getId(),p.getTitle()])
any = 1
for key in self.db.getPlaceKeys(): for key in self.db.getPlaceKeys():
p = self.db.getPlace(key) p = self.db.getPlace(key)
for o in p.getPhotoList(): for o in p.getPhotoList():
if o.getReference() == self.object: if o.getReference() == self.object:
self.refmodel.add([_("Place"),p.getId(),p.get_title()]) self.refmodel.add([_("Place"),p.getId(),p.get_title()])
any = 1
if any:
Utils.bold_label(self.refs_label)
else:
Utils.unbold_label(self.refs_label)
def on_notebook_switch_page(self,obj,junk,page): def on_notebook_switch_page(self,obj,junk,page):
if page == 3: if page == 3:
self.display_refs() self.display_refs()
t = self.notes.get_buffer()
text = t.get_text(t.get_start_iter(),t.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)
def on_apply_clicked(self, obj): def on_apply_clicked(self, obj):
t = self.notes.get_buffer() t = self.notes.get_buffer()

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
import os import os
import string import string
import re import re
@ -427,6 +429,12 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.empty = 0 self.empty = 0
self.f.write('</p>\n') self.f.write('</p>\n')
def start_bold(self):
self.f.write('<b>')
def end_bold(self):
self.f.write('</b>')
def write_text(self,text): def write_text(self,text):
text = string.replace(text,'&','&amp;'); # Must be first text = string.replace(text,'&','&amp;'); # Must be first
text = string.replace(text,'<','&lt;'); text = string.replace(text,'<','&lt;');

View File

@ -1838,11 +1838,11 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label170"> <widget class="GtkLabel" id="attrGlobal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Attributes&lt;/b&gt;</property> <property name="label" translatable="yes">Attributes</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
@ -1889,11 +1889,11 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label171"> <widget class="GtkLabel" id="notesGlobal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Notes&lt;/b&gt;</property> <property name="label" translatable="yes">Notes</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
@ -1933,11 +1933,11 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label174"> <widget class="GtkLabel" id="refsGlobal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;References&lt;/b&gt;</property> <property name="label" translatable="yes">References</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>