diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ec81587df..4aea1df70 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,14 @@ 2006-05-07 Don Allingham + * src/DataViews/_MediaView.py: tool tips + * src/DataViews/_RepositoryView.py: tool tips + * src/DataViews/_SourceView.py: tool tips + * src/DataViews/_EventView.py: tool tips + * src/DataViews/_PedigreeView.py: tool tips + * src/DataViews/_PlaceView.py: tool tips + * src/DataViews/_PersonView.py: tool tips + * src/ViewManager.py: tool tips + * src/QuestionDialog.py: add info dialog + * src/PageView.py: tool tips * src/DataViews/_PersonView.py: rebuild tree on surname change, don't attempt to delete/insert, since this can cause things to hang. diff --git a/gramps2/data/gramps.schemas.in b/gramps2/data/gramps.schemas.in index 4723af470..7929dfbad 100644 --- a/gramps2/data/gramps.schemas.in +++ b/gramps2/data/gramps.schemas.in @@ -27,6 +27,18 @@ + + /schemas/apps/gramps/preferences/hide-ep-msg + /apps/gramps/preferences/hide-ep-msg + gramps + bool + 0 + + Display informational message when editing a person + If set to True, an informational dialog will be displayed whenever the user edits a person. + + + /schemas/apps/gramps/preferences/last-view /apps/gramps/preferences/last-view diff --git a/gramps2/src/Config/_GrampsConfigKeys.py b/gramps2/src/Config/_GrampsConfigKeys.py index 607dbaa97..4a6c85318 100644 --- a/gramps2/src/Config/_GrampsConfigKeys.py +++ b/gramps2/src/Config/_GrampsConfigKeys.py @@ -1,5 +1,6 @@ FAMILY_DETAILS = ('preferences','family-details', 0) FAMILY_WARN = ('preferences','family-warn', 0) +HIDE_EP_MSG = ('preferences','hide-ep-msg', 0) LAST_VIEW = ('preferences','last-view', 1) FAMILY_SIBLINGS = ('preferences','family-siblings', 0) AUTOLOAD = ('behavior','autoload', 0) @@ -50,6 +51,7 @@ WEBSITE_DIRECTORY = ('paths','website-directory', 2) default_value = { FAMILY_DETAILS : True, FAMILY_WARN : True, + HIDE_EP_MSG : False, LAST_VIEW : 0, FAMILY_SIBLINGS : True, AUTOLOAD : False, diff --git a/gramps2/src/DataViews/_EventView.py b/gramps2/src/DataViews/_EventView.py index 75456a567..3cb785acb 100644 --- a/gramps2/src/DataViews/_EventView.py +++ b/gramps2/src/DataViews/_EventView.py @@ -67,6 +67,11 @@ column_names = [ # #------------------------------------------------------------------------- class EventView(PageView.ListView): + + ADD_MSG = _("Add a new event") + EDIT_MSG = _("Edit the selected event") + DEL_MSG = _("Delete the selected event") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/DataViews/_FamilyList.py b/gramps2/src/DataViews/_FamilyList.py index 3737c1708..4d94e7663 100644 --- a/gramps2/src/DataViews/_FamilyList.py +++ b/gramps2/src/DataViews/_FamilyList.py @@ -61,6 +61,11 @@ column_names = [ # #------------------------------------------------------------------------- class FamilyListView(PageView.ListView): + + ADD_MSG = _("Add a new family") + EDIT_MSG = _("Edit the selected family") + DEL_MSG = _("Delete the selected family") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/DataViews/_MediaView.py b/gramps2/src/DataViews/_MediaView.py index 0d8d6f6a9..36f3a2c79 100644 --- a/gramps2/src/DataViews/_MediaView.py +++ b/gramps2/src/DataViews/_MediaView.py @@ -63,6 +63,11 @@ column_names = [ # #------------------------------------------------------------------------- class MediaView(PageView.ListView): + + ADD_MSG = _("Add a new media object") + EDIT_MSG = _("Edit the selected media object") + DEL_MSG = _("Delete the selected media object") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/DataViews/_PedigreeView.py b/gramps2/src/DataViews/_PedigreeView.py index fbc5211a7..247b77dec 100644 --- a/gramps2/src/DataViews/_PedigreeView.py +++ b/gramps2/src/DataViews/_PedigreeView.py @@ -525,7 +525,7 @@ class PedigreeView(PageView.PersonNavView): PageView.PersonNavView.define_actions(self) self.add_action('HomePerson',gtk.STOCK_HOME,_("_Home"), - callback=self.home) + tip=_("Go to the default person"), callback=self.home) def build_tree(self): """ diff --git a/gramps2/src/DataViews/_PersonView.py b/gramps2/src/DataViews/_PersonView.py index f148c15cc..4689e32ce 100644 --- a/gramps2/src/DataViews/_PersonView.py +++ b/gramps2/src/DataViews/_PersonView.py @@ -117,10 +117,11 @@ class PersonView(PageView.PersonNavView): PageView.PersonNavView.define_actions(self) self.add_action('Add', gtk.STOCK_ADD, _("_Add"), - callback=self.add) + tip=_("Add a new person"), callback=self.add) self.add_action('Edit', gtk.STOCK_EDIT, _("_Edit"), - callback=self.edit) + tip=_("Edit the selected person"), callback=self.edit) self.add_action('Remove', gtk.STOCK_REMOVE, _("_Remove"), + tip=_("Remove the selected person"), callback=self.remove) self.add_action('OpenAllNodes', None, _("Expand all nodes"), callback=self.open_all_nodes) @@ -129,8 +130,10 @@ class PersonView(PageView.PersonNavView): self.add_action('Jump', None, _("_Jump"), accel="j",callback=self.jumpto) - self.add_toggle_action('Filter', None, _('_Show filter sidebar'), None, None, + self.add_toggle_action('Filter', None, _('_Show filter sidebar'), + None, None, self.filter_toggle, Config.get(Config.FILTER)) + self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self.column_editor,) diff --git a/gramps2/src/DataViews/_PlaceView.py b/gramps2/src/DataViews/_PlaceView.py index 6c84acd21..a5d821099 100644 --- a/gramps2/src/DataViews/_PlaceView.py +++ b/gramps2/src/DataViews/_PlaceView.py @@ -70,6 +70,11 @@ column_names = [ # #------------------------------------------------------------------------- class PlaceView(PageView.ListView): + + ADD_MSG = _("Add a new place") + EDIT_MSG = _("Edit the selected place") + DEL_MSG = _("Delete the selected place") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/DataViews/_RepositoryView.py b/gramps2/src/DataViews/_RepositoryView.py index 1995cd0f2..726b2befc 100644 --- a/gramps2/src/DataViews/_RepositoryView.py +++ b/gramps2/src/DataViews/_RepositoryView.py @@ -72,6 +72,11 @@ column_names = [ # #------------------------------------------------------------------------- class RepositoryView(PageView.ListView): + + ADD_MSG = _("Add a new repository") + EDIT_MSG = _("Edit the selected repository") + DEL_MSG = _("Delete the selected repository") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/DataViews/_SourceView.py b/gramps2/src/DataViews/_SourceView.py index 36c25ba95..3f7c18366 100644 --- a/gramps2/src/DataViews/_SourceView.py +++ b/gramps2/src/DataViews/_SourceView.py @@ -65,6 +65,11 @@ column_names = [ # #------------------------------------------------------------------------- class SourceView(PageView.ListView): + + ADD_MSG = _("Add a new source") + EDIT_MSG = _("Edit the selected source") + DEL_MSG = _("Delete the selected source") + def __init__(self,dbstate,uistate): signal_map = { diff --git a/gramps2/src/Editors/_EditPerson.py b/gramps2/src/Editors/_EditPerson.py index bfec2e89e..3d93d35cd 100644 --- a/gramps2/src/Editors/_EditPerson.py +++ b/gramps2/src/Editors/_EditPerson.py @@ -60,9 +60,10 @@ import Utils import Mime import RelLib import GrampsWidgets +import Config from _EditPrimary import EditPrimary -from QuestionDialog import WarningDialog, ErrorDialog, QuestionDialog2 +from QuestionDialog import * from DisplayTabs import \ PersonEventEmbedList,NameEmbedList,SourceEmbedList,AttrEmbedList,\ AddrEmbedList,NoteTab,GalleryTab,WebEmbedList,PersonRefEmbedList, \ @@ -134,6 +135,16 @@ class EditPerson(EditPrimary): self.load_person_image() self.surname_field.grab_focus() +# if not Config.get(Config.HIDE_EP_MSG): +# MessageHideDialog( +# _('Editing a person'), +# _('This window allows you to enter information about ' +# 'a person. You can add events, including birth and ' +# 'death information under the Events tab. Similarly, ' +# 'you can add additional information, such as sources, ' +# 'names, and images on other tabs.'), +# Config.HIDE_EP_MSG) + def _connect_signals(self): """ Connects any signals that need to be connected. Called by the diff --git a/gramps2/src/PageView.py b/gramps2/src/PageView.py index c0167b99f..d69f18ca4 100644 --- a/gramps2/src/PageView.py +++ b/gramps2/src/PageView.py @@ -271,18 +271,20 @@ class PersonNavView(BookMarkView): self.fwd_action = gtk.ActionGroup(self.title + '/Forward') self.fwd_action.add_actions([ ('Forward',gtk.STOCK_GO_FORWARD,_("_Forward"), - None, None, self.fwd_clicked) + None, _("Go to the next person in the history"), + self.fwd_clicked) ]) # add the Backward action group to handle the Forward button self.back_action = gtk.ActionGroup(self.title + '/Backward') self.back_action.add_actions([ ('Back',gtk.STOCK_GO_BACK,_("_Back"), - None, None, self.back_clicked) + None, _("Go to the previous person in the history"), + self.back_clicked) ]) self.add_action('HomePerson', gtk.STOCK_HOME, _("_Home"), - callback=self.home) + tip=_("Go to the default person"), callback=self.home) self.add_action('SetActive', gtk.STOCK_HOME, _("Set _Home Person"), callback=self.set_default_person) @@ -418,6 +420,10 @@ class PersonNavView(BookMarkView): #---------------------------------------------------------------- class ListView(BookMarkView): + ADD_MSG = "" + EDIT_MSG = "" + DEL_MSG = "" + def __init__(self, title, dbstate, uistate, columns, handle_col, make_model, signal_map, get_bookmarks, bm_type): @@ -649,10 +655,13 @@ class ListView(BookMarkView): BookMarkView.define_actions(self) - self.add_action('Add', gtk.STOCK_ADD, _("_Add"), callback=self.add) - self.add_action('Edit', gtk.STOCK_EDIT,_("_Edit"), callback=self.edit) + self.add_action('Add', gtk.STOCK_ADD, _("_Add"), tip=self.ADD_MSG, + callback=self.add) + self.add_action('Edit', gtk.STOCK_EDIT,_("_Edit"), tip=self.EDIT_MSG, + callback=self.edit) self.add_action('Remove',gtk.STOCK_REMOVE,_("_Remove"), - callback=self.remove) + tip=self.DEL_MSG, callback=self.remove) + self.add_toggle_action('Filter', None, _('_Filter'), callback=self.filter_toggle) diff --git a/gramps2/src/QuestionDialog.py b/gramps2/src/QuestionDialog.py index 655450ee8..03bf78ae9 100644 --- a/gramps2/src/QuestionDialog.py +++ b/gramps2/src/QuestionDialog.py @@ -253,3 +253,30 @@ class MissingMediaDialog: "Instead select one of the available options"), self.top) return True + +class MessageHideDialog(gtk.MessageDialog): + def __init__(self, title, message, key, parent=None): + + gtk.MessageDialog.__init__(self, parent, + flags=gtk.DIALOG_MODAL, + type=gtk.MESSAGE_INFO, + buttons=gtk.BUTTONS_CLOSE) + self.set_markup('%s' % title) + self.format_secondary_markup(message) + + checkbox = gtk.CheckButton(_("Do not display again")) + checkbox.set_active(Config.get(key)) + checkbox.connect('toggled',self.update_checkbox, key) + checkbox.show() + + align = gtk.Alignment(0.5,0.0) + align.add(checkbox) + align.show() + self.vbox.add(align) + self.set_icon(ICON) + self.show() + self.run() + self.destroy() + + def update_checkbox(self, obj, constant): + Config.set(constant, obj.get_active()) diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 5b14f545a..e348a585f 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -289,15 +289,16 @@ class ViewManager: def _init_lists(self): self._file_action_list = [ ('FileMenu', None, _('_File')), - ('New', gtk.STOCK_NEW, _('_New'), "n", None, - self.new_activate), - ('Open', gtk.STOCK_OPEN, _('_Open'), "o", None, - self.open_activate), - ('OpenRecent', None, _('Open _Recent')), + ('New', gtk.STOCK_NEW, _('_New'), "n", + _("Create a new database"), self.new_activate), + ('Open', gtk.STOCK_OPEN, _('_Open'), "o", + _("Open an existing database"), self.open_activate), + ('OpenRecent', None, _('Open _Recent'), None, + _("Open an existing database")), ('Quit', gtk.STOCK_QUIT, _('_Quit'), "q",None,self.quit), ('ViewMenu', None, _('_View')), ('EditMenu', None, _('_Edit')), - ('Preferences', gtk.STOCK_PREFERENCES,_('_Preferences'),None,None, + ('Preferences', gtk.STOCK_PREFERENCES,_('_Preferences'),None, None, self.preferences_activate), ('HelpMenu', None, _('_Help')), ('HomePage', None, _('GRAMPS _home page'), None, None, @@ -324,14 +325,14 @@ class ViewManager: _('_Abandon changes and quit'), None, None, self.abort), ('CmpMerge', None, _('_Compare and merge')), ('FastMerge', None, _('_Fast merge')), - ('ScratchPad', gtk.STOCK_PASTE, _('_ScratchPad'), "", None, - self.scratchpad), + ('ScratchPad', gtk.STOCK_PASTE, _('_ScratchPad'), "", + _("Open the ScratchPad dialog"), self.scratchpad), ('Import', gtk.STOCK_CONVERT, _('_Import'), "i", None, self.import_data), - ('Reports', gtk.STOCK_DND_MULTIPLE, _('_Reports'), None, None, - self.reports_clicked), - ('Tools', gtk.STOCK_EXECUTE, _('_Tools'), None, None, - self.tools_clicked), + ('Reports', gtk.STOCK_DND_MULTIPLE, _('_Reports'), None, + _("Open the reports dialog"), self.reports_clicked), + ('Tools', gtk.STOCK_EXECUTE, _('_Tools'), None, + _("Open the tools dialog"), self.tools_clicked), ('EditMenu', None, _('_Edit')), ('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor')), ('GoMenu', None, _('_Go')),