2007-10-18 Benny Malengier <benny.malengier@gramps-project.org>

* src/DisplayTabs/__init__.py: add note backref
	* src/glade/gramps.glade: add notebook to note editor to show backref
	* src/DisplayTabs/_NoteTab.py: import editnote in method to avoid import loop
	* src/Editors/_EditNote.py: add notetab of backreferences
	* src/DisplayTabs/_NoteBackRefList.py: note backreferences list
	* src/DisplayTabs/Makefile.am: new backref file
	* po/POTFILES.in: new backref file


svn: r9209
This commit is contained in:
Benny Malengier 2007-10-18 21:52:08 +00:00
parent f050646e31
commit 0f2327429e
8 changed files with 389 additions and 279 deletions

View File

@ -1,3 +1,12 @@
2007-10-18 Benny Malengier <benny.malengier@gramps-project.org>
* src/DisplayTabs/__init__.py: add note backref
* src/glade/gramps.glade: add notebook to note editor to show backref
* src/DisplayTabs/_NoteTab.py: import editnote in method to avoid import loop
* src/Editors/_EditNote.py: add notetab of backreferences
* src/DisplayTabs/_NoteBackRefList.py: note backreferences list
* src/DisplayTabs/Makefile.am: new backref file
* po/POTFILES.in: new backref file
2007-10-18 Benny Malengier <benny.malengier@gramps-project.org>
* src/DisplayModels/_BaseModel.py: remove comments
* src/DisplayModels/_NoteModel.py: show all notes again in note view

View File

@ -149,6 +149,7 @@ src/DisplayTabs/_LocationModel.py
src/DisplayTabs/_MediaBackRefList.py
src/DisplayTabs/_NameEmbedList.py
#src/DisplayTabs/_NameModel.py
src/DisplayTabs/_NoteBackRefList.py
src/DisplayTabs/_NoteTab.py
src/DisplayTabs/_TextTab.py
src/DisplayTabs/_PersonEventEmbedList.py

View File

@ -28,6 +28,7 @@ pkgdata_PYTHON = \
_MediaBackRefList.py \
_NameEmbedList.py \
_NameModel.py \
_NoteBackRefList.py \
_NoteTab.py \
_NoteModel.py \
_TextTab.py \

View File

@ -0,0 +1,39 @@
#
# 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: _NoteBackRefList.py 7068 2006-07-24 23:06:49Z rshura $
#-------------------------------------------------------------------------
#
# GRAMPS classes
#
#-------------------------------------------------------------------------
from _BackRefModel import BackRefModel
from _BackRefList import BackRefList
class NoteBackRefList(BackRefList):
def __init__(self, dbstate, uistate, track, obj, callback=None):
BackRefList.__init__(self, dbstate, uistate, track, obj,
BackRefModel, callback=callback)
def get_icon_name(self):
return 'gramps-notes'

View File

@ -46,7 +46,6 @@ import gen.lib
from DisplayTabs import log
from _NoteModel import NoteModel
from _EmbeddedList import EmbeddedList
from Editors import EditNote
from DdTargets import DdTargets
#-------------------------------------------------------------------------
@ -108,6 +107,7 @@ class NoteTab(EmbeddedList):
if self.notetype :
note.set_type(self.notetype)
try:
from Editors import EditNote
EditNote(self.dbstate, self.uistate, self.track,
note, self.add_callback,
self.callertitle, extratype = [self.notetype])
@ -124,6 +124,7 @@ class NoteTab(EmbeddedList):
if handle:
note = self.dbstate.db.get_note_from_handle(handle)
try:
from Editors import EditNote
EditNote(self.dbstate, self.uistate, self.track, note,
self.edit_callback, self.callertitle,
extratype = [self.notetype] )

View File

@ -47,6 +47,7 @@ from _LdsEmbedList import LdsEmbedList
from _LocationEmbedList import LocationEmbedList
from _MediaBackRefList import MediaBackRefList
from _NameEmbedList import NameEmbedList
from _NoteBackRefList import NoteBackRefList
from _NoteTab import NoteTab
from _TextTab import TextTab
from _PersonEventEmbedList import PersonEventEmbedList

View File

@ -46,6 +46,7 @@ import Config
import GrampsDisplay
import MarkupText
from _EditPrimary import EditPrimary
from DisplayTabs import NoteBackRefList
from GrampsWidgets import *
from gen.lib import Note
@ -186,6 +187,24 @@ class EditNote(EditPrimary):
self.define_cancel_button(self.top.get_widget('cancel'))
self.define_help_button(self.top.get_widget('help'), '')
def _create_tabbed_pages(self):
"""
Creates the notebook tabs and inserts them into the main
window.
"""
notebook = self.top.get_widget("note_notebook")
self.backref_tab = self._add_tab(
notebook,
NoteBackRefList(self.dbstate, self.uistate, self.track,
self.dbstate.db.find_backlink_handles(
self.obj.handle))
)
self._setup_notebook_tabs( notebook)
notebook.show_all()
def build_interface(self):
FORMAT_TOOLBAR = '''
<ui>

View File

@ -15297,6 +15297,16 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkNotebook" id="note_notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<child>
<widget class="GtkVBox" id="vbox131">
<property name="visible">True</property>
@ -15630,6 +15640,35 @@ Very High</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label715">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;_Note&lt;/b&gt;</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>