2006-11-25 Don Allingham <don@gramps-project.org>

* src/Config/_GrampsConfigKeys.py: remember window size
	* src/Editors/_EditAddress.py: remember window size
	* src/Editors/_EditSecondary.py: remember window size
	* src/Editors/_EditLdsOrd.py: remember window size
	* src/Editors/_EditReference.py: remember window size
	* src/Editors/_EditUrl.py: remember window size
	* src/Editors/_EditRepoRef.py: remember window size
	* src/Editors/_EditAttribute.py: remember window size
	* src/Editors/_EditPersonRef.py: remember window size
	* src/Editors/_EditLocation.py: remember window size
	* src/Editors/_EditMediaRef.py: remember window size
	* src/Editors/_EditEventRef.py: remember window size
	* src/Editors/_EditName.py: remember window size
	* src/glade/gramps.glade: remember window size
	* data/gramps.schemas.in: remember window size



svn: r7701
This commit is contained in:
Don Allingham
2006-11-26 04:39:34 +00:00
parent a973524664
commit 78195bc5c8
16 changed files with 415 additions and 338 deletions

View File

@@ -45,6 +45,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
from _EditSecondary import EditSecondary
from DisplayTabs import SourceEmbedList, NoteTab
@@ -59,6 +60,10 @@ class EditAddress(EditSecondary):
"""
Displays a dialog that allows the user to edit an address.
"""
WIDTH_KEY = Config.ADDR_WIDTH
HEIGHT_KEY = Config.ADDR_HEIGHT
def __init__(self, dbstate, uistate, track, addr, callback):
"""
Displays the dialog box.

View File

@@ -48,6 +48,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
from _EditSecondary import EditSecondary
from DisplayTabs import SourceEmbedList, NoteTab
@@ -62,6 +63,10 @@ class EditAttribute(EditSecondary):
"""
Displays a dialog that allows the user to edit an attribute.
"""
WIDTH_KEY = Config.ATTR_WIDTH
HEIGHT_KEY = Config.ATTR_HEIGHT
def __init__(self, state, uistate, track, attrib, title, data_list, callback):
"""
Displays the dialog box.

View File

@@ -40,6 +40,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
from DisplayTabs import SourceEmbedList,NoteTab,GalleryTab,EventBackRefList,AttrEmbedList
@@ -58,6 +59,10 @@ from _EditReference import EditReference
#
#-------------------------------------------------------------------------
class EditEventRef(EditReference):
WIDTH_KEY = Config.EVENT_REF_WIDTH
HEIGHT_KEY = Config.EVENT_REF_HEIGHT
def __init__(self, state, uistate, track, event, event_ref, update):
EditReference.__init__(self, state, uistate, track, event, event_ref,
update)

View File

@@ -48,6 +48,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
import RelLib
import NameDisplay
import LdsUtils
@@ -130,6 +131,8 @@ class EditLdsOrd(EditSecondary):
Displays a dialog that allows the user to edit an attribute.
"""
WIDTH_KEY = Config.LDS_WIDTH
HEIGHT_KEY = Config.LDS_HEIGHT
def __init__(self, state, uistate, track, attrib, callback):
"""

View File

