diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f5436c16f..2abbc5a60 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,12 @@ +2003-11-13 Alex Roitman + * 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 * src/FamilyView.py: Change column sizes on the FamilyView to fit with the new column @@ -18,12 +27,12 @@ * src/Marriage.py (__init__): Find soucre label from XML; (on_switch_page): Add function. * 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/EventEdit.py: (__init__): Find soucre label from XML; + * src/EventEdit.py: (__init__): Find labels from XML; (on_switch_page): Add function. * 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. 2003-11-12 Tim Waugh diff --git a/gramps2/src/ImageSelect.py b/gramps2/src/ImageSelect.py index b54d54492..f6f4216c6 100644 --- a/gramps2/src/ImageSelect.py +++ b/gramps2/src/ImageSelect.py @@ -779,6 +779,10 @@ class GlobalMediaProperties: 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)] 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.notes.get_buffer().set_text(self.object.getNote()) + if self.object.getNote(): + Utils.bold_label(self.notes_label) + self.change_dialog.signal_autoconnect({ "on_cancel_clicked" : Utils.destroy_passed_object, "on_up_clicked" : self.on_up_clicked, @@ -810,6 +817,7 @@ class GlobalMediaProperties: "on_update_attr_clicked" : self.on_update_attr_clicked, }) self.redraw_attr_list() + self.display_refs() def on_up_clicked(self,obj): store,iter = self.atree.get_selected() @@ -851,6 +859,11 @@ class GlobalMediaProperties: d = [attr.getType(),attr.getValue()] iter = self.atree.add(d,attr) 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): store,iter = self.refmodel.selection.get_selected() @@ -865,29 +878,44 @@ class GlobalMediaProperties: titles = [(_('Type'),0,150),(_('ID'),1,75),(_('Value'),2,100)] self.refmodel = ListModel.ListModel(self.change_dialog.get_widget("refinfo"), titles,event_func=self.button_press) + any = 0 for key in self.db.getPersonKeys(): p = self.db.getPerson(key) for o in p.getPhotoList(): if o.getReference() == self.object: self.refmodel.add([_("Person"),p.getId(),GrampsCfg.nameof(p)]) + any = 1 for p in self.db.getFamilyMap().values(): for o in p.getPhotoList(): if o.getReference() == self.object: self.refmodel.add([_("Family"),p.getId(),Utils.family_name(p)]) + any = 1 for key in self.db.getSourceKeys(): p = self.db.getSource(key) for o in p.getPhotoList(): if o.getReference() == self.object: self.refmodel.add([_("Source"),p.getId(),p.getTitle()]) + any = 1 for key in self.db.getPlaceKeys(): p = self.db.getPlace(key) for o in p.getPhotoList(): if o.getReference() == self.object: 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): if page == 3: 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): t = self.notes.get_buffer() diff --git a/gramps2/src/docgen/HtmlDoc.py b/gramps2/src/docgen/HtmlDoc.py index 9b0733436..3ea64d77b 100644 --- a/gramps2/src/docgen/HtmlDoc.py +++ b/gramps2/src/docgen/HtmlDoc.py @@ -18,6 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + import os import string import re @@ -427,6 +429,12 @@ class HtmlDoc(BaseDoc.BaseDoc): self.empty = 0 self.f.write('

\n') + def start_bold(self): + self.f.write('') + + def end_bold(self): + self.f.write('') + def write_text(self,text): text = string.replace(text,'&','&'); # Must be first text = string.replace(text,'<','<'); diff --git a/gramps2/src/imagesel.glade b/gramps2/src/imagesel.glade index 21007e93c..1be728ef6 100644 --- a/gramps2/src/imagesel.glade +++ b/gramps2/src/imagesel.glade @@ -1838,11 +1838,11 @@ - + True - <b>Attributes</b> + Attributes False - True + False GTK_JUSTIFY_CENTER False False @@ -1889,11 +1889,11 @@ - + True - <b>Notes</b> + Notes False - True + False GTK_JUSTIFY_CENTER False False @@ -1933,11 +1933,11 @@ - + True - <b>References</b> + References False - True + False GTK_JUSTIFY_CENTER False False