2008-02-15 Benny Malengier <benny.malengier@gramps-project.org>
* 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
This commit is contained in:
parent
749261804d
commit
15e789467b
37
ChangeLog
37
ChangeLog
@ -1,3 +1,40 @@
|
|||||||
|
2008-02-15 Benny Malengier <benny.malengier@gramps-project.org>
|
||||||
|
* 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 <dblank@cs.brynmawr.edu>
|
2008-02-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||||
* src/ViewManager.py (ViewManager.__build_main_window):pass self to DS
|
* src/ViewManager.py (ViewManager.__build_main_window):pass self to DS
|
||||||
* src/DisplayState.py (DisplayState): added vm param
|
* src/DisplayState.py (DisplayState): added vm param
|
||||||
|
@ -157,7 +157,6 @@ src/DisplayTabs/_NameEmbedList.py
|
|||||||
#src/DisplayTabs/_NameModel.py
|
#src/DisplayTabs/_NameModel.py
|
||||||
src/DisplayTabs/_NoteBackRefList.py
|
src/DisplayTabs/_NoteBackRefList.py
|
||||||
src/DisplayTabs/_NoteTab.py
|
src/DisplayTabs/_NoteTab.py
|
||||||
src/DisplayTabs/_TextTab.py
|
|
||||||
src/DisplayTabs/_PersonEventEmbedList.py
|
src/DisplayTabs/_PersonEventEmbedList.py
|
||||||
src/DisplayTabs/_PersonRefEmbedList.py
|
src/DisplayTabs/_PersonRefEmbedList.py
|
||||||
src/DisplayTabs/_PersonRefModel.py
|
src/DisplayTabs/_PersonRefModel.py
|
||||||
|
@ -31,7 +31,6 @@ pkgdata_PYTHON = \
|
|||||||
_NoteBackRefList.py \
|
_NoteBackRefList.py \
|
||||||
_NoteTab.py \
|
_NoteTab.py \
|
||||||
_NoteModel.py \
|
_NoteModel.py \
|
||||||
_TextTab.py \
|
|
||||||
_PersonBackRefList.py \
|
_PersonBackRefList.py \
|
||||||
_PersonEventEmbedList.py \
|
_PersonEventEmbedList.py \
|
||||||
_PersonRefEmbedList.py \
|
_PersonRefEmbedList.py \
|
||||||
|
@ -67,7 +67,7 @@ class AddrEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Addresses'), AddressModel)
|
_('_Addresses'), AddressModel)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
"""
|
"""
|
||||||
|
@ -56,7 +56,7 @@ class AttrEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Attributes'), AttrModel)
|
_('_Attributes'), AttrModel)
|
||||||
|
|
||||||
def get_editor(self):
|
def get_editor(self):
|
||||||
from Editors import EditAttribute
|
from Editors import EditAttribute
|
||||||
|
@ -61,7 +61,7 @@ class BackRefList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, obj, refmodel, callback=None):
|
def __init__(self, dbstate, uistate, track, obj, refmodel, callback=None):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('References'), refmodel)
|
_('_References'), refmodel)
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
self.model.connect('row-inserted', self.update_label)
|
self.model.connect('row-inserted', self.update_label)
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ class ButtonTab(GrampsTab):
|
|||||||
the Edit button handler is called
|
the Edit button handler is called
|
||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.KEY_PRESS:
|
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):
|
if event.keyval in (_RETURN, _KP_ENTER):
|
||||||
try:
|
try:
|
||||||
self.edit_button_clicked(obj)
|
self.edit_button_clicked(obj)
|
||||||
@ -205,6 +205,9 @@ class ButtonTab(GrampsTab):
|
|||||||
event.state in (gtk.gdk.MOD1_MASK,
|
event.state in (gtk.gdk.MOD1_MASK,
|
||||||
gtk.gdk.MOD1_MASK | gtk.gdk.MOD2_MASK):
|
gtk.gdk.MOD1_MASK | gtk.gdk.MOD2_MASK):
|
||||||
self.next_page()
|
self.next_page()
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
return True
|
||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
"""
|
"""
|
||||||
|
@ -54,7 +54,7 @@ class DataEmbedList(EmbeddedList):
|
|||||||
self.obj = obj
|
self.obj = obj
|
||||||
|
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Data'), DataModel)
|
_('_Data'), DataModel)
|
||||||
|
|
||||||
def build_columns(self):
|
def build_columns(self):
|
||||||
EmbeddedList.build_columns(self)
|
EmbeddedList.build_columns(self)
|
||||||
|
@ -67,7 +67,6 @@ class EmbeddedList(ButtonTab):
|
|||||||
"""
|
"""
|
||||||
ButtonTab.__init__(self, dbstate, uistate, track, name, share, move, jump)
|
ButtonTab.__init__(self, dbstate, uistate, track, name, share, move, jump)
|
||||||
|
|
||||||
|
|
||||||
self.changed = False
|
self.changed = False
|
||||||
self.build_model = build_model
|
self.build_model = build_model
|
||||||
|
|
||||||
@ -448,3 +447,4 @@ class EmbeddedList(ButtonTab):
|
|||||||
#model and tree are reset, allow _selection_changed again, and force it
|
#model and tree are reset, allow _selection_changed again, and force it
|
||||||
self.dirty_selection = False
|
self.dirty_selection = False
|
||||||
self._selection_changed()
|
self._selection_changed()
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class EventEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, obj):
|
def __init__(self, dbstate, uistate, track, obj):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Events'), EventRefModel, True)
|
_('_Events'), EventRefModel, True)
|
||||||
|
|
||||||
def get_ref_editor(self):
|
def get_ref_editor(self):
|
||||||
from Editors import EditFamilyEventRef
|
from Editors import EditFamilyEventRef
|
||||||
|
@ -73,7 +73,7 @@ class GalleryTab(ButtonTab):
|
|||||||
def __init__(self, dbstate, uistate, track, media_list, update=None):
|
def __init__(self, dbstate, uistate, track, media_list, update=None):
|
||||||
self.iconlist = gtk.IconView()
|
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.media_list = media_list
|
||||||
self.update = update
|
self.update = update
|
||||||
|
|
||||||
|
@ -150,11 +150,16 @@ class GrampsTab(gtk.HBox):
|
|||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.KEY_PRESS:
|
if event.type == gtk.gdk.KEY_PRESS:
|
||||||
if event.keyval in (_LEFT,) and \
|
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()
|
self.prev_page()
|
||||||
elif event.keyval in (_RIGHT,) and \
|
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()
|
self.next_page()
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
return True
|
||||||
|
|
||||||
def add_db_signal_callback(self, add_db_signal):
|
def add_db_signal_callback(self, add_db_signal):
|
||||||
"""
|
"""
|
||||||
@ -186,6 +191,7 @@ class GrampsTab(gtk.HBox):
|
|||||||
else:
|
else:
|
||||||
self.tab_image.hide()
|
self.tab_image.hide()
|
||||||
self.label.set_text(self.tab_name)
|
self.label.set_text(self.tab_name)
|
||||||
|
self.label.set_use_underline(True)
|
||||||
|
|
||||||
def build_interface(self):
|
def build_interface(self):
|
||||||
"""
|
"""
|
||||||
|
@ -58,7 +58,7 @@ class LdsEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('LDS'), LdsModel)
|
_('_LDS'), LdsModel)
|
||||||
|
|
||||||
def get_editor(self):
|
def get_editor(self):
|
||||||
from Editors import EditLdsOrd
|
from Editors import EditLdsOrd
|
||||||
|
@ -59,7 +59,7 @@ class LocationEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Alternate Locations'), LocationModel)
|
_('Alternate _Locations'), LocationModel)
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return self.data
|
return self.data
|
||||||
|
@ -66,7 +66,7 @@ class NameEmbedList(EmbeddedList):
|
|||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Names'), NameModel)
|
_('_Names'), NameModel)
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return self.data
|
return self.data
|
||||||
|
@ -78,7 +78,7 @@ class NoteTab(EmbeddedList):
|
|||||||
self.callertitle = callertitle
|
self.callertitle = callertitle
|
||||||
self.notetype = notetype
|
self.notetype = notetype
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_("Notes"), NoteModel, share=True, move=True)
|
_("_Notes"), NoteModel, share=True, move=True)
|
||||||
|
|
||||||
def connect_db_signals(self):
|
def connect_db_signals(self):
|
||||||
#connect external remove/change of object to rebuild of grampstab
|
#connect external remove/change of object to rebuild of grampstab
|
||||||
|
@ -57,7 +57,7 @@ class PersonRefEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Associations'), PersonRefModel)
|
_('Ass_ociations'), PersonRefModel)
|
||||||
|
|
||||||
def get_ref_editor(self):
|
def get_ref_editor(self):
|
||||||
from Editors import EditPersonRef
|
from Editors import EditPersonRef
|
||||||
|
@ -66,7 +66,7 @@ class RepoEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, obj):
|
def __init__(self, dbstate, uistate, track, obj):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Repositories'), RepoRefModel, True)
|
_('_Repositories'), RepoRefModel, True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-repository'
|
return 'gramps-repository'
|
||||||
|
@ -66,7 +66,7 @@ class SourceEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, obj):
|
def __init__(self, dbstate, uistate, track, obj):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Sources'), SourceRefModel, True)
|
_('_Sources'), SourceRefModel, True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-source'
|
return 'gramps-source'
|
||||||
|
@ -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)
|
|
@ -58,7 +58,7 @@ class WebEmbedList(EmbeddedList):
|
|||||||
def __init__(self, dbstate, uistate, track, data):
|
def __init__(self, dbstate, uistate, track, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Internet'), WebModel, jump=True)
|
_('_Internet'), WebModel, jump=True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-url'
|
return 'gramps-url'
|
||||||
|
@ -50,7 +50,6 @@ from _MediaBackRefList import MediaBackRefList
|
|||||||
from _NameEmbedList import NameEmbedList
|
from _NameEmbedList import NameEmbedList
|
||||||
from _NoteBackRefList import NoteBackRefList
|
from _NoteBackRefList import NoteBackRefList
|
||||||
from _NoteTab import NoteTab
|
from _NoteTab import NoteTab
|
||||||
from _TextTab import TextTab
|
|
||||||
from _PersonEventEmbedList import PersonEventEmbedList
|
from _PersonEventEmbedList import PersonEventEmbedList
|
||||||
from _PersonRefEmbedList import PersonRefEmbedList
|
from _PersonRefEmbedList import PersonRefEmbedList
|
||||||
from _PersonBackRefList import PersonBackRefList
|
from _PersonBackRefList import PersonBackRefList
|
||||||
|
@ -91,7 +91,7 @@ class EditEventRef(EditReference):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
||||||
_('General'), tblref)
|
_('_General'), tblref)
|
||||||
|
|
||||||
def _init_event(self):
|
def _init_event(self):
|
||||||
self.commit_event = self.db.commit_personal_event
|
self.commit_event = self.db.commit_personal_event
|
||||||
|
@ -111,7 +111,7 @@ class ChildEmbedList(EmbeddedList):
|
|||||||
"""
|
"""
|
||||||
self.family = family
|
self.family = family
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track,
|
||||||
_('Children'), ChildModel, True, True)
|
_('_Children'), ChildModel, True, True)
|
||||||
|
|
||||||
def get_popup_menu_items(self):
|
def get_popup_menu_items(self):
|
||||||
return [
|
return [
|
||||||
|
@ -90,7 +90,7 @@ class EditMediaRef(EditReference):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
||||||
_('General'), tblref)
|
_('_General'), tblref)
|
||||||
|
|
||||||
def draw_preview(self):
|
def draw_preview(self):
|
||||||
"""
|
"""
|
||||||
@ -447,8 +447,8 @@ class EditMediaRef(EditReference):
|
|||||||
self.source.get_note_list(),
|
self.source.get_note_list(),
|
||||||
notetype=NoteType.MEDIA))
|
notetype=NoteType.MEDIA))
|
||||||
|
|
||||||
self._setup_notebook_tabs( notebook_src)
|
self._setup_notebook_tabs(notebook_src)
|
||||||
self._setup_notebook_tabs( notebook_ref)
|
self._setup_notebook_tabs(notebook_ref)
|
||||||
|
|
||||||
def save(self,*obj):
|
def save(self,*obj):
|
||||||
#first save primary object
|
#first save primary object
|
||||||
|
@ -120,7 +120,7 @@ class EditName(EditSecondary):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.gennam = GeneralNameTab(self.dbstate, self.uistate, self.track,
|
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_as = self.obj.get_group_as()
|
||||||
self.original_group_set = not (self.original_group_as == '')
|
self.original_group_set = not (self.original_group_as == '')
|
||||||
|
@ -198,7 +198,7 @@ class EditNote(EditPrimary):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.ntab = NoteTab(self.dbstate, self.uistate, self.track,
|
self.ntab = NoteTab(self.dbstate, self.uistate, self.track,
|
||||||
_('Note'), vboxnote)
|
_('_Note'), vboxnote)
|
||||||
|
|
||||||
self.build_interface()
|
self.build_interface()
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class MainLocTab(GrampsTab):
|
|||||||
eventbox.add(widget)
|
eventbox.add(widget)
|
||||||
self.pack_start(eventbox)
|
self.pack_start(eventbox)
|
||||||
self._set_label(show_image=False)
|
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()
|
self.show_all()
|
||||||
|
|
||||||
def is_empty(self):
|
def is_empty(self):
|
||||||
@ -125,7 +125,7 @@ class EditPlace(EditPrimary):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.mloc = MainLocTab(self.dbstate, self.uistate, self.track,
|
self.mloc = MainLocTab(self.dbstate, self.uistate, self.track,
|
||||||
_('Location'), tblmloc)
|
_('_Location'), tblmloc)
|
||||||
|
|
||||||
def get_menu_title(self):
|
def get_menu_title(self):
|
||||||
if self.obj and self.obj.get_handle():
|
if self.obj and self.obj.get_handle():
|
||||||
|
@ -103,6 +103,17 @@ class EditPrimary(ManagedWindow.ManagedWindow):
|
|||||||
page_no)
|
page_no)
|
||||||
child.set_parent_notebook(notebook)
|
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,
|
def _switch_page_on_dnd(self, widget, context, x, y, time, notebook,
|
||||||
page_no):
|
page_no):
|
||||||
if notebook.get_current_page() != page_no:
|
if notebook.get_current_page() != page_no:
|
||||||
@ -111,6 +122,7 @@ class EditPrimary(ManagedWindow.ManagedWindow):
|
|||||||
def _add_tab(self, notebook, page):
|
def _add_tab(self, notebook, page):
|
||||||
notebook.insert_page(page, page.get_tab_widget())
|
notebook.insert_page(page, page.get_tab_widget())
|
||||||
page.add_db_signal_callback(self._add_db_signal)
|
page.add_db_signal_callback(self._add_db_signal)
|
||||||
|
page.label.set_use_underline(True)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def _cleanup_on_exit(self):
|
def _cleanup_on_exit(self):
|
||||||
|
@ -141,6 +141,16 @@ class EditReference(ManagedWindow.ManagedWindow):
|
|||||||
notebook,
|
notebook,
|
||||||
page_no)
|
page_no)
|
||||||
child.set_parent_notebook(notebook)
|
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):
|
def _switch_page_on_dnd(self, widget, context, x, y, time, notebook, page_no):
|
||||||
if notebook.get_current_page() != page_no:
|
if notebook.get_current_page() != page_no:
|
||||||
@ -149,6 +159,7 @@ class EditReference(ManagedWindow.ManagedWindow):
|
|||||||
def _add_tab(self,notebook,page):
|
def _add_tab(self,notebook,page):
|
||||||
notebook.insert_page(page, page.get_tab_widget())
|
notebook.insert_page(page, page.get_tab_widget())
|
||||||
page.add_db_signal_callback(self._add_db_signal)
|
page.add_db_signal_callback(self._add_db_signal)
|
||||||
|
page.label.set_use_underline(True)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def _add_db_signal(self, name, callback):
|
def _add_db_signal(self, name, callback):
|
||||||
|
@ -85,7 +85,7 @@ class EditRepoRef(EditReference):
|
|||||||
#recreate start page as GrampsTab
|
#recreate start page as GrampsTab
|
||||||
notebook.remove_page(0)
|
notebook.remove_page(0)
|
||||||
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
|
||||||
_('General'), tblref)
|
_('_General'), tblref)
|
||||||
|
|
||||||
def _connect_signals(self):
|
def _connect_signals(self):
|
||||||
self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked)
|
self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked)
|
||||||
|
@ -93,6 +93,16 @@ class EditSecondary(ManagedWindow.ManagedWindow):
|
|||||||
notebook,
|
notebook,
|
||||||
page_no)
|
page_no)
|
||||||
child.set_parent_notebook(notebook)
|
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):
|
def _switch_page_on_dnd(self, widget, context, x, y, time, notebook, page_no):
|
||||||
if notebook.get_current_page() != page_no:
|
if notebook.get_current_page() != page_no:
|
||||||
@ -101,6 +111,7 @@ class EditSecondary(ManagedWindow.ManagedWindow):
|
|||||||
def _add_tab(self,notebook,page):
|
def _add_tab(self,notebook,page):
|
||||||
notebook.insert_page(page, page.get_tab_widget())
|
notebook.insert_page(page, page.get_tab_widget())
|
||||||
page.add_db_signal_callback(self._add_db_signal)
|
page.add_db_signal_callback(self._add_db_signal)
|
||||||
|
page.label.set_use_underline(True)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def _cleanup_on_exit(self):
|
def _cleanup_on_exit(self):
|
||||||
|
@ -43,7 +43,7 @@ import const
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
|
|
||||||
from DisplayTabs import \
|
from DisplayTabs import \
|
||||||
NoteTab,TextTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList
|
NoteTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList
|
||||||
from GrampsWidgets import *
|
from GrampsWidgets import *
|
||||||
from _EditReference import RefTab, EditReference
|
from _EditReference import RefTab, EditReference
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user