@@ -33,6 +33,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
from _EditSecondary import EditSecondary
from GrampsWidgets import *
@@ -45,14 +46,16 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
class EditLocation(EditSecondary):
WIDTH_KEY = Config.LOCATION_WIDTH
HEIGHT_KEY = Config.LOCATION_HEIGHT
def __init__(self,dbstate,uistate,track,location,callback):
EditSecondary.__init__(self, dbstate, uistate, track,
location, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile, "loc_edit","gramps")
self.set_window(self.top.get_widget("loc_edit"),
self.top.get_widget('title'),
self.set_window(self.top.get_widget("loc_edit"), None,
_('Location Editor'))
def _setup_fields(self):

View File

@@ -40,6 +40,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
import Mime
import ImgManip
@@ -54,6 +55,10 @@ from _EditReference import EditReference
#
#-------------------------------------------------------------------------
class EditMediaRef(EditReference):
WIDTH_KEY = Config.MEDIA_REF_WIDTH
HEIGHT_KEY = Config.MEDIA_REF_HEIGHT
def __init__(self, state, uistate, track, media, media_ref, update):
EditReference.__init__(self, state, uistate, track, media,

View File

@@ -40,6 +40,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
import Utils
import NameDisplay
from _EditSecondary import EditSecondary
@@ -54,6 +55,9 @@ from GrampsWidgets import *
#-------------------------------------------------------------------------
class EditName(EditSecondary):
WIDTH_KEY = Config.NAME_WIDTH
HEIGHT_KEY = Config.NAME_HEIGHT
def __init__(self, dbstate, uistate, track, name, callback):
EditSecondary.__init__(self, dbstate, uistate,

View File

@@ -45,6 +45,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
import NameDisplay
from _EditSecondary import EditSecondary
@@ -60,6 +61,10 @@ class EditPersonRef(EditSecondary):
"""
Displays a dialog that allows the user to edit an address.
"""
WIDTH_KEY = Config.PERSON_REF_WIDTH
HEIGHT_KEY = Config.PERSON_REF_HEIGHT
def __init__(self, dbstate, uistate, track, addr, callback):
"""
Displays the dialog box.

View File

@@ -27,6 +27,7 @@
#-------------------------------------------------------------------------
import ManagedWindow
from GrampsWidgets import *
import Config
#-------------------------------------------------------------------------
#
@@ -34,6 +35,10 @@ from GrampsWidgets import *
#
#-------------------------------------------------------------------------
class EditReference(ManagedWindow.ManagedWindow):
WIDTH_KEY = None
HEIGHT_KEY = None
def __init__(self, state, uistate, track, source, source_ref, update):
self.db = state.db
self.dbstate = state
@@ -48,12 +53,20 @@ class EditReference(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, track, source_ref)
self._local_init()
self._set_size()
self._create_tabbed_pages()
self._setup_fields()
self._connect_signals()
self.show()
self._post_init()
def _set_size(self):
if self.WIDTH_KEY:
width = Config.get(self.WIDTH_KEY)
height = Config.get(self.HEIGHT_KEY)
self.window.resize(width, height)
self.window.show()
def _local_init(self):
"""
Derived class should do any pre-window initalization in this task.
@@ -119,4 +132,13 @@ class EditReference(ManagedWindow.ManagedWindow):
def close(self,*obj):
for key in self.signal_keys:
self.db.disconnect(key)
self._save_size()
ManagedWindow.ManagedWindow.close(self)
def _save_size(self):
if self.HEIGHT_KEY:
(width, height) = self.window.get_size()
Config.set(self.WIDTH_KEY, width)
Config.set(self.HEIGHT_KEY, height)
Config.sync()

View File

@@ -40,6 +40,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
import Config
from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList
from GrampsWidgets import *
@@ -51,6 +52,10 @@ from _EditReference import EditReference
#
#-------------------------------------------------------------------------
class EditRepoRef(EditReference):
WIDTH_KEY = Config.REPO_REF_WIDTH
HEIGHT_KEY = Config.REPO_REF_HEIGHT
def __init__(self, state, uistate, track, source, source_ref, update):
EditReference.__init__(self, state, uistate, track, source,

View File

@@ -22,9 +22,13 @@
import ManagedWindow
import GrampsDisplay
import Config
class EditSecondary(ManagedWindow.ManagedWindow):
WIDTH_KEY = None
HEIGHT_KEY = None
def __init__(self, state, uistate, track, obj, callback=None):
"""Creates an edit window. Associates a person with the window."""
@@ -38,6 +42,7 @@ class EditSecondary(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, track, obj)
self._local_init()
self._set_size()
self._create_tabbed_pages()
self._setup_fields()
@@ -45,6 +50,13 @@ class EditSecondary(ManagedWindow.ManagedWindow):
self.show()
self._post_init()
def _set_size(self):
if self.WIDTH_KEY:
width = Config.get(self.WIDTH_KEY)
height = Config.get(self.HEIGHT_KEY)
self.window.resize(width, height)
self.window.show()
def _local_init(self):
"""
Derived class should do any pre-window initalization in this task.
@@ -94,4 +106,13 @@ class EditSecondary(ManagedWindow.ManagedWindow):
for key in self.signal_keys:
self.db.disconnect(key)
self._cleanup_on_exit()
self._save_size()
ManagedWindow.ManagedWindow.close(self)
def _save_size(self):
if self.HEIGHT_KEY:
(width, height) = self.window.get_size()
Config.set(self.WIDTH_KEY, width)
Config.set(self.HEIGHT_KEY, height)
Config.sync()

View File

@@ -40,6 +40,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import const
import Config
from _EditSecondary import EditSecondary
from GrampsWidgets import *
@@ -51,6 +52,9 @@ from GrampsWidgets import *
#-------------------------------------------------------------------------
class EditUrl(EditSecondary):
WIDTH_KEY = Config.URL_WIDTH
HEIGHT_KEY = Config.URL_HEIGHT
def __init__(self, dbstate, uistate, track, name, url, callback):
EditSecondary.__init__(self, dbstate, uistate, track,