From 4966e07594db78f23a0969f041b9652c2f9c9f7d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 3 Jan 2003 01:01:14 +0000 Subject: [PATCH] Double click merges svn: r1236 --- gramps/src/Date.py | 2 +- gramps/src/EditPlace.py | 10 ++++++++++ gramps/src/ImageSelect.py | 5 +++++ gramps/src/Sources.py | 13 ++++++++++++- gramps/src/WriteXML.py | 1 + gramps/src/const.py | 2 +- gramps/src/docgen/HtmlDoc.py | 2 +- gramps/src/imagesel.glade | 5 +++++ gramps/src/places.glade | 15 +++++++++++++++ gramps/src/plugins/WebPage.py | 19 +++++++++++++------ 10 files changed, 64 insertions(+), 10 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index f6a4f679c..1d7c79b4c 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -311,7 +311,7 @@ class Date: def isEmpty(self): s = self.start - return s.year==UNDEF and s.month==UNDEF and s.day==UNDEF + return s.year==UNDEF and s.month==UNDEF and s.day==UNDEF and not self.text def isValid(self): return self.range != -1 diff --git a/gramps/src/EditPlace.py b/gramps/src/EditPlace.py index 599667973..6f02de9de 100644 --- a/gramps/src/EditPlace.py +++ b/gramps/src/EditPlace.py @@ -138,6 +138,8 @@ class EditPlace: "on_web_list_select_row" : self.on_web_list_select_row, "on_web_go_clicked" : self.on_web_go_clicked, "on_loc_list_select_row" : self.on_loc_list_select_row, + "on_web_list_button_press" : self.web_list_double_click, + "on_loc_list_button_press" : self.loc_list_double_click, "on_apply_clicked" : self.on_place_apply_clicked }) @@ -299,6 +301,14 @@ class EditPlace: import LocEdit LocEdit.LocationEditor(self,None) + def web_list_double_click(self,obj,event): + if event.button == 1 and event.type == _2BUTTON_PRESS: + self.on_update_url_clicked(obj) + + def loc_list_double_click(self,obj,event): + if event.button == 1 and event.type == _2BUTTON_PRESS: + self.on_update_loc_clicked(obj) + def on_web_list_select_row(self,obj,row,b,c): url = obj.get_row_data(row) if url == None: diff --git a/gramps/src/ImageSelect.py b/gramps/src/ImageSelect.py index 3369e5b19..6caf66116 100644 --- a/gramps/src/ImageSelect.py +++ b/gramps/src/ImageSelect.py @@ -585,6 +585,7 @@ class GlobalMediaProperties: "on_apply_clicked" : self.on_apply_clicked, "on_attr_list_select_row": self.on_attr_list_select_row, "on_add_attr_clicked" : self.on_add_attr_clicked, + "on_attr_button_press" : self.attr_double_click, "on_notebook_switch_page": self.on_notebook_switch_page, "on_make_local_clicked" : self.on_make_local_clicked, "on_delete_attr_clicked" : self.on_delete_attr_clicked, @@ -592,6 +593,10 @@ class GlobalMediaProperties: }) self.redraw_attr_list() + def attr_double_click(self,obj,event): + if event.button == 1 and event.type == GDK._2BUTTON_PRESS: + self.on_update_attr_clicked(obj) + def on_up_clicked(self,obj): if len(obj.selection) == 0: return diff --git a/gramps/src/Sources.py b/gramps/src/Sources.py index e76010bd6..446c3fb94 100644 --- a/gramps/src/Sources.py +++ b/gramps/src/Sources.py @@ -23,6 +23,7 @@ # GTK/Gnome modules # #------------------------------------------------------------------------- +import GDK import gtk import libglade @@ -55,6 +56,7 @@ class SourceSelector: self.top.signal_autoconnect({ "destroy_passed_object" : Utils.destroy_passed_object, "on_add_src_clicked" : self.on_add_src_clicked, + "on_src_button_press" : self.src_double_click, "on_del_src_clicked" : self.on_del_src_clicked, "on_edit_src_clicked" : self.on_edit_src_clicked, "on_src_ok_clicked" : self.on_src_ok_clicked, @@ -67,6 +69,10 @@ class SourceSelector: self.srcsort = Sorter.Sorter(self.slist, slist_map, 'source') self.redraw() self.sourcesel.show() + + def src_double_click(self,obj,event): + if event.button == 1 and event.type == GDK._2BUTTON_PRESS: + self.on_edit_src_clicked(obj) def redraw(self): index = 0 @@ -128,6 +134,7 @@ class SourceTab: self.top.signal_autoconnect({ "destroy_passed_object" : Utils.destroy_passed_object, "on_add_src_clicked" : self.on_add_src_clicked, + "on_src_button_press" : self.src_double_click, "on_del_src_clicked" : self.on_del_src_clicked, "on_edit_src_clicked" : self.on_edit_src_clicked, }) @@ -137,6 +144,10 @@ class SourceTab: self.srcsort = Sorter.Sorter(self.slist, slist_map, 'source') self.redraw() + def src_double_click(self,obj,event): + if event.button == 1 and event.type == GDK._2BUTTON_PRESS: + self.on_edit_src_clicked(obj) + def redraw(self): index = 0 self.slist.freeze() @@ -298,7 +309,7 @@ class SourceEditor: id = obj.list.get_selection()[0].get_data("s") self.active_source = self.db.getSource(id) - if self.active_source == None: + if self.active_source != None: self.author_field.set_text(self.active_source.getAuthor()) self.pub_field.set_text(self.active_source.getPubInfo()) diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py index 3075b5b2d..2d3f74d83 100644 --- a/gramps/src/WriteXML.py +++ b/gramps/src/WriteXML.py @@ -451,6 +451,7 @@ class XmlWriter: def write_date(self,date,indent=1): sp = ' '*indent + if date.isEmpty(): return diff --git a/gramps/src/const.py b/gramps/src/const.py index fdccfc790..76137e910 100644 --- a/gramps/src/const.py +++ b/gramps/src/const.py @@ -92,7 +92,7 @@ startup = 1 # #------------------------------------------------------------------------- progName = "GRAMPS" -version = "0.8.0-pl4" +version = "0.8.1-1" copyright = "© 2001-2002 Donald N. Allingham" authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"] comments = _("GRAMPS (Genealogical Research and Analysis " diff --git a/gramps/src/docgen/HtmlDoc.py b/gramps/src/docgen/HtmlDoc.py index f129c90a6..2ccd29d06 100644 --- a/gramps/src/docgen/HtmlDoc.py +++ b/gramps/src/docgen/HtmlDoc.py @@ -548,7 +548,7 @@ class HtmlDoc(TextDoc): self.f.write('
\n') def show_link(self, text, href): - self.write_text(' %s ' % (href, text)) + self.f.write(' %s ' % (href, text)) #------------------------------------------------------------------------ # diff --git a/gramps/src/imagesel.glade b/gramps/src/imagesel.glade index a47fc5ef1..82e9f68c1 100644 --- a/gramps/src/imagesel.glade +++ b/gramps/src/imagesel.glade @@ -2177,6 +2177,11 @@ on_attr_list_select_row Tue, 01 May 2001 17:24:40 GMT + + button_press_event + on_attr_button_press + Thu, 14 Nov 2002 20:51:00 GMT + 3 200,250,50 GTK_SELECTION_SINGLE diff --git a/gramps/src/places.glade b/gramps/src/places.glade index ecef5d40f..8c6da0c44 100644 --- a/gramps/src/places.glade +++ b/gramps/src/places.glade @@ -1019,6 +1019,11 @@ on_loc_list_select_row Tue, 24 Apr 2001 14:12:50 GMT + + button_press_event + on_loc_list_button_press + Thu, 14 Nov 2002 20:51:00 GMT + 4 137,80,80,80 GTK_SELECTION_SINGLE @@ -1213,6 +1218,11 @@ 80,80 GTK_SELECTION_SINGLE True + + button_press_event + on_src_button_press + Thu, 14 Nov 2002 20:51:00 GMT + GTK_SHADOW_IN @@ -1798,6 +1808,11 @@ on_web_list_select_row Tue, 24 Apr 2001 14:12:50 GMT + + button_press_event + on_web_list_button_press + Thu, 14 Nov 2002 20:51:00 GMT + 2 273,80 GTK_SELECTION_SINGLE diff --git a/gramps/src/plugins/WebPage.py b/gramps/src/plugins/WebPage.py index 2d2f19996..1081918c0 100644 --- a/gramps/src/plugins/WebPage.py +++ b/gramps/src/plugins/WebPage.py @@ -70,6 +70,9 @@ class HtmlLinkDoc(HtmlDoc): def newline(self): self.f.write('
\n') + def write_raw(self,text): + self.f.write(text) + #------------------------------------------------------------------------ # # @@ -116,7 +119,9 @@ class IndividualPage: if sreflist: for sref in sreflist: self.doc.start_link("#s%d" % self.scnt) - self.doc.write_text("%d" % self.scnt) + self.doc.write_raw("") + self.doc.write_text("%d" % self.scnt) + self.doc.write_raw("") self.doc.end_link() self.scnt = self.scnt + 1 self.slist.append(sref) @@ -182,7 +187,9 @@ class IndividualPage: index = 1 for sref in self.slist: self.doc.start_paragraph("SourceParagraph") - self.doc.write_text('%d. ' % (index,index)) + self.doc.start_link("s%d" % index) + self.doc.write_text('%d. ' % index) + self.doc.end_link() index = index + 1 self.write_info(sref.getBase().getTitle()) self.write_info(sref.getBase().getAuthor()) @@ -700,8 +707,8 @@ class WebReport(Report): col_len = len(person_list) + len(a.keys()) col_len = col_len/2 - doc.write_text('') - doc.write_text('
') + doc.write_raw('') + doc.write_raw('
') last = '' end_col = 0 for person in person_list: @@ -716,7 +723,7 @@ class WebReport(Report): doc.write_text(name) doc.end_link() if col_len <= 0 and end_col == 0: - doc.write_text('') + doc.write_raw('') doc.start_paragraph('IndexLabel') doc.write_text(_("%s (continued)") % name[0]) doc.end_paragraph() @@ -724,7 +731,7 @@ class WebReport(Report): else: doc.newline() col_len = col_len - 1 - doc.write_text('
') + doc.write_raw('
') doc.close() doc.write_support_files()