* src/Config/_GrampsConfigKeys.py: remember editor size

* src/Editors/_EditPlace.py: remember editor size
	* src/Editors/_EditSource.py: remember editor size
	* src/Editors/_EditPerson.py: remember editor size
	* src/Editors/_EditMedia.py: remember editor size
	* src/Editors/_EditRepository.py: remember editor size
	* src/Editors/_EditEvent.py: remember editor size
	* src/glade/gramps.glade: remember editor size
	* data/gramps.schemas.in: remember editor size


svn: r7695
This commit is contained in:
Don Allingham 2006-11-26 01:29:58 +00:00
parent e824a00edc
commit 49a99e7815
10 changed files with 248 additions and 161 deletions

View File

@ -1,4 +1,13 @@
2006-11-25 Don Allingham <don@gramps-project.org>
* src/Config/_GrampsConfigKeys.py: remember editor size
* src/Editors/_EditPlace.py: remember editor size
* src/Editors/_EditSource.py: remember editor size
* src/Editors/_EditPerson.py: remember editor size
* src/Editors/_EditMedia.py: remember editor size
* src/Editors/_EditRepository.py: remember editor size
* src/Editors/_EditEvent.py: remember editor size
* src/glade/gramps.glade: remember editor size
* data/gramps.schemas.in: remember editor size
* src/GrampsDb/_ReadGedcom.py: handle _UID for FAM structure (#0000505)
* src/docgen/ODFDoc.py: don't query mime type for ODT, since some systems
return only "ODT Document", which is kind of useless. Use OpenDocument Text

View File

@ -309,6 +309,126 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/event-height</key>
<applyto>/apps/gramps/interface/event-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>450</default>
<locale name="C">
<short>Height of the event editor interface.</short>
<long>Specifies the height of the event editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/event-width</key>
<applyto>/apps/gramps/interface/event-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>600</default>
<locale name="C">
<short>Width of the event editor interface.</short>
<long>Specifies the width of the event editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/place-height</key>
<applyto>/apps/gramps/interface/place-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>450</default>
<locale name="C">
<short>Height of the place editor interface.</short>
<long>Specifies the height of the place editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/place-width</key>
<applyto>/apps/gramps/interface/place-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>650</default>
<locale name="C">
<short>Width of the place editor interface.</short>
<long>Specifies the width of the place editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/repo-height</key>
<applyto>/apps/gramps/interface/repo-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>450</default>
<locale name="C">
<short>Height of the repository editor interface.</short>
<long>Specifies the height of the repository editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/repo-width</key>
<applyto>/apps/gramps/interface/repo-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>650</default>
<locale name="C">
<short>Width of the repository editor interface.</short>
<long>Specifies the width of the repository editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/media-height</key>
<applyto>/apps/gramps/interface/media-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>450</default>
<locale name="C">
<short>Height of the media editor interface.</short>
<long>Specifies the height of the media editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/media-width</key>
<applyto>/apps/gramps/interface/media-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>650</default>
<locale name="C">
<short>Width of the media editor interface.</short>
<long>Specifies the width of the media editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/source-height</key>
<applyto>/apps/gramps/interface/source-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>450</default>
<locale name="C">
<short>Height of the source editor interface.</short>
<long>Specifies the height of the source editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/source-width</key>
<applyto>/apps/gramps/interface/source-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>600</default>
<locale name="C">
<short>Width of the source editor interface.</short>
<long>Specifies the width of the source editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/filter</key>
<applyto>/apps/gramps/interface/filter</applyto>
@ -761,7 +881,7 @@
<applyto>/apps/gramps/behavior/transactions</applyto>
<owner>gramps</owner>
<type>bool</type>
<default>0</default>
<default>1</default>
<locale name="C">
<short>Enables the use of transactions</short>
<long>Enables the use of transactions, which increase data security and improve speed.</long>

View File

@ -45,6 +45,16 @@ FAMILY_HEIGHT = ('interface','family-height', 1)
FAMILY_WIDTH = ('interface','family-width', 1)
PERSON_HEIGHT = ('interface','person-height', 1)
PERSON_WIDTH = ('interface','person-width', 1)
EVENT_HEIGHT = ('interface','event-height', 1)
EVENT_WIDTH = ('interface','event-width', 1)
SOURCE_HEIGHT = ('interface','source-height', 1)
SOURCE_WIDTH = ('interface','source-width', 1)
PLACE_HEIGHT = ('interface','place-height', 1)
PLACE_WIDTH = ('interface','place-width', 1)
REPO_HEIGHT = ('interface','repo-height', 1)
REPO_WIDTH = ('interface','repo-width', 1)
MEDIA_HEIGHT = ('interface','media-height', 1)
MEDIA_WIDTH = ('interface','media-width', 1)
FILTER = ('interface','filter', 0)
FPREFIX = ('preferences','fprefix', 2)
EPREFIX = ('preferences','eprefix', 2)
@ -111,6 +121,16 @@ default_value = {
FAMILY_WIDTH : 700,
PERSON_HEIGHT : 550,
PERSON_WIDTH : 750,
EVENT_HEIGHT : 450,
EVENT_WIDTH : 600,
SOURCE_HEIGHT : 450,
SOURCE_WIDTH : 600,
PLACE_HEIGHT : 450,
PLACE_WIDTH : 650,
REPO_HEIGHT : 450,
REPO_WIDTH : 650,
MEDIA_HEIGHT : 450,
MEDIA_WIDTH : 650,
FILTER : False,
FPREFIX : 'F%04d',
EPREFIX : 'E%04d',
@ -146,5 +166,5 @@ default_value = {
SIDEBAR_TEXT : True,
WEBSITE_DIRECTORY : './',
PORT_WARN : False,
TRANSACTIONS : False,
TRANSACTIONS : True,
}

View File

@ -40,6 +40,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
import GrampsDisplay
from _EditPrimary import EditPrimary
@ -81,14 +82,23 @@ class EditEvent(EditPrimary):
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile, "event_edit","gramps")
self.set_window(self.top.get_widget("event_edit"),
self.top.get_widget('title'),
_('Event Editor'))
title = self.obj.get_description()
if title:
title = _('Event') + ": " + title
else:
title = _('Event')
self.set_window(self.top.get_widget("event_edit"), None, title)
self.place = self.top.get_widget('place')
self.share_btn = self.top.get_widget('select_place')
self.add_del_btn = self.top.get_widget('add_del_place')
width = Config.get(Config.EVENT_WIDTH)
height = Config.get(Config.EVENT_HEIGHT)
self.window.resize(width, height)
self.window.show()
def _connect_signals(self):
self.top.get_widget('button111').connect('clicked',self.close)
self.top.get_widget('button126').connect('clicked',self.help_clicked)
@ -181,6 +191,10 @@ class EditEvent(EditPrimary):
def _cleanup_on_exit(self):
self.backref_tab.close()
(width, height) = self.window.get_size()
Config.set(Config.EVENT_WIDTH, width)
Config.set(Config.EVENT_HEIGHT, height)
Config.sync()
def build_menu_names(self,event):
if event:

View File

@ -41,6 +41,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
import Mime
import ImgManip
@ -68,9 +69,18 @@ class EditMedia(EditPrimary):
assert(self.obj)
self.glade = gtk.glade.XML(const.gladeFile,
"change_global","gramps")
self.set_window(self.glade.get_widget('change_global'),
self.glade.get_widget('title'),
_('Media Properties Editor'))
title = self.obj.get_description()
if title:
title = _('Media') + ": " + title
else:
title = _('Media')
self.set_window(self.glade.get_widget('change_global'), None, title)
width = Config.get(Config.MEDIA_WIDTH)
height = Config.get(Config.MEDIA_HEIGHT)
self.window.resize(width, height)
self.window.show()
def _connect_signals(self):
self.define_cancel_button(self.glade.get_widget('button91'))
@ -209,6 +219,13 @@ class EditMedia(EditPrimary):
self.db.transaction_commit(trans,_("Edit Media Object"))
self.close()
def _cleanup_on_exit(self):
self.backref_list.close()
(width, height) = self.window.get_size()
Config.set(Config.MEDIA_WIDTH, width)
Config.set(Config.MEDIA_HEIGHT, height)
Config.sync()
class DeleteMediaQuery:
def __init__(self,media_handle,db,the_lists):

View File

@ -120,10 +120,10 @@ class EditPerson(EditPrimary):
self.top = gtk.glade.XML(const.person_glade, "edit_person", "gramps")
if self.pname.is_empty():
title = _('Edit Person')
title = _('Person')
else:
name = NameDisplay.displayer.display_name(self.pname)
title = _('Edit Person') + ' (%s)' % name
title = _('Person') + ': %s' % name
self.set_window(self.top.get_widget("edit_person"), None, title)
width = Config.get(Config.PERSON_WIDTH)

View File

@ -43,6 +43,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
from _EditPrimary import EditPrimary
@ -66,9 +67,17 @@ class EditPlace(EditPrimary):
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile,"place_editor","gramps")
self.set_window(self.top.get_widget("place_editor"),
self.top.get_widget('title'),
_('Place Editor'))
title = self.obj.get_title()
if title:
title = _('Place') + ": " + title
else:
title = _('Place')
self.set_window(self.top.get_widget("place_editor"), None, title)
width = Config.get(Config.PLACE_WIDTH)
height = Config.get(Config.PLACE_HEIGHT)
self.window.resize(width, height)
self.window.show()
def _connect_signals(self):
self.define_ok_button(self.top.get_widget('ok'),self.save)
@ -179,6 +188,10 @@ class EditPlace(EditPrimary):
def _cleanup_on_exit(self):
self.backref_list.close()
(width, height) = self.window.get_size()
Config.set(Config.PLACE_WIDTH, width)
Config.set(Config.PLACE_HEIGHT, height)
Config.sync()
def save(self,*obj):
title = self.obj.get_title()

