From 313ff317070efb2e0e9c5d830c4409a2232560f7 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 23 Feb 2002 15:06:07 +0000 Subject: [PATCH] Debug information for dates and preferences svn: r794 --- gramps/src/Date.py | 3 ++- gramps/src/GrampsCfg.py | 28 +++++++++++++++++----------- gramps/src/RelLib.py | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index a4b2c50bb..e8d265c05 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -224,7 +224,8 @@ class Date: self.start.set(text) self.range = 0 except Date.Error: - self.range = -1 + if text != "": + self.range = -1 self.text = text def set_range(self,val): diff --git a/gramps/src/GrampsCfg.py b/gramps/src/GrampsCfg.py index b9e02f08a..e49c42f45 100644 --- a/gramps/src/GrampsCfg.py +++ b/gramps/src/GrampsCfg.py @@ -689,7 +689,7 @@ class GrampsPreferences: menu.set_active(lastnamegen) lastnamegen_obj.set_menu(menu) - menu = gtk.GtkMenu() + self.osubmenu = gtk.GtkMenu() choice = 0 index = 0 for name in Plugins.get_text_doc_list(): @@ -699,12 +699,12 @@ class GrampsPreferences: item.set_data(DATA,name) item.connect("activate", self.on_format_toggled) item.show() - menu.append(item) + self.osubmenu.append(item) index = index + 1 - menu.set_active(choice) - self.ofmt.set_menu(menu) + self.osubmenu.set_active(choice) + self.ofmt.set_menu(self.osubmenu) - menu = gtk.GtkMenu() + self.gsubmenu = gtk.GtkMenu() choice = 0 index = 0 for name in Plugins.get_draw_doc_list(): @@ -714,10 +714,10 @@ class GrampsPreferences: item.set_data(DATA,name) item.connect("activate", self.on_format_toggled) item.show() - menu.append(item) + self.gsubmenu.append(item) index = index + 1 - menu.set_active(choice) - self.gfmt.set_menu(menu) + self.gsubmenu.set_active(choice) + self.gfmt.set_menu(self.gsubmenu) date_option = self.top.get_widget("date_format") date_menu = gtk.GtkMenu() @@ -928,9 +928,15 @@ class GrampsPreferences: index_visible = self.top.get_widget("show_child_id").get_active() hide_altnames = self.top.get_widget("display_altnames").get_active() paper_obj = self.top.get_widget("paper_size").get_menu().get_active() - output_obj = self.ofmt.get_menu().get_active() - goutput_obj = self.gfmt.get_menu().get_active() - + + if self.osubmenu == None: + print "Warning! osubmenu is None" + if self.gsubmenu == None: + print "Warning! gsubmenu is None" + + output_obj = self.osubmenu.get_active() + goutput_obj = self.gsubmenu.get_active() + if self.top.get_widget("stat1").get_active(): status_bar = 0 elif self.top.get_widget("stat2").get_active(): diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py index df3b95b9f..20b23fafa 100644 --- a/gramps/src/RelLib.py +++ b/gramps/src/RelLib.py @@ -1178,7 +1178,7 @@ class Event(DataObj): self.setDate(date) def are_equal(self,other): - """returns 1 if the spdcified event is the same as the instance""" + """returns 1 if the specified event is the same as the instance""" if other == None: return 0 if (self.name != other.name or