diff --git a/ChangeLog b/ChangeLog index 70aea3ef7..0e3c6038b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-12 Don Allingham + * src/ViewManager.py: set up about box and other HELP menu items + * src/const.py.in: strings for about box + * Makefile.am: install COPYING file to provide text for GPL. + 2005-08-12 Martin Hawlisch * src/MapView.py: Dont fail if xearth is not installed diff --git a/Makefile.am b/Makefile.am index 380211133..09242749c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,11 @@ SUBDIRS = src doc example -EXTRA_DIST = autogen.sh gramps.spec.in gramps.spec COPYING-DOCS FAQ +EXTRA_DIST = autogen.sh gramps.spec.in gramps.spec COPYING-DOCS FAQ COPYING bin_SCRIPTS = gramps + +dist_pkgdata_DATA = COPYING + distuninstallcheck_listfiles = find . -type -f -print | grep -E -v '/(globs|magic|XMLnamespaces)' diff --git a/src/ViewManager.py b/src/ViewManager.py index d03f72561..2794e3436 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -117,6 +117,13 @@ uidefault = ''' + + + + + + + @@ -211,15 +218,20 @@ class ViewManager: self.fileactions = gtk.ActionGroup('FileWindow') self.fileactions.add_actions([ ('FileMenu', None, '_File'), - ('New', gtk.STOCK_NEW, '_New', "n", None, self.on_new_activate), + ('New', gtk.STOCK_NEW, '_New', "n", None, self.on_new_activate), ('Open', gtk.STOCK_OPEN, '_Open', "o", None, self.on_open_activate), ('OpenRecent', gtk.STOCK_OPEN, 'Open _Recent'), - ('Quit', gtk.STOCK_QUIT, '_Quit', 'q', None, gtk.main_quit), + ('Quit', gtk.STOCK_QUIT, '_Quit', "q", None, gtk.main_quit), ('ViewMenu', None, '_View'), ('Preferences',gtk.STOCK_PREFERENCES,'_Preferences'), ('ColumnEdit', gtk.STOCK_PROPERTIES, '_Column Editor'), ('HelpMenu', None, '_Help'), - ('About', gtk.STOCK_ABOUT, '_About'), + ('HomePage', None, _('GRAMPS _home page'), None, None, self.home_page_activate), + ('MailingLists',None, _('GRAMPS _mailing lists'), None, None, self.mailing_lists_activate), + ('ReportBug', None, _('_Report a bug'), None, None, self.report_bug_activate), + ('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), ]) self.actiongroup.add_actions([ @@ -254,6 +266,50 @@ class ViewManager: self.uimanager.insert_action_group(self.fileactions,1) self.uimanager.insert_action_group(self.actiongroup,1) + def home_page_activate(self,obj): + gnome.url_show(_HOMEPAGE) + + def mailing_lists_activate(self,obj): + gnome.url_show(_MAILLIST) + + def report_bug_activate(self,obj): + gnome.url_show(_BUGREPORT) + + def manual_activate(self,obj): + """Display the GRAMPS manual""" + try: + gnome.help_display('gramps-manual','index') + except gobject.GError, msg: + ErrorDialog(_("Could not open help"),str(msg)) + + def faq_activate(self,obj): + """Display FAQ""" + try: + gnome.help_display('gramps-manual','faq') + except gobject.GError, msg: + ErrorDialog(_("Could not open help"),str(msg)) + + def about(self,obj): + about = gtk.AboutDialog() + about.set_name(const.program_name) + about.set_version(const.version) + about.set_copyright(const.copyright) + try: + f = open(const.license,"r") + about.set_license(f.read().replace('\x0c','')) + f.close() + except: + pass + about.set_comments(const.comments) + about.set_website_label(_('GRAMPS Homepage')) + about.set_website('http://gramps-project.org') + about.set_authors(const.authors) + about.set_translator_credits(_(const.translators)) + about.set_documenters(const.documenters) + about.set_logo(gtk.gdk.pixbuf_new_from_file(const.splash)) + about.show() + about.run() + def sidebar_toggle(self,obj): if obj.get_active(): self.ebox.show() @@ -537,7 +593,7 @@ class ViewManager: 'to the selected file.')) try: - if self.load_database(filename,callback,mode=mode) == 1: + if self.load_database(filename,callback,mode=mode): if filename[-1] == '/': filename = filename[:-1] name = os.path.basename(filename) @@ -566,7 +622,7 @@ class ViewManager: #self.redo_callback(None) #self.goto_active_person() self.actiongroup.set_visible(True) - return 1 + return True def load_database(self,name,callback=None,mode="w"): @@ -606,13 +662,22 @@ class ViewManager: self.relationship = self.RelClass(self.state.db) self.state.emit("database-changed", (self.state.db,)) - #self.change_active_person(self.find_initial_person()) + self.state.change_active_person(self.find_initial_person()) #self.goto_active_person() #if callback: # callback(_('Setup complete')) #self.enable_buttons(True) - return 1 + return True + + def find_initial_person(self): + person = self.state.db.get_default_person() + if not person: + the_ids = self.state.db.get_person_handles(sort_handles=False) + if the_ids: + the_ids.sort() + person = self.state.db.get_person_from_handle(the_ids[0]) + return person def on_scratchpad(self,obj): import ScratchPad diff --git a/src/const.py.in b/src/const.py.in index 865944f77..62c4b7e5e 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -93,6 +93,8 @@ custom_filters = "~/.gramps/custom_filters.xml" report_options = "~/.gramps/report_options.xml" icon = "%s/gramps.png" % rootDir logo = "%s/logo.png" % rootDir +splash = "%s/splash.jpg" % rootDir +license = "%s/COPYING" % rootDir gladeFile = "%s/gramps.glade" % rootDir placesFile = "%s/gramps.glade" % rootDir imageselFile = "%s/gramps.glade" % rootDir @@ -126,7 +128,7 @@ dnd_images = 1 # About box information # #------------------------------------------------------------------------- -progName = "GRAMPS" +program_name = "GRAMPS" version = "@VERSIONSTRING@" copyright = unicode("© 2001-2005 Donald N. Allingham","iso-8859-1") comments = _("GRAMPS (Genealogical Research and Analysis "