View File

@ -40,6 +40,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
from GrampsWidgets import *
@ -58,9 +59,20 @@ class EditRepository(EditPrimary):
def _local_init(self):
self.glade = gtk.glade.XML(const.gladeFile,"repository_editor","gramps")
self.set_window(self.glade.get_widget("repository_editor"),
self.glade.get_widget('repository_title'),
_('Repository Editor'))
title = self.obj.get_name()
print title
if title:
title = _('Repository') + ": " + title
else:
title = _('Repository')
self.set_window(self.glade.get_widget("repository_editor"), None, title)
width = Config.get(Config.REPO_WIDTH)
height = Config.get(Config.REPO_HEIGHT)
self.window.resize(width, height)
self.window.show()
def _setup_fields(self):
@ -138,6 +150,13 @@ class EditRepository(EditPrimary):
self.db.transaction_commit(trans,msg)
self.close()
def _cleanup_on_exit(self):
self.backref_tab.close()
(width, height) = self.window.get_size()
Config.set(Config.REPO_WIDTH, width)
Config.set(Config.REPO_HEIGHT, height)
Config.sync()
class DelRepositoryQuery:
def __init__(self,repository,db,sources):
self.obj = repository

View File

@ -43,6 +43,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
from _EditPrimary import EditPrimary
@ -70,9 +71,18 @@ class EditSource(EditPrimary):
assert(self.obj)
self.glade = gtk.glade.XML(const.gladeFile,"source_editor","gramps")
title = self.obj.get_title()
if title:
title = _('Source') + ": " + title
else:
title = _('Source')
self.set_window(self.glade.get_widget("source_editor"),
self.glade.get_widget('title'),
_('Source Editor'))
None, title)
width = Config.get(Config.SOURCE_WIDTH)
height = Config.get(Config.SOURCE_HEIGHT)
self.window.resize(width, height)
self.window.show()
def _connect_signals(self):
self.define_ok_button(self.glade.get_widget('ok'),self.save)
@ -152,9 +162,6 @@ class EditSource(EditPrimary):
label = "New Source"
return (label, _('Source Editor'))
def _cleanup_on_exit(self):
self.backref_tab.close()
def save(self,*obj):
if self.object_is_empty():
from QuestionDialog import ErrorDialog
@ -173,6 +180,13 @@ class EditSource(EditPrimary):
_("Edit Source (%s)") % self.obj.get_title())
self.close()
def _cleanup_on_exit(self):
self.backref_tab.close()
(width, height) = self.window.get_size()
Config.set(Config.SOURCE_WIDTH, width)
Config.set(Config.SOURCE_HEIGHT, height)
Config.sync()
class DelSrcQuery:
def __init__(self,source,db,the_lists):
self.source = source
@ -222,3 +236,4 @@ class DelSrcQuery:
self.db.remove_source(self.source.get_handle(),trans)
self.db.transaction_commit(
trans,_("Delete Source (%s)") % self.source.get_title())

View File

@ -4,13 +4,10 @@
<glade-interface>
<widget class="GtkDialog" id="source_editor">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -93,31 +90,6 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">5</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table17">
<property name="border_width">12</property>
@ -1484,13 +1456,10 @@
</widget>
<widget class="GtkDialog" id="place_editor">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">650</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -1571,31 +1540,6 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">5</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table66">
<property name="border_width">12</property>
@ -5471,13 +5415,10 @@
</widget>
<widget class="GtkDialog" id="change_global">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -5559,31 +5500,6 @@
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
@ -6822,13 +6738,10 @@
</widget>
<widget class="GtkDialog" id="event_edit">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -6912,31 +6825,6 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">10</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table21">
<property name="border_width">12</property>
@ -10219,13 +10107,10 @@
</widget>
<widget class="GtkDialog" id="repository_editor">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -10308,31 +10193,6 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="repository_title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">5</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table56">
<property name="border_width">12</property>