From 951ac300efe55e944144a8d93f76f913c7049a88 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 27 Apr 2006 20:36:32 +0000 Subject: [PATCH] * src/TipOfDay.py (TipOfDay.__init__): switch to ManagedWindow svn: r6471 --- gramps2/ChangeLog | 1 + gramps2/src/TipOfDay.py | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index a6da94400..8e9e77b18 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2006-04-27 Don Allingham + * src/TipOfDay.py (TipOfDay.__init__): switch to ManagedWindow * src/Editors/_EditFamily.py: provide add new parent option * src/Editors/_EditEvent.py: used set_window * src/glade/gramps.glade: add new buttons for add new parent diff --git a/gramps2/src/TipOfDay.py b/gramps2/src/TipOfDay.py index 2fb302f42..981a58892 100644 --- a/gramps2/src/TipOfDay.py +++ b/gramps2/src/TipOfDay.py @@ -46,25 +46,30 @@ import gtk.glade import const import Config import Utils +import ManagedWindow #------------------------------------------------------------------------- # # Tip Display class # #------------------------------------------------------------------------- -class TipOfDay: +class TipOfDay(ManagedWindow.ManagedWindow): def __init__(self,uistate): + + ManagedWindow.ManagedWindow.__init__(self, uistate, [], self) + xml = gtk.glade.XML(const.gladeFile, "tod", "gramps") - top = xml.get_widget("tod") + + self.set_window(xml.get_widget("tod"), + xml.get_widget("title"), + _("Tip of the Day"), + _("Tip of the Day")) + tip = xml.get_widget("tip") use = xml.get_widget('usetips') image = xml.get_widget('image') image.set_from_file(os.path.join(const.image_dir,'splash.jpg')) - alt_title = xml.get_widget("title") - tmsg = _("GRAMPS' Tip of the Day") - Utils.set_titles(top, alt_title, tmsg, _("Tip of the Day")) - tp = TipParser() tip_list = tp.get() use.set_active(Config.get(Config.USE_TIPS)) @@ -72,21 +77,22 @@ class TipOfDay: new_index = range(len(tip_list)) Random().shuffle(new_index) - top.set_transient_for(uistate.window) - index = 0 rval = 0 while rval == 0: tip.set_text(_(tip_list[new_index[index]])) tip.set_use_markup(1) - rval = top.run() + rval = self.window.run() if index >= len(tip_list)-1: index = 0 else: index += 1 Config.set(Config.USE_TIPS,use.get_active()) - top.destroy() + self.close() + + def build_menu_names(self,obj): + return (_("Tip of the Day"), None) #------------------------------------------------------------------------- #