diff --git a/ChangeLog b/ChangeLog index 70c354b88..113cb5cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ 2006-11-25 Don Allingham + * 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 diff --git a/data/gramps.schemas.in b/data/gramps.schemas.in index d5be160a1..b627a557d 100644 --- a/data/gramps.schemas.in +++ b/data/gramps.schemas.in @@ -309,6 +309,126 @@ + + /schemas/apps/gramps/interface/event-height + /apps/gramps/interface/event-height + gramps + int + 450 + + Height of the event editor interface. + Specifies the height of the event editor interface. + + + + + /schemas/apps/gramps/interface/event-width + /apps/gramps/interface/event-width + gramps + int + 600 + + Width of the event editor interface. + Specifies the width of the event editor interface. + + + + + /schemas/apps/gramps/interface/place-height + /apps/gramps/interface/place-height + gramps + int + 450 + + Height of the place editor interface. + Specifies the height of the place editor interface. + + + + + /schemas/apps/gramps/interface/place-width + /apps/gramps/interface/place-width + gramps + int + 650 + + Width of the place editor interface. + Specifies the width of the place editor interface. + + + + + /schemas/apps/gramps/interface/repo-height + /apps/gramps/interface/repo-height + gramps + int + 450 + + Height of the repository editor interface. + Specifies the height of the repository editor interface. + + + + + /schemas/apps/gramps/interface/repo-width + /apps/gramps/interface/repo-width + gramps + int + 650 + + Width of the repository editor interface. + Specifies the width of the repository editor interface. + + + + + /schemas/apps/gramps/interface/media-height + /apps/gramps/interface/media-height + gramps + int + 450 + + Height of the media editor interface. + Specifies the height of the media editor interface. + + + + + /schemas/apps/gramps/interface/media-width + /apps/gramps/interface/media-width + gramps + int + 650 + + Width of the media editor interface. + Specifies the width of the media editor interface. + + + + + /schemas/apps/gramps/interface/source-height + /apps/gramps/interface/source-height + gramps + int + 450 + + Height of the source editor interface. + Specifies the height of the source editor interface. + + + + + /schemas/apps/gramps/interface/source-width + /apps/gramps/interface/source-width + gramps + int + 600 + + Width of the source editor interface. + Specifies the width of the source editor interface. + + + /schemas/apps/gramps/interface/filter /apps/gramps/interface/filter @@ -761,7 +881,7 @@ /apps/gramps/behavior/transactions gramps bool - 0 + 1 Enables the use of transactions Enables the use of transactions, which increase data security and improve speed. diff --git a/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index 8dff0e3b5..460bf39a4 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/src/Config/_GrampsConfigKeys.py @@ -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, } diff --git a/src/Editors/_EditEvent.py b/src/Editors/_EditEvent.py index f429713ca..e041bddfa 100644 --- a/src/Editors/_EditEvent.py +++ b/src/Editors/_EditEvent.py @@ -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: diff --git a/src/Editors/_EditMedia.py b/src/Editors/_EditMedia.py index 64853b131..9791d6562 100644 --- a/src/Editors/_EditMedia.py +++ b/src/Editors/_EditMedia.py @@ -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): diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index e73456487..b3fbc83e3 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -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) diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index cbed8e4b2..94cf20e90 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -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() diff --git a/src/Editors/_EditRepository.py b/src/Editors/_EditRepository.py index 6eb629517..2fa3c4b4c 100644 --- a/src/Editors/_EditRepository.py +++ b/src/Editors/_EditRepository.py @@ -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 diff --git a/src/Editors/_EditSource.py b/src/Editors/_EditSource.py index e5b6bf849..9deb107fe 100644 --- a/src/Editors/_EditSource.py +++ b/src/Editors/_EditSource.py @@ -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()) + diff --git a/src/glade/gramps.glade b/src/glade/gramps.glade index a0090e567..d6ab8bc0a 100644 --- a/src/glade/gramps.glade +++ b/src/glade/gramps.glade @@ -4,13 +4,10 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 600 - 450 True False True @@ -93,31 +90,6 @@ False 0 - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 5 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - 12 @@ -1484,13 +1456,10 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 650 - 450 True False True @@ -1571,31 +1540,6 @@ False 0 - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 5 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - 12 @@ -5471,13 +5415,10 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 600 - 450 True False True @@ -5559,31 +5500,6 @@ False 6 - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - True @@ -6822,13 +6738,10 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 600 - 450 True False True @@ -6912,31 +6825,6 @@ False 0 - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 10 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - 12 @@ -10219,13 +10107,10 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 600 - 450 True False True @@ -10308,31 +10193,6 @@ False 0 - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 5 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - 12