From 15e789467be5a601cf83156d3621581b02a3bbe4 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Fri, 15 Feb 2008 22:38:47 +0000 Subject: [PATCH] 2008-02-15 Benny Malengier * src/DisplayTabs/_SourceEmbedList.py: * src/DisplayTabs/_PersonRefEmbedList.py: * src/DisplayTabs/_RepoEmbedList.py: * src/DisplayTabs/__init__.py: * src/DisplayTabs/_AddrEmbedList.py: * src/DisplayTabs/_WebEmbedList.py: * src/DisplayTabs/_NameEmbedList.py: * src/DisplayTabs/_EventEmbedList.py: * src/DisplayTabs/_EmbeddedList.py: * src/DisplayTabs/_GalleryTab.py: * src/DisplayTabs/_BackRefList.py: * src/DisplayTabs/_NoteTab.py: * src/DisplayTabs/_LocationEmbedList.py: * src/DisplayTabs/_ButtonTab.py: * src/DisplayTabs/_DataEmbedList.py: * src/DisplayTabs/_AttrEmbedList.py: * src/DisplayTabs/_LdsEmbedList.py: * src/DisplayTabs/_GrampsTab.py: * src/Editors/_EditPrimary.py: * src/Editors/_EditPlace.py: * src/Editors/_EditSecondary.py: * src/Editors/_EditSourceRef.py: * src/Editors/_EditReference.py: * src/Editors/_EditRepoRef.py: * src/Editors/_EditNote.py: * src/Editors/_EditMediaRef.py: * src/Editors/_EditEventRef.py: * src/Editors/_EditName.py: * src/Editors/_EditFamily.py: Add mnemonics for all tabs, eg ALT+S and INSERT to move to sources and insert a new source. * src/DisplayTabs/_TextTab.py: * src/DisplayTabs/Makefile.am: * po/POTFILES.in: Remove unused TextTab svn: r10040 --- ChangeLog | 37 ++++++++ po/POTFILES.in | 1 - src/DisplayTabs/Makefile.am | 1 - src/DisplayTabs/_AddrEmbedList.py | 2 +- src/DisplayTabs/_AttrEmbedList.py | 2 +- src/DisplayTabs/_BackRefList.py | 2 +- src/DisplayTabs/_ButtonTab.py | 5 +- src/DisplayTabs/_DataEmbedList.py | 2 +- src/DisplayTabs/_EmbeddedList.py | 2 +- src/DisplayTabs/_EventEmbedList.py | 2 +- src/DisplayTabs/_GalleryTab.py | 2 +- src/DisplayTabs/_GrampsTab.py | 10 ++- src/DisplayTabs/_LdsEmbedList.py | 2 +- src/DisplayTabs/_LocationEmbedList.py | 2 +- src/DisplayTabs/_NameEmbedList.py | 2 +- src/DisplayTabs/_NoteTab.py | 2 +- src/DisplayTabs/_PersonRefEmbedList.py | 2 +- src/DisplayTabs/_RepoEmbedList.py | 2 +- src/DisplayTabs/_SourceEmbedList.py | 2 +- src/DisplayTabs/_TextTab.py | 112 ------------------------- src/DisplayTabs/_WebEmbedList.py | 2 +- src/DisplayTabs/__init__.py | 1 - src/Editors/_EditEventRef.py | 2 +- src/Editors/_EditFamily.py | 2 +- src/Editors/_EditMediaRef.py | 6 +- src/Editors/_EditName.py | 2 +- src/Editors/_EditNote.py | 2 +- src/Editors/_EditPlace.py | 4 +- src/Editors/_EditPrimary.py | 12 +++ src/Editors/_EditReference.py | 11 +++ src/Editors/_EditRepoRef.py | 2 +- src/Editors/_EditSecondary.py | 11 +++ src/Editors/_EditSourceRef.py | 2 +- 33 files changed, 109 insertions(+), 144 deletions(-) delete mode 100644 src/DisplayTabs/_TextTab.py diff --git a/ChangeLog b/ChangeLog index 78d39e6f6..1e4ff92c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2008-02-15 Benny Malengier + * src/DisplayTabs/_SourceEmbedList.py: + * src/DisplayTabs/_PersonRefEmbedList.py: + * src/DisplayTabs/_RepoEmbedList.py: + * src/DisplayTabs/__init__.py: + * src/DisplayTabs/_AddrEmbedList.py: + * src/DisplayTabs/_WebEmbedList.py: + * src/DisplayTabs/_NameEmbedList.py: + * src/DisplayTabs/_EventEmbedList.py: + * src/DisplayTabs/_EmbeddedList.py: + * src/DisplayTabs/_GalleryTab.py: + * src/DisplayTabs/_BackRefList.py: + * src/DisplayTabs/_NoteTab.py: + * src/DisplayTabs/_LocationEmbedList.py: + * src/DisplayTabs/_ButtonTab.py: + * src/DisplayTabs/_DataEmbedList.py: + * src/DisplayTabs/_AttrEmbedList.py: + * src/DisplayTabs/_LdsEmbedList.py: + * src/DisplayTabs/_GrampsTab.py: + * src/Editors/_EditPrimary.py: + * src/Editors/_EditPlace.py: + * src/Editors/_EditSecondary.py: + * src/Editors/_EditSourceRef.py: + * src/Editors/_EditReference.py: + * src/Editors/_EditRepoRef.py: + * src/Editors/_EditNote.py: + * src/Editors/_EditMediaRef.py: + * src/Editors/_EditEventRef.py: + * src/Editors/_EditName.py: + * src/Editors/_EditFamily.py: + Add mnemonics for all tabs, eg ALT+S and INSERT to move to sources and + insert a new source. + * src/DisplayTabs/_TextTab.py: + * src/DisplayTabs/Makefile.am: + * po/POTFILES.in: + Remove unused TextTab + 2008-02-15 Douglas S. Blank * src/ViewManager.py (ViewManager.__build_main_window):pass self to DS * src/DisplayState.py (DisplayState): added vm param diff --git a/po/POTFILES.in b/po/POTFILES.in index 1d9cfc0e5..0033cfd50 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -157,7 +157,6 @@ src/DisplayTabs/_NameEmbedList.py #src/DisplayTabs/_NameModel.py src/DisplayTabs/_NoteBackRefList.py src/DisplayTabs/_NoteTab.py -src/DisplayTabs/_TextTab.py src/DisplayTabs/_PersonEventEmbedList.py src/DisplayTabs/_PersonRefEmbedList.py src/DisplayTabs/_PersonRefModel.py diff --git a/src/DisplayTabs/Makefile.am b/src/DisplayTabs/Makefile.am index b7851b7c7..393a55e47 100644 --- a/src/DisplayTabs/Makefile.am +++ b/src/DisplayTabs/Makefile.am @@ -31,7 +31,6 @@ pkgdata_PYTHON = \ _NoteBackRefList.py \ _NoteTab.py \ _NoteModel.py \ - _TextTab.py \ _PersonBackRefList.py \ _PersonEventEmbedList.py \ _PersonRefEmbedList.py \ diff --git a/src/DisplayTabs/_AddrEmbedList.py b/src/DisplayTabs/_AddrEmbedList.py index 741acc283..980681989 100644 --- a/src/DisplayTabs/_AddrEmbedList.py +++ b/src/DisplayTabs/_AddrEmbedList.py @@ -67,7 +67,7 @@ class AddrEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('Addresses'), AddressModel) + _('_Addresses'), AddressModel) def get_icon_name(self): """ diff --git a/src/DisplayTabs/_AttrEmbedList.py b/src/DisplayTabs/_AttrEmbedList.py index 11fd674b0..829591906 100644 --- a/src/DisplayTabs/_AttrEmbedList.py +++ b/src/DisplayTabs/_AttrEmbedList.py @@ -56,7 +56,7 @@ class AttrEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('Attributes'), AttrModel) + _('_Attributes'), AttrModel) def get_editor(self): from Editors import EditAttribute diff --git a/src/DisplayTabs/_BackRefList.py b/src/DisplayTabs/_BackRefList.py index 5b886ccd6..649764a73 100644 --- a/src/DisplayTabs/_BackRefList.py +++ b/src/DisplayTabs/_BackRefList.py @@ -61,7 +61,7 @@ class BackRefList(EmbeddedList): def __init__(self, dbstate, uistate, track, obj, refmodel, callback=None): self.obj = obj EmbeddedList.__init__(self, dbstate, uistate, track, - _('References'), refmodel) + _('_References'), refmodel) self._callback = callback self.model.connect('row-inserted', self.update_label) diff --git a/src/DisplayTabs/_ButtonTab.py b/src/DisplayTabs/_ButtonTab.py index 3ca767524..4b6117d87 100644 --- a/src/DisplayTabs/_ButtonTab.py +++ b/src/DisplayTabs/_ButtonTab.py @@ -179,7 +179,7 @@ class ButtonTab(GrampsTab): the Edit button handler is called """ if event.type == gtk.gdk.KEY_PRESS: - print 'key pressed', event.keyval, event.state, gtk.gdk.MOD1_MASK, _RIGHT + #print 'key pressed', event.keyval, event.state, _ADD if event.keyval in (_RETURN, _KP_ENTER): try: self.edit_button_clicked(obj) @@ -205,6 +205,9 @@ class ButtonTab(GrampsTab): event.state in (gtk.gdk.MOD1_MASK, gtk.gdk.MOD1_MASK | gtk.gdk.MOD2_MASK): self.next_page() + else: + return + return True def add_button_clicked(self, obj): """ diff --git a/src/DisplayTabs/_DataEmbedList.py b/src/DisplayTabs/_DataEmbedList.py index 3243303e7..b6dfb67c7 100644 --- a/src/DisplayTabs/_DataEmbedList.py +++ b/src/DisplayTabs/_DataEmbedList.py @@ -54,7 +54,7 @@ class DataEmbedList(EmbeddedList): self.obj = obj EmbeddedList.__init__(self, dbstate, uistate, track, - _('Data'), DataModel) + _('_Data'), DataModel) def build_columns(self): EmbeddedList.build_columns(self) diff --git a/src/DisplayTabs/_EmbeddedList.py b/src/DisplayTabs/_EmbeddedList.py index a9a83d22a..129ce690c 100644 --- a/src/DisplayTabs/_EmbeddedList.py +++ b/src/DisplayTabs/_EmbeddedList.py @@ -67,7 +67,6 @@ class EmbeddedList(ButtonTab): """ ButtonTab.__init__(self, dbstate, uistate, track, name, share, move, jump) - self.changed = False self.build_model = build_model @@ -448,3 +447,4 @@ class EmbeddedList(ButtonTab): #model and tree are reset, allow _selection_changed again, and force it self.dirty_selection = False self._selection_changed() + diff --git a/src/DisplayTabs/_EventEmbedList.py b/src/DisplayTabs/_EventEmbedList.py index 108b622a5..555d8eb2e 100644 --- a/src/DisplayTabs/_EventEmbedList.py +++ b/src/DisplayTabs/_EventEmbedList.py @@ -68,7 +68,7 @@ class EventEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, obj): self.obj = obj EmbeddedList.__init__(self, dbstate, uistate, track, - _('Events'), EventRefModel, True) + _('_Events'), EventRefModel, True) def get_ref_editor(self): from Editors import EditFamilyEventRef diff --git a/src/DisplayTabs/_GalleryTab.py b/src/DisplayTabs/_GalleryTab.py index 17a3e6893..730ce3d68 100644 --- a/src/DisplayTabs/_GalleryTab.py +++ b/src/DisplayTabs/_GalleryTab.py @@ -73,7 +73,7 @@ class GalleryTab(ButtonTab): def __init__(self, dbstate, uistate, track, media_list, update=None): self.iconlist = gtk.IconView() - ButtonTab.__init__(self, dbstate, uistate, track, _('Gallery'), True) + ButtonTab.__init__(self, dbstate, uistate, track, _('_Gallery'), True) self.media_list = media_list self.update = update diff --git a/src/DisplayTabs/_GrampsTab.py b/src/DisplayTabs/_GrampsTab.py index 4a71e51bb..d4b25d1bf 100644 --- a/src/DisplayTabs/_GrampsTab.py +++ b/src/DisplayTabs/_GrampsTab.py @@ -150,11 +150,16 @@ class GrampsTab(gtk.HBox): """ if event.type == gtk.gdk.KEY_PRESS: if event.keyval in (_LEFT,) and \ - event.state in (gtk.gdk.MOD1_MASK,): + event.state in (gtk.gdk.MOD1_MASK, + gtk.gdk.MOD1_MASK | gtk.gdk.MOD2_MASK): self.prev_page() elif event.keyval in (_RIGHT,) and \ - event.state in (gtk.gdk.MOD1_MASK,): + event.state in (gtk.gdk.MOD1_MASK, + gtk.gdk.MOD1_MASK | gtk.gdk.MOD2_MASK): self.next_page() + else: + return + return True def add_db_signal_callback(self, add_db_signal): """ @@ -186,6 +191,7 @@ class GrampsTab(gtk.HBox): else: self.tab_image.hide() self.label.set_text(self.tab_name) + self.label.set_use_underline(True) def build_interface(self): """ diff --git a/src/DisplayTabs/_LdsEmbedList.py b/src/DisplayTabs/_LdsEmbedList.py index 17932fb16..8e8bb5f04 100644 --- a/src/DisplayTabs/_LdsEmbedList.py +++ b/src/DisplayTabs/_LdsEmbedList.py @@ -58,7 +58,7 @@ class LdsEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('LDS'), LdsModel) + _('_LDS'), LdsModel) def get_editor(self): from Editors import EditLdsOrd diff --git a/src/DisplayTabs/_LocationEmbedList.py b/src/DisplayTabs/_LocationEmbedList.py index 6dbc14a90..861a2d49d 100644 --- a/src/DisplayTabs/_LocationEmbedList.py +++ b/src/DisplayTabs/_LocationEmbedList.py @@ -59,7 +59,7 @@ class LocationEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('Alternate Locations'), LocationModel) + _('Alternate _Locations'), LocationModel) def get_data(self): return self.data diff --git a/src/DisplayTabs/_NameEmbedList.py b/src/DisplayTabs/_NameEmbedList.py index c27f8fc28..ca9aa0d55 100644 --- a/src/DisplayTabs/_NameEmbedList.py +++ b/src/DisplayTabs/_NameEmbedList.py @@ -66,7 +66,7 @@ class NameEmbedList(EmbeddedList): self.callback = callback EmbeddedList.__init__(self, dbstate, uistate, track, - _('Names'), NameModel) + _('_Names'), NameModel) def get_data(self): return self.data diff --git a/src/DisplayTabs/_NoteTab.py b/src/DisplayTabs/_NoteTab.py index 40c55fd32..51b520f7e 100644 --- a/src/DisplayTabs/_NoteTab.py +++ b/src/DisplayTabs/_NoteTab.py @@ -78,7 +78,7 @@ class NoteTab(EmbeddedList): self.callertitle = callertitle self.notetype = notetype EmbeddedList.__init__(self, dbstate, uistate, track, - _("Notes"), NoteModel, share=True, move=True) + _("_Notes"), NoteModel, share=True, move=True) def connect_db_signals(self): #connect external remove/change of object to rebuild of grampstab diff --git a/src/DisplayTabs/_PersonRefEmbedList.py b/src/DisplayTabs/_PersonRefEmbedList.py index c7ec19dc0..738e9f420 100644 --- a/src/DisplayTabs/_PersonRefEmbedList.py +++ b/src/DisplayTabs/_PersonRefEmbedList.py @@ -57,7 +57,7 @@ class PersonRefEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('Associations'), PersonRefModel) + _('Ass_ociations'), PersonRefModel) def get_ref_editor(self): from Editors import EditPersonRef diff --git a/src/DisplayTabs/_RepoEmbedList.py b/src/DisplayTabs/_RepoEmbedList.py index ba5e59043..6e6783d49 100644 --- a/src/DisplayTabs/_RepoEmbedList.py +++ b/src/DisplayTabs/_RepoEmbedList.py @@ -66,7 +66,7 @@ class RepoEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, obj): self.obj = obj EmbeddedList.__init__(self, dbstate, uistate, track, - _('Repositories'), RepoRefModel, True) + _('_Repositories'), RepoRefModel, True) def get_icon_name(self): return 'gramps-repository' diff --git a/src/DisplayTabs/_SourceEmbedList.py b/src/DisplayTabs/_SourceEmbedList.py index 129311ebd..d786d075d 100644 --- a/src/DisplayTabs/_SourceEmbedList.py +++ b/src/DisplayTabs/_SourceEmbedList.py @@ -66,7 +66,7 @@ class SourceEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, obj): self.obj = obj EmbeddedList.__init__(self, dbstate, uistate, track, - _('Sources'), SourceRefModel, True) + _('_Sources'), SourceRefModel, True) def get_icon_name(self): return 'gramps-source' diff --git a/src/DisplayTabs/_TextTab.py b/src/DisplayTabs/_TextTab.py deleted file mode 100644 index af00c4588..000000000 --- a/src/DisplayTabs/_TextTab.py +++ /dev/null @@ -1,112 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2000-2006 Donald N. Allingham -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# $Id$ - -#------------------------------------------------------------------------- -# -# Python classes -# -#------------------------------------------------------------------------- -from gettext import gettext as _ - -#------------------------------------------------------------------------- -# -# GTK libraries -# -#------------------------------------------------------------------------- -import gtk - -#------------------------------------------------------------------------- -# -# GRAMPS classes -# -#------------------------------------------------------------------------- -import Spell -from _GrampsTab import GrampsTab - -#------------------------------------------------------------------------- -# -# NoteTab -# -#------------------------------------------------------------------------- -class TextTab(GrampsTab): - - def __init__(self, dbstate, uistate, track, obj, title=_('Text')): - self.obj = obj - self.original = self.obj.get_text() - GrampsTab.__init__(self, dbstate, uistate, track, title) - self.show_all() - - def _update_label(self, *obj): - cc = self.buf.get_char_count() - if cc == 0 and not self.empty: - self.empty = True - self._set_label() - elif cc != 0 and self.empty: - self.empty = False - self._set_label() - - def is_empty(self): - """ - Indicates if the tab contains any data. This is used to determine - how the label should be displayed. - """ - return self.buf.get_char_count() == 0 - - def build_interface(self): - vbox = gtk.VBox() - - self.text_view = gtk.TextView() - self.spellcheck = Spell.Spell(self.text_view) - - scroll = gtk.ScrolledWindow() - scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - scroll.add(self.text_view) - scroll.connect('focus-out-event', self.update) - - vbox.pack_start(scroll, True) - vbox.set_spacing(6) - vbox.set_border_width(6) - - self.pack_start(vbox, True) - self.buf = self.text_view.get_buffer() - if self.obj.get_text(): - self.empty = False - self.buf.insert_at_cursor(self.obj.get_text()) - else: - self.empty = True - - self.buf.connect('changed', self.update) - self.rebuild() - - def update(self, obj): - start = self.buf.get_start_iter() - stop = self.buf.get_end_iter() - text = unicode(self.buf.get_text(start, stop)) - self.obj.set_text(text) - self._update_label(obj) - return False - - def rebuild(self): - self._set_label() - - def cancel(self): - self.obj.set_text(self.original) diff --git a/src/DisplayTabs/_WebEmbedList.py b/src/DisplayTabs/_WebEmbedList.py index 760f39f26..7fc541773 100644 --- a/src/DisplayTabs/_WebEmbedList.py +++ b/src/DisplayTabs/_WebEmbedList.py @@ -58,7 +58,7 @@ class WebEmbedList(EmbeddedList): def __init__(self, dbstate, uistate, track, data): self.data = data EmbeddedList.__init__(self, dbstate, uistate, track, - _('Internet'), WebModel, jump=True) + _('_Internet'), WebModel, jump=True) def get_icon_name(self): return 'gramps-url' diff --git a/src/DisplayTabs/__init__.py b/src/DisplayTabs/__init__.py index 4b46c40f8..d8d559b78 100644 --- a/src/DisplayTabs/__init__.py +++ b/src/DisplayTabs/__init__.py @@ -50,7 +50,6 @@ from _MediaBackRefList import MediaBackRefList from _NameEmbedList import NameEmbedList from _NoteBackRefList import NoteBackRefList from _NoteTab import NoteTab -from _TextTab import TextTab from _PersonEventEmbedList import PersonEventEmbedList from _PersonRefEmbedList import PersonRefEmbedList from _PersonBackRefList import PersonBackRefList diff --git a/src/Editors/_EditEventRef.py b/src/Editors/_EditEventRef.py index 39862926a..76d69464f 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/Editors/_EditEventRef.py @@ -91,7 +91,7 @@ class EditEventRef(EditReference): #recreate start page as GrampsTab notebook.remove_page(0) self.primtab = RefTab(self.dbstate, self.uistate, self.track, - _('General'), tblref) + _('_General'), tblref) def _init_event(self): self.commit_event = self.db.commit_personal_event diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index a385cd08d..7666c7729 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -111,7 +111,7 @@ class ChildEmbedList(EmbeddedList): """ self.family = family EmbeddedList.__init__(self, dbstate, uistate, track, - _('Children'), ChildModel, True, True) + _('_Children'), ChildModel, True, True) def get_popup_menu_items(self): return [ diff --git a/src/Editors/_EditMediaRef.py b/src/Editors/_EditMediaRef.py index bdf75f2c0..280f70c0a 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/Editors/_EditMediaRef.py @@ -90,7 +90,7 @@ class EditMediaRef(EditReference): #recreate start page as GrampsTab notebook.remove_page(0) self.primtab = RefTab(self.dbstate, self.uistate, self.track, - _('General'), tblref) + _('_General'), tblref) def draw_preview(self): """ @@ -447,8 +447,8 @@ class EditMediaRef(EditReference): self.source.get_note_list(), notetype=NoteType.MEDIA)) - self._setup_notebook_tabs( notebook_src) - self._setup_notebook_tabs( notebook_ref) + self._setup_notebook_tabs(notebook_src) + self._setup_notebook_tabs(notebook_ref) def save(self,*obj): #first save primary object diff --git a/src/Editors/_EditName.py b/src/Editors/_EditName.py index 00195986a..1f60e1313 100644 --- a/src/Editors/_EditName.py +++ b/src/Editors/_EditName.py @@ -120,7 +120,7 @@ class EditName(EditSecondary): #recreate start page as GrampsTab notebook.remove_page(0) self.gennam = GeneralNameTab(self.dbstate, self.uistate, self.track, - _('General'), tblgnam) + _('_General'), tblgnam) self.original_group_as = self.obj.get_group_as() self.original_group_set = not (self.original_group_as == '') diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index e7a6e7930..3e1c690de 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -198,7 +198,7 @@ class EditNote(EditPrimary): #recreate start page as GrampsTab notebook.remove_page(0) self.ntab = NoteTab(self.dbstate, self.uistate, self.track, - _('Note'), vboxnote) + _('_Note'), vboxnote) self.build_interface() diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index f5b16992b..bda136c93 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -88,7 +88,7 @@ class MainLocTab(GrampsTab): eventbox.add(widget) self.pack_start(eventbox) self._set_label(show_image=False) - widget.connect('key_press_event', self.key_pressed) + eventbox.connect('key_press_event', self.key_pressed) self.show_all() def is_empty(self): @@ -125,7 +125,7 @@ class EditPlace(EditPrimary): #recreate start page as GrampsTab notebook.remove_page(0) self.mloc = MainLocTab(self.dbstate, self.uistate, self.track, - _('Location'), tblmloc) + _('_Location'), tblmloc) def get_menu_title(self): if self.obj and self.obj.get_handle(): diff --git a/src/Editors/_EditPrimary.py b/src/Editors/_EditPrimary.py index 158f51416..eadfe9e14 100644 --- a/src/Editors/_EditPrimary.py +++ b/src/Editors/_EditPrimary.py @@ -103,6 +103,17 @@ class EditPrimary(ManagedWindow.ManagedWindow): page_no) child.set_parent_notebook(notebook) + notebook.connect('key-press-event', self.key_pressed, notebook) + + def key_pressed(self, obj, event, notebook): + """ + Handles the key being pressed on the notebook, pass to key press of + current page. + """ + pag = notebook.get_current_page() + if not pag == -1: + notebook.get_nth_page(pag).key_pressed(obj, event) + def _switch_page_on_dnd(self, widget, context, x, y, time, notebook, page_no): if notebook.get_current_page() != page_no: @@ -111,6 +122,7 @@ class EditPrimary(ManagedWindow.ManagedWindow): def _add_tab(self, notebook, page): notebook.insert_page(page, page.get_tab_widget()) page.add_db_signal_callback(self._add_db_signal) + page.label.set_use_underline(True) return page def _cleanup_on_exit(self): diff --git a/src/Editors/_EditReference.py b/src/Editors/_EditReference.py index 309dbcce3..31a4cebbd 100644 --- a/src/Editors/_EditReference.py +++ b/src/Editors/_EditReference.py @@ -141,6 +141,16 @@ class EditReference(ManagedWindow.ManagedWindow): notebook, page_no) child.set_parent_notebook(notebook) + notebook.connect('key-press-event', self.key_pressed, notebook) + + def key_pressed(self, obj, event, notebook): + """ + Handles the key being pressed on the notebook, pass to key press of + current page. + """ + pag = notebook.get_current_page() + if not pag == -1: + notebook.get_nth_page(pag).key_pressed(obj, event) def _switch_page_on_dnd(self, widget, context, x, y, time, notebook, page_no): if notebook.get_current_page() != page_no: @@ -149,6 +159,7 @@ class EditReference(ManagedWindow.ManagedWindow): def _add_tab(self,notebook,page): notebook.insert_page(page, page.get_tab_widget()) page.add_db_signal_callback(self._add_db_signal) + page.label.set_use_underline(True) return page def _add_db_signal(self, name, callback): diff --git a/src/Editors/_EditRepoRef.py b/src/Editors/_EditRepoRef.py index f960bfa35..277f3cb5d 100644 --- a/src/Editors/_EditRepoRef.py +++ b/src/Editors/_EditRepoRef.py @@ -85,7 +85,7 @@ class EditRepoRef(EditReference): #recreate start page as GrampsTab notebook.remove_page(0) self.primtab = RefTab(self.dbstate, self.uistate, self.track, - _('General'), tblref) + _('_General'), tblref) def _connect_signals(self): self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked) diff --git a/src/Editors/_EditSecondary.py b/src/Editors/_EditSecondary.py index 34c4e1522..7e27edc2a 100644 --- a/src/Editors/_EditSecondary.py +++ b/src/Editors/_EditSecondary.py @@ -93,6 +93,16 @@ class EditSecondary(ManagedWindow.ManagedWindow): notebook, page_no) child.set_parent_notebook(notebook) + notebook.connect('key-press-event', self.key_pressed, notebook) + + def key_pressed(self, obj, event, notebook): + """ + Handles the key being pressed on the notebook, pass to key press of + current page. + """ + pag = notebook.get_current_page() + if not pag == -1: + notebook.get_nth_page(pag).key_pressed(obj, event) def _switch_page_on_dnd(self, widget, context, x, y, time, notebook, page_no): if notebook.get_current_page() != page_no: @@ -101,6 +111,7 @@ class EditSecondary(ManagedWindow.ManagedWindow): def _add_tab(self,notebook,page): notebook.insert_page(page, page.get_tab_widget()) page.add_db_signal_callback(self._add_db_signal) + page.label.set_use_underline(True) return page def _cleanup_on_exit(self): diff --git a/src/Editors/_EditSourceRef.py b/src/Editors/_EditSourceRef.py index 9966247a1..44df634b9 100644 --- a/src/Editors/_EditSourceRef.py +++ b/src/Editors/_EditSourceRef.py @@ -43,7 +43,7 @@ import const import gen.lib from DisplayTabs import \ - NoteTab,TextTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList + NoteTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList from GrampsWidgets import * from _EditReference import RefTab, EditReference