* src/DisplayTabs/Makefile.am (pkgdata_PYTHON): Ship new file.
	* src/DisplayTabs/__init__.py: Import new module.
	* src/DisplayTabs/_TextTab.py: Add new module.
	* src/Editors/_EditSourceRef.py (_setup_fields): Remove Text tab;
	(_create_tabbed_pages): Add Text tab.
	* src/glade/gramps.glade (source_ref_edit): Remove Text tab.
In po:
2006-06-15  Alex Roitman  <shura@gramps-project.org>
	* POTFILES.in: Add new file.



svn: r6894
This commit is contained in:
Alex Roitman 2006-06-15 17:17:42 +00:00
parent ad07424022
commit e070e77c14
8 changed files with 128 additions and 68 deletions

View File

@ -1,4 +1,10 @@
2006-06-15 Alex Roitman <shura@gramps-project.org>
* src/DisplayTabs/Makefile.am (pkgdata_PYTHON): Ship new file.
* src/DisplayTabs/__init__.py: Import new module.
* src/DisplayTabs/_TextTab.py: Add new module.
* src/Editors/_EditSourceRef.py (_setup_fields): Remove Text tab;
(_create_tabbed_pages): Add Text tab.
* src/glade/gramps.glade (source_ref_edit): Remove Text tab.
* src/GrampsDb/_WriteGedcom.py (write_photo): Typo.
* src/Exporter.py (build_options): Correctly shift all pages.

View File

@ -1,3 +1,6 @@
2006-06-15 Alex Roitman <shura@gramps-project.org>
* POTFILES.in: Add new file.
2006-06-11 Alex Roitman <shura@gramps-project.org>
* POTFILES.in: Remove plugin that is not shipped.
* gramps.pot: Update.

View File

@ -130,6 +130,7 @@ src/DisplayTabs/_MediaBackRefList.py
src/DisplayTabs/_NameEmbedList.py
src/DisplayTabs/_NameModel.py
src/DisplayTabs/_NoteTab.py
src/DisplayTabs/_TextTab.py
src/DisplayTabs/_PersonEventEmbedList.py
src/DisplayTabs/_PersonRefEmbedList.py
src/DisplayTabs/_PersonRefModel.py

View File

@ -29,6 +29,7 @@ pkgdata_PYTHON = \
_NameEmbedList.py \
_NameModel.py \
_NoteTab.py \
_TextTab.py \
_PersonEventEmbedList.py \
_PersonRefEmbedList.py \
_PersonRefModel.py \

View File

@ -0,0 +1,108 @@
#
# 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
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_with_viewport(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()

View File

@ -48,6 +48,7 @@ from _LocationEmbedList import LocationEmbedList
from _MediaBackRefList import MediaBackRefList
from _NameEmbedList import NameEmbedList
from _NoteTab import NoteTab
from _TextTab import TextTab
from _PersonEventEmbedList import PersonEventEmbedList
from _PersonRefEmbedList import PersonRefEmbedList
from _PlaceBackRefList import PlaceBackRefList

View File

@ -49,7 +49,7 @@ import const
import RelLib
from DisplayTabs import \
NoteTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList
NoteTab,TextTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList
from GrampsWidgets import *
from _EditReference import EditReference
@ -107,10 +107,6 @@ class EditSourceRef(EditReference):
self.top.get_widget('pub_info'), self.source.set_publication_info,
self.source.get_publication_info,False)
self.text_data = MonitoredText(
self.top.get_widget('text'), self.source_ref.set_text,
self.source_ref.get_text,False)
self.type_mon = MonitoredMenu(
self.top.get_widget('confidence'),
self.source_ref.set_confidence_level,
@ -121,7 +117,6 @@ class EditSourceRef(EditReference):
(_('High'), RelLib.SourceRef.CONF_HIGH),
(_('Very High'), RelLib.SourceRef.CONF_VERY_HIGH)])
self.date = MonitoredDate(
self.top.get_widget("date"),
self.top.get_widget("date_stat"),
@ -167,6 +162,10 @@ class EditSourceRef(EditReference):
self.enable_warnbox
))
self.text_tab = self._add_tab(
notebook_ref,
TextTab(self.dbstate, self.uistate, self.track,self.source_ref))
self.comment_tab = self._add_tab(
notebook_ref,
NoteTab(self.dbstate, self.uistate, self.track,
@ -195,4 +194,3 @@ class EditSourceRef(EditReference):
self.update(self.source_ref,self.source)
self.close()

View File

@ -13625,67 +13625,9 @@ Very High</property>
<child>
<widget class="GtkLabel" id="label612">
<property name="visible">True</property>
<property name="label" translatable="yes">General</property>
<property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">False</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>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow101">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label615">
<property name="visible">True</property>
<property name="label" translatable="yes">Text</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -14078,7 +14020,7 @@ Very High</property>
<child>
<widget class="GtkLabel" id="label609">
<property name="visible">True</property>
<property name="label" translatable="yes">General</property>
<property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>