2008-02-24 Raphael Ackermann <raphael.ackermann@gmail.com>
* Editors/_EditRepository.py * Editors/_EditFamily.py * DisplayTabs/_SourceEmbedList.py * DisplayTabs/_PersonRefEmbedList.py * DisplayTabs/_RepoEmbedList.py * DisplayTabs/_AddrEmbedList.py * DisplayTabs/_WebEmbedList.py * DisplayTabs/_NameEmbedList.py * DisplayTabs/_EventEmbedList.py * DisplayTabs/_EmbeddedList.py * DisplayTabs/_NoteTab.py * DisplayTabs/_LocationEmbedList.py * DisplayTabs/_ButtonTab.py * DisplayTabs/_DataEmbedList.py * DisplayTabs/_AttrEmbedList.py * DisplayTabs/_LdsEmbedList.py * DisplayTabs/_GrampsTab.py add Up and Down buttons to the tabs. Added individual tooltips for buttons 0001807: Missing buttons MoveUp, MoveDown on a Events list in a person... svn: r10108
This commit is contained in:
parent
f6f9fbafdc
commit
20426f36e3
23
ChangeLog
23
ChangeLog
@ -1,3 +1,24 @@
|
|||||||
|
2008-02-24 Raphael Ackermann <raphael.ackermann@gmail.com>
|
||||||
|
* Editors/_EditRepository.py
|
||||||
|
* Editors/_EditFamily.py
|
||||||
|
* DisplayTabs/_SourceEmbedList.py
|
||||||
|
* DisplayTabs/_PersonRefEmbedList.py
|
||||||
|
* DisplayTabs/_RepoEmbedList.py
|
||||||
|
* DisplayTabs/_AddrEmbedList.py
|
||||||
|
* DisplayTabs/_WebEmbedList.py
|
||||||
|
* DisplayTabs/_NameEmbedList.py
|
||||||
|
* DisplayTabs/_EventEmbedList.py
|
||||||
|
* DisplayTabs/_EmbeddedList.py
|
||||||
|
* DisplayTabs/_NoteTab.py
|
||||||
|
* DisplayTabs/_LocationEmbedList.py
|
||||||
|
* DisplayTabs/_ButtonTab.py
|
||||||
|
* DisplayTabs/_DataEmbedList.py
|
||||||
|
* DisplayTabs/_AttrEmbedList.py
|
||||||
|
* DisplayTabs/_LdsEmbedList.py
|
||||||
|
* DisplayTabs/_GrampsTab.py
|
||||||
|
add Up and Down buttons to the tabs. Added individual tooltips for buttons
|
||||||
|
0001807: Missing buttons MoveUp, MoveDown on a Events list in a person...
|
||||||
|
|
||||||
2008-02-22 Gary Burton <gary.burton@zen.co.uk>
|
2008-02-22 Gary Burton <gary.burton@zen.co.uk>
|
||||||
* src/Editors/_EditPerson.py: Fixed crash on clicking OK to save name
|
* src/Editors/_EditPerson.py: Fixed crash on clicking OK to save name
|
||||||
change. Bug #1783
|
change. Bug #1783
|
||||||
@ -16,7 +37,7 @@
|
|||||||
* src/glade/gramps.glade: changed tooltip from "close" to "delete"
|
* src/glade/gramps.glade: changed tooltip from "close" to "delete"
|
||||||
Gramplets are either undeleted before exit, or they go away
|
Gramplets are either undeleted before exit, or they go away
|
||||||
|
|
||||||
2008-02-22 Raphael Ackermann <raphael.ackermann@gmail.com>
|
2008-02-24 Raphael Ackermann <raphael.ackermann@gmail.com>
|
||||||
* various (294 files)
|
* various (294 files)
|
||||||
pep8 doc fixes & pylint fixes
|
pep8 doc fixes & pylint fixes
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Address List display tab
|
Address List display tab.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -39,8 +39,8 @@ from gettext import gettext as _
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
import Errors
|
import Errors
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
from _AddressModel import AddressModel
|
from DisplayTabs._AddressModel import AddressModel
|
||||||
from _EmbeddedList import EmbeddedList
|
from DisplayTabs._EmbeddedList import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -49,13 +49,22 @@ from _EmbeddedList import EmbeddedList
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class AddrEmbedList(EmbeddedList):
|
class AddrEmbedList(EmbeddedList):
|
||||||
"""
|
"""
|
||||||
Address List display tab for edit dialogs. Derives from the EmbeddedList
|
Address List display tab for edit dialogs.
|
||||||
class.
|
|
||||||
|
Derives from the EmbeddedList class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_HANDLE_COL = 5
|
_HANDLE_COL = 5
|
||||||
_DND_TYPE = DdTargets.ADDRESS
|
_DND_TYPE = DdTargets.ADDRESS
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new address'),
|
||||||
|
'del' : _('Remove the existing address'),
|
||||||
|
'edit' : _('Edit the selected address'),
|
||||||
|
'up' : _('Move the selected address upwards'),
|
||||||
|
'down' : _('Move the selected address downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Date'), 0, 150),
|
(_('Date'), 0, 150),
|
||||||
(_('Address'), 1, 225),
|
(_('Address'), 1, 225),
|
||||||
@ -66,8 +75,8 @@ 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'),
|
||||||
_('_Addresses'), AddressModel)
|
AddressModel, move_buttons=True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
"""
|
"""
|
||||||
@ -89,7 +98,7 @@ class AddrEmbedList(EmbeddedList):
|
|||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
"""
|
"""
|
||||||
Called with the Add button is clicked. Creates a new Address instance
|
Called when the Add button is clicked. Creates a new Address instance
|
||||||
and calls the EditAddress editor with the new address. If the window
|
and calls the EditAddress editor with the new address. If the window
|
||||||
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
||||||
the dialog from coming up twice on the same object.
|
the dialog from coming up twice on the same object.
|
||||||
|
@ -35,8 +35,8 @@ from gettext import gettext as _
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
import Errors
|
import Errors
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
from _AttrModel import AttrModel
|
from DisplayTabs._AttrModel import AttrModel
|
||||||
from _EmbeddedList import EmbeddedList
|
from DisplayTabs._EmbeddedList import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -48,6 +48,14 @@ class AttrEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 2
|
_HANDLE_COL = 2
|
||||||
_DND_TYPE = DdTargets.ATTRIBUTE
|
_DND_TYPE = DdTargets.ATTRIBUTE
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new attribute'),
|
||||||
|
'del' : _('Remove the existing attribute'),
|
||||||
|
'edit' : _('Edit the selected attribute'),
|
||||||
|
'up' : _('Move the selected attribute upwards'),
|
||||||
|
'down' : _('Move the selected attribute downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Type'), 0, 250),
|
(_('Type'), 0, 250),
|
||||||
(_('Value'), 1, 200),
|
(_('Value'), 1, 200),
|
||||||
@ -55,8 +63,8 @@ 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'),
|
||||||
_('_Attributes'), AttrModel)
|
AttrModel, move_buttons=True)
|
||||||
|
|
||||||
def get_editor(self):
|
def get_editor(self):
|
||||||
from Editors import EditAttribute
|
from Editors import EditAttribute
|
||||||
|
@ -76,7 +76,8 @@ class ButtonTab(GrampsTab):
|
|||||||
def __init__(self, dbstate, uistate, track, name, share_button=False,
|
def __init__(self, dbstate, uistate, track, name, share_button=False,
|
||||||
move_buttons=False, jump_button=False):
|
move_buttons=False, jump_button=False):
|
||||||
"""
|
"""
|
||||||
Similar to the base class, except after Build
|
Similar to the base class, except after Build.
|
||||||
|
|
||||||
@param dbstate: The database state. Contains a reference to
|
@param dbstate: The database state. Contains a reference to
|
||||||
the database, along with other state information. The GrampsTab
|
the database, along with other state information. The GrampsTab
|
||||||
uses this to access the database and to pass to and created
|
uses this to access the database and to pass to and created
|
||||||
@ -103,8 +104,10 @@ class ButtonTab(GrampsTab):
|
|||||||
def create_buttons(self, share_button, move_buttons, jump_button):
|
def create_buttons(self, share_button, move_buttons, jump_button):
|
||||||
"""
|
"""
|
||||||
Create a button box consisting of three buttons, one for Add,
|
Create a button box consisting of three buttons, one for Add,
|
||||||
one for Edit, and one for Delete. This button box is then appended
|
one for Edit, and one for Delete.
|
||||||
hbox (self).
|
|
||||||
|
Add buttons for Share, Move and Jump depending on parameters. This
|
||||||
|
button box is then appended hbox (self).
|
||||||
"""
|
"""
|
||||||
self.add_btn = SimpleButton(gtk.STOCK_ADD, self.add_button_clicked)
|
self.add_btn = SimpleButton(gtk.STOCK_ADD, self.add_button_clicked)
|
||||||
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
||||||
|
@ -32,8 +32,8 @@ from gettext import gettext as _
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from _DataModel import DataModel
|
from DisplayTabs._DataModel import DataModel
|
||||||
from _EmbeddedList import EmbeddedList
|
from DisplayTabs._EmbeddedList import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -45,6 +45,14 @@ class DataEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 0
|
_HANDLE_COL = 0
|
||||||
_DND_TYPE = None
|
_DND_TYPE = None
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new data entry'),
|
||||||
|
'del' : _('Remove the existing data entry'),
|
||||||
|
'edit' : _('Edit the selected data entry'),
|
||||||
|
'up' : _('Move the selected data entry upwards'),
|
||||||
|
'down' : _('Move the selected data entry downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Key'), 0, 150),
|
(_('Key'), 0, 150),
|
||||||
(_('Value'), 1, 250),
|
(_('Value'), 1, 250),
|
||||||
@ -53,8 +61,8 @@ class DataEmbedList(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, _('_Data'),
|
||||||
_('_Data'), DataModel)
|
DataModel, move_buttons=True)
|
||||||
|
|
||||||
def build_columns(self):
|
def build_columns(self):
|
||||||
EmbeddedList.build_columns(self)
|
EmbeddedList.build_columns(self)
|
||||||
|
@ -41,7 +41,7 @@ import pango
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from _ButtonTab import ButtonTab
|
from DisplayTabs._ButtonTab import ButtonTab
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -50,9 +50,9 @@ from _ButtonTab import ButtonTab
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class EmbeddedList(ButtonTab):
|
class EmbeddedList(ButtonTab):
|
||||||
"""
|
"""
|
||||||
This class provides the base class for all the list tabs. It
|
This class provides the base class for all the list tabs.
|
||||||
maintains a gtk.TreeView, including the selection and button
|
|
||||||
sensitivity.
|
It maintains a gtk.TreeView, including the selection and button sensitivity.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_HANDLE_COL = -1
|
_HANDLE_COL = -1
|
||||||
@ -60,12 +60,12 @@ class EmbeddedList(ButtonTab):
|
|||||||
_DND_EXTRA = None
|
_DND_EXTRA = None
|
||||||
|
|
||||||
def __init__(self, dbstate, uistate, track, name, build_model,
|
def __init__(self, dbstate, uistate, track, name, build_model,
|
||||||
share=False, move=False, jump=False):
|
share_button=False, move_buttons=False, jump_button=False):
|
||||||
"""
|
"""
|
||||||
Create a new list, using the passed build_model to
|
Create a new list, using the passed build_model to populate the list.
|
||||||
populate the list.
|
|
||||||
"""
|
"""
|
||||||
ButtonTab.__init__(self, dbstate, uistate, track, name, share, move, jump)
|
ButtonTab.__init__(self, dbstate, uistate, track, name, share_button,
|
||||||
|
move_buttons, jump_button)
|
||||||
|
|
||||||
self.changed = False
|
self.changed = False
|
||||||
self.build_model = build_model
|
self.build_model = build_model
|
||||||
@ -262,7 +262,7 @@ class EmbeddedList(ButtonTab):
|
|||||||
self.changed = True
|
self.changed = True
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
|
||||||
def _move_up(self, row_from, obj,selmethod=None):
|
def _move_up(self, row_from, obj, selmethod=None):
|
||||||
"""
|
"""
|
||||||
Move the item a position up in the EmbeddedList.
|
Move the item a position up in the EmbeddedList.
|
||||||
Eg: 0,1,2,3 needs to become 0,2,1,3, here row_from = 2
|
Eg: 0,1,2,3 needs to become 0,2,1,3, here row_from = 2
|
||||||
|
@ -54,6 +54,8 @@ class EventEmbedList(EmbeddedList):
|
|||||||
'del' : _('Remove the selected event'),
|
'del' : _('Remove the selected event'),
|
||||||
'edit' : _('Edit the selected event'),
|
'edit' : _('Edit the selected event'),
|
||||||
'share' : _('Share an existing event'),
|
'share' : _('Share an existing event'),
|
||||||
|
'up' : _('Move the selected event upwards'),
|
||||||
|
'down' : _('Move the selected event downwards'),
|
||||||
}
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
@ -67,8 +69,9 @@ 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'),
|
||||||
_('_Events'), EventRefModel, True)
|
EventRefModel, share_button=True,
|
||||||
|
move_buttons=True)
|
||||||
|
|
||||||
def get_ref_editor(self):
|
def get_ref_editor(self):
|
||||||
from Editors import EditFamilyEventRef
|
from Editors import EditFamilyEventRef
|
||||||
|
@ -39,9 +39,10 @@ _RIGHT = gtk.gdk.keyval_from_name("Right")
|
|||||||
class GrampsTab(gtk.HBox):
|
class GrampsTab(gtk.HBox):
|
||||||
"""
|
"""
|
||||||
This class provides the base level class for 'tabs', which are used to
|
This class provides the base level class for 'tabs', which are used to
|
||||||
fill in notebook tabs for GRAMPS edit dialogs. Each tab returns a
|
fill in notebook tabs for GRAMPS edit dialogs.
|
||||||
gtk container widget which can be inserted into a gtk.Notebook by the
|
|
||||||
instantiating object.
|
Each tab returns a gtk container widget which can be inserted into a
|
||||||
|
gtk.Notebook by the instantiating object.
|
||||||
|
|
||||||
All tab classes should inherit from GrampsTab
|
All tab classes should inherit from GrampsTab
|
||||||
"""
|
"""
|
||||||
|
@ -47,6 +47,14 @@ class LdsEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 5
|
_HANDLE_COL = 5
|
||||||
# _DND_TYPE = DdTargets.ADDRESS
|
# _DND_TYPE = DdTargets.ADDRESS
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new LDS ordinance'),
|
||||||
|
'del' : _('Remove the existing LDS ordinance'),
|
||||||
|
'edit' : _('Edit the selected LDS ordinance'),
|
||||||
|
'up' : _('Move the selected LDS ordinance upwards'),
|
||||||
|
'down' : _('Move the selected LDS ordinance downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Type'), 0, 150),
|
(_('Type'), 0, 150),
|
||||||
(_('Date'), 1, 150),
|
(_('Date'), 1, 150),
|
||||||
@ -57,8 +65,8 @@ 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'),
|
||||||
_('_LDS'), LdsModel)
|
LdsModel, move_buttons=True)
|
||||||
|
|
||||||
def get_editor(self):
|
def get_editor(self):
|
||||||
from Editors import EditLdsOrd
|
from Editors import EditLdsOrd
|
||||||
|
@ -47,7 +47,7 @@ class LocationEmbedList(EmbeddedList):
|
|||||||
|
|
||||||
_HANDLE_COL = 5
|
_HANDLE_COL = 5
|
||||||
_DND_TYPE = DdTargets.LOCATION
|
_DND_TYPE = DdTargets.LOCATION
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Street'), 0, 150),
|
(_('Street'), 0, 150),
|
||||||
(_('City'), 1, 100),
|
(_('City'), 1, 100),
|
||||||
@ -59,7 +59,8 @@ 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,
|
||||||
|
move_buttons=True)
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return self.data
|
return self.data
|
||||||
|
@ -42,8 +42,8 @@ from gettext import gettext as _
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
import Errors
|
import Errors
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
from _NameModel import NameModel
|
from DisplayTabs._NameModel import NameModel
|
||||||
from _EmbeddedList import EmbeddedList
|
from DisplayTabs._EmbeddedList import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -55,6 +55,14 @@ class NameEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 2
|
_HANDLE_COL = 2
|
||||||
_DND_TYPE = DdTargets.NAME
|
_DND_TYPE = DdTargets.NAME
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new name'),
|
||||||
|
'del' : _('Remove the existing name'),
|
||||||
|
'edit' : _('Edit the selected name'),
|
||||||
|
'up' : _('Move the selected name upwards'),
|
||||||
|
'down' : _('Move the selected name downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Name'), 0, 250),
|
(_('Name'), 0, 250),
|
||||||
(_('Type'), 1, 100),
|
(_('Type'), 1, 100),
|
||||||
@ -65,8 +73,8 @@ class NameEmbedList(EmbeddedList):
|
|||||||
self.person = person
|
self.person = person
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track, _('_Names'),
|
||||||
_('_Names'), NameModel)
|
NameModel, move_buttons=True)
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return self.data
|
return self.data
|
||||||
|
@ -50,6 +50,11 @@ from DdTargets import DdTargets
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class NoteTab(EmbeddedList):
|
class NoteTab(EmbeddedList):
|
||||||
|
"""
|
||||||
|
Note List display tab for edit dialogs.
|
||||||
|
|
||||||
|
Derives from the EmbeddedList class.
|
||||||
|
"""
|
||||||
|
|
||||||
_HANDLE_COL = 2
|
_HANDLE_COL = 2
|
||||||
_DND_TYPE = DdTargets.NOTE_LINK
|
_DND_TYPE = DdTargets.NOTE_LINK
|
||||||
@ -74,7 +79,8 @@ 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_button=True,
|
||||||
|
move_buttons=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
|
||||||
@ -89,12 +95,26 @@ class NoteTab(EmbeddedList):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
|
"""
|
||||||
|
Return the data associated with display tab
|
||||||
|
"""
|
||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
def column_order(self):
|
def column_order(self):
|
||||||
|
"""
|
||||||
|
Return the column order of the columns in the display tab.
|
||||||
|
"""
|
||||||
return ((1, 0), (1, 1))
|
return ((1, 0), (1, 1))
|
||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
|
"""
|
||||||
|
Create a new Note instance and call the EditNote editor with the new
|
||||||
|
note.
|
||||||
|
|
||||||
|
Called when the Add button is clicked.
|
||||||
|
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||||
|
This prevents the dialog from coming up twice on the same object.
|
||||||
|
"""
|
||||||
note = gen.lib.Note()
|
note = gen.lib.Note()
|
||||||
if self.notetype :
|
if self.notetype :
|
||||||
note.set_type(self.notetype)
|
note.set_type(self.notetype)
|
||||||
@ -107,11 +127,22 @@ class NoteTab(EmbeddedList):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def add_callback(self, name):
|
def add_callback(self, name):
|
||||||
|
"""
|
||||||
|
Called to update the screen when a new note is added
|
||||||
|
"""
|
||||||
self.get_data().append(name)
|
self.get_data().append(name)
|
||||||
self.changed = True
|
self.changed = True
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
|
||||||
def edit_button_clicked(self, obj):
|
def edit_button_clicked(self, obj):
|
||||||
|
"""
|
||||||
|
Get the selected Note instance and call the EditNote editor with the
|
||||||
|
note.
|
||||||
|
|
||||||
|
Called when the Edit button is clicked.
|
||||||
|
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||||
|
This prevents the dialog from coming up twice on the same object.
|
||||||
|
"""
|
||||||
handle = self.get_selected()
|
handle = self.get_selected()
|
||||||
if handle:
|
if handle:
|
||||||
note = self.dbstate.db.get_note_from_handle(handle)
|
note = self.dbstate.db.get_note_from_handle(handle)
|
||||||
@ -133,6 +164,9 @@ class NoteTab(EmbeddedList):
|
|||||||
self.add_callback(note.handle)
|
self.add_callback(note.handle)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
|
"""
|
||||||
|
Return the stock-id icon name associated with the display tab
|
||||||
|
"""
|
||||||
return 'gramps-notes'
|
return 'gramps-notes'
|
||||||
|
|
||||||
def note_delete(self, del_note_handle_list):
|
def note_delete(self, del_note_handle_list):
|
||||||
@ -140,7 +174,7 @@ class NoteTab(EmbeddedList):
|
|||||||
Outside of this tab note objects have been deleted. Check if tab
|
Outside of this tab note objects have been deleted. Check if tab
|
||||||
and object must be changed.
|
and object must be changed.
|
||||||
Note: delete of object will cause reference on database to be removed,
|
Note: delete of object will cause reference on database to be removed,
|
||||||
so this method need not do this
|
so this method need not do this
|
||||||
"""
|
"""
|
||||||
rebuild = False
|
rebuild = False
|
||||||
for handle in del_note_handle_list :
|
for handle in del_note_handle_list :
|
||||||
@ -155,7 +189,6 @@ class NoteTab(EmbeddedList):
|
|||||||
Outside of this tab note objects have been updated. Check if tab
|
Outside of this tab note objects have been updated. Check if tab
|
||||||
and object must be updated.
|
and object must be updated.
|
||||||
"""
|
"""
|
||||||
ref_handles = self.data
|
|
||||||
for handle in upd_note_handle_list :
|
for handle in upd_note_handle_list :
|
||||||
if handle in self.data:
|
if handle in self.data:
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
@ -48,6 +48,14 @@ class PersonRefEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 3
|
_HANDLE_COL = 3
|
||||||
_DND_TYPE = DdTargets.PERSONREF
|
_DND_TYPE = DdTargets.PERSONREF
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new association'),
|
||||||
|
'del' : _('Remove the existing association'),
|
||||||
|
'edit' : _('Edit the selected association'),
|
||||||
|
'up' : _('Move the selected association upwards'),
|
||||||
|
'down' : _('Move the selected association downwards'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Name'), 0, 250),
|
(_('Name'), 0, 250),
|
||||||
(_('ID'), 1, 100),
|
(_('ID'), 1, 100),
|
||||||
@ -57,7 +65,8 @@ 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)
|
_('_Associations'), PersonRefModel,
|
||||||
|
move_buttons=True)
|
||||||
|
|
||||||
def get_ref_editor(self):
|
def get_ref_editor(self):
|
||||||
from Editors import EditPersonRef
|
from Editors import EditPersonRef
|
||||||
|
@ -54,6 +54,8 @@ class RepoEmbedList(EmbeddedList):
|
|||||||
'del' : _('Remove the existing repository'),
|
'del' : _('Remove the existing repository'),
|
||||||
'edit' : _('Edit the selected repository'),
|
'edit' : _('Edit the selected repository'),
|
||||||
'share' : _('Add an existing repository'),
|
'share' : _('Add an existing repository'),
|
||||||
|
'up' : _('Move the selected repository upwards'),
|
||||||
|
'down' : _('Move the selected repository downwards'),
|
||||||
}
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
@ -66,7 +68,8 @@ 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,
|
||||||
|
share_button=True, move_buttons=True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-repository'
|
return 'gramps-repository'
|
||||||
|
@ -54,6 +54,8 @@ class SourceEmbedList(EmbeddedList):
|
|||||||
'del' : _('Remove the existing source'),
|
'del' : _('Remove the existing source'),
|
||||||
'edit' : _('Edit the selected source'),
|
'edit' : _('Edit the selected source'),
|
||||||
'share' : _('Add an existing source'),
|
'share' : _('Add an existing source'),
|
||||||
|
'up' : _('Move the selected source upwards'),
|
||||||
|
'down' : _('Move the selected source downwards'),
|
||||||
}
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
@ -65,8 +67,9 @@ 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'),
|
||||||
_('_Sources'), SourceRefModel, True)
|
SourceRefModel, share_button=True,
|
||||||
|
move_buttons=True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-source'
|
return 'gramps-source'
|
||||||
|
@ -49,6 +49,15 @@ class WebEmbedList(EmbeddedList):
|
|||||||
_HANDLE_COL = 3
|
_HANDLE_COL = 3
|
||||||
_DND_TYPE = DdTargets.URL
|
_DND_TYPE = DdTargets.URL
|
||||||
|
|
||||||
|
_MSG = {
|
||||||
|
'add' : _('Create and add a new web address'),
|
||||||
|
'del' : _('Remove the existing web address'),
|
||||||
|
'edit' : _('Edit the selected web address'),
|
||||||
|
'up' : _('Move the selected web address upwards'),
|
||||||
|
'down' : _('Move the selected web address downwards'),
|
||||||
|
'jump' : _('Jump to the selected web address'),
|
||||||
|
}
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Type') , 0, 100),
|
(_('Type') , 0, 100),
|
||||||
(_('Path') , 1, 200),
|
(_('Path') , 1, 200),
|
||||||
@ -57,8 +66,8 @@ 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'),
|
||||||
_('_Internet'), WebModel, jump=True)
|
WebModel, move_buttons=True, jump_button=True)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
return 'gramps-url'
|
return 'gramps-url'
|
||||||
|
@ -114,8 +114,8 @@ class ChildEmbedList(EmbeddedList):
|
|||||||
Create the object, storing the passed family value
|
Create the object, storing the passed family value
|
||||||
"""
|
"""
|
||||||
self.family = family
|
self.family = family
|
||||||
EmbeddedList.__init__(self, dbstate, uistate, track,
|
EmbeddedList.__init__(self, dbstate, uistate, track, _('_Children'),
|
||||||
_('_Children'), ChildModel, True, True)
|
ChildModel, share_button=True, move_buttons=True)
|
||||||
|
|
||||||
def get_popup_menu_items(self):
|
def get_popup_menu_items(self):
|
||||||
return [
|
return [
|
||||||
|
@ -109,25 +109,25 @@ class EditRepository(EditPrimary):
|
|||||||
notebook = gtk.Notebook()
|
notebook = gtk.Notebook()
|
||||||
|
|
||||||
self.addr_tab = self._add_tab(
|
self.addr_tab = self._add_tab(
|
||||||
notebook,
|
notebook,
|
||||||
AddrEmbedList(self.dbstate, self.uistate, self.track,
|
AddrEmbedList(self.dbstate, self.uistate, self.track,
|
||||||
self.obj.get_address_list()))
|
self.obj.get_address_list()))
|
||||||
|
|
||||||
self.url_tab = self._add_tab(
|
self.url_tab = self._add_tab(
|
||||||
notebook,
|
notebook,
|
||||||
WebEmbedList(self.dbstate, self.uistate, self.track,
|
WebEmbedList(self.dbstate, self.uistate, self.track,
|
||||||
self.obj.get_url_list()))
|
self.obj.get_url_list()))
|
||||||
|
|
||||||
self.note_tab = self._add_tab(
|
self.note_tab = self._add_tab(
|
||||||
notebook,
|
notebook,
|
||||||
NoteTab(self.dbstate, self.uistate, self.track,
|
NoteTab(self.dbstate, self.uistate, self.track,
|
||||||
self.obj.get_note_list(), self.get_menu_title(),
|
self.obj.get_note_list(), self.get_menu_title(),
|
||||||
notetype=gen.lib.NoteType.REPO))
|
notetype=gen.lib.NoteType.REPO))
|
||||||
|
|
||||||
self.backref_tab = self._add_tab(
|
self.backref_tab = self._add_tab(
|
||||||
notebook,
|
notebook,
|
||||||
SourceBackRefList(self.dbstate, self.uistate, self.track,
|
SourceBackRefList(self.dbstate, self.uistate, self.track,
|
||||||
self.db.find_backlink_handles(self.obj.handle)))
|
self.db.find_backlink_handles(self.obj.handle)))
|
||||||
|
|
||||||
self._setup_notebook_tabs( notebook)
|
self._setup_notebook_tabs( notebook)
|
||||||
notebook.show_all()
|
notebook.show_all()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user