diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 132a21938..e57e9d363 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2005-08-25 Martin Hawlisch + * src/gramps_main.py: pass DisplayState to TipOfDay + * src/TipOfDay.py: Use DisplayState + * src/const.py.in: add GRAMPS websites + * src/ViewManager.py: Add TipOfDay; Make GRAMPS websites work again + 2005-08-19 Don Allingham * src/DisplayState.py: fixe some window management syntax errros * src/PageView.py: enable double click to edit diff --git a/gramps2/src/TipOfDay.py b/gramps2/src/TipOfDay.py index 20c11538a..8cb42c1d5 100644 --- a/gramps2/src/TipOfDay.py +++ b/gramps2/src/TipOfDay.py @@ -51,7 +51,7 @@ import GrampsKeys # #------------------------------------------------------------------------- class TipOfDay: - def __init__(self,parent): + def __init__(self,uistate): xml = gtk.glade.XML(const.gladeFile, "tod", "gramps") top = xml.get_widget("tod") tip = xml.get_widget("tip") @@ -64,7 +64,7 @@ class TipOfDay: new_index = range(len(tip_list)) Random().shuffle(new_index) - top.set_transient_for(parent.topWindow) + top.set_transient_for(uistate.window) index = 0 rval = 0 diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index f37d0b46f..6d6ea5927 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -35,6 +35,7 @@ import os # #------------------------------------------------------------------------- import gtk +import gnome try: from gnomevfs import get_mime_type except: @@ -61,6 +62,7 @@ import Utils import QuestionDialog import PageView import Navigation +import TipOfDay #------------------------------------------------------------------------- # @@ -119,6 +121,7 @@ uidefault = ''' + @@ -232,6 +235,7 @@ class ViewManager: ('About', gtk.STOCK_ABOUT, '_About', None, None, self.about), ('FAQ', None, '_FAQ', None, None, self.faq_activate), ('UserManual', gtk.STOCK_HELP, '_User Manual', 'F1', None, self.manual_activate), + ('TipOfDay', None, 'Tip of the day', None, None, self.tip_of_day_activate), ]) self.actiongroup.add_actions([ @@ -267,13 +271,13 @@ class ViewManager: self.uimanager.insert_action_group(self.actiongroup,1) def home_page_activate(self,obj): - gnome.url_show(_HOMEPAGE) + gnome.url_show( const.url_homepage) def mailing_lists_activate(self,obj): - gnome.url_show(_MAILLIST) + gnome.url_show( const.url_mailinglist) def report_bug_activate(self,obj): - gnome.url_show(_BUGREPORT) + gnome.url_show( const.url_bugtracker) def manual_activate(self,obj): """Display the GRAMPS manual""" @@ -289,6 +293,10 @@ class ViewManager: except gobject.GError, msg: ErrorDialog(_("Could not open help"),str(msg)) + def tip_of_day_activate(self,obj): + """Display Tip of the day""" + TipOfDay.TipOfDay(self.uistate) + def about(self,obj): about = gtk.AboutDialog() about.set_name(const.program_name) diff --git a/gramps2/src/const.py.in b/gramps2/src/const.py.in index 62c4b7e5e..084c96c43 100644 --- a/gramps2/src/const.py.in +++ b/gramps2/src/const.py.in @@ -22,6 +22,15 @@ # $Id$ +#------------------------------------------------------------------------- +# +# Standard GRAMPS Websites +# +#------------------------------------------------------------------------- +url_homepage = "http://gramps-project.org/" +url_mailinglist = "http://sourceforge.net/mail/?group_id=25770" +url_burtracker = "http://sourceforge.net/tracker/?group_id=25770&atid=385137" + #------------------------------------------------------------------------- # # Standard python modules diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 988b27053..4fe3b60a7 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -190,7 +190,7 @@ class Gramps: # self.date_format_key_update) if GrampsKeys.get_usetips(): - TipOfDay.TipOfDay(self) + TipOfDay.TipOfDay(vm.uistate) ## # FIXME: THESE will have to be added (ViewManager?) ## # once bookmarks work again