Persist window dimensions for selector windows. TODO: SelectPerson. This class needs rewriting to use BaseSelector

svn: r11923
This commit is contained in:
Gary Burton 2009-02-08 15:47:24 +00:00
parent badbc32254
commit 4d567fa2fb
8 changed files with 93 additions and 0 deletions

View File

@ -106,6 +106,22 @@ SOURCE_HEIGHT = ('interface', 'source-height', 1)
SOURCE_WIDTH = ('interface', 'source-width', 1)
SOURCE_REF_HEIGHT = ('interface', 'source-ref-height', 1)
SOURCE_REF_WIDTH = ('interface', 'source-ref-width', 1)
SOURCE_SEL_WIDTH = ('interface', 'source-sel-width', 1)
SOURCE_SEL_HEIGHT = ('interface', 'source-sel-height', 1)
EVENT_SEL_WIDTH = ('interface', 'event-sel-width', 1)
EVENT_SEL_HEIGHT = ('interface', 'event-sel-height', 1)
FAMILY_SEL_WIDTH = ('interface', 'family-sel-width', 1)
FAMILY_SEL_HEIGHT = ('interface', 'family-sel-height', 1)
NOTE_SEL_WIDTH = ('interface', 'note-sel-width', 1)
NOTE_SEL_HEIGHT = ('interface', 'note-sel-height', 1)
REPO_SEL_WIDTH = ('interface', 'repo-sel-width', 1)
REPO_SEL_HEIGHT = ('interface', 'repo-sel-height', 1)
PLACE_SEL_WIDTH = ('interface', 'place-sel-width', 1)
PLACE_SEL_HEIGHT = ('interface', 'place-sel-height', 1)
PERSON_SEL_WIDTH = ('interface', 'person-sel-width', 1)
PERSON_SEL_HEIGHT = ('interface', 'person-sel-height', 1)
MEDIA_SEL_WIDTH = ('interface', 'media-sel-width', 1)
MEDIA_SEL_HEIGHT = ('interface', 'media-sel-height', 1)
FILTER = ('interface', 'filter', 0)
PEDVIEW_TREESIZE = ('interface', 'pedview-tree-size', 1)
PEDVIEW_LAYOUT = ('interface', 'pedview-layout', 1)
@ -240,6 +256,22 @@ default_value = {
SOURCE_WIDTH : 600,
SOURCE_REF_HEIGHT : 450,
SOURCE_REF_WIDTH : 600,
SOURCE_SEL_WIDTH : 600,
SOURCE_SEL_HEIGHT : 450,
EVENT_SEL_WIDTH : 600,
EVENT_SEL_HEIGHT : 450,
FAMILY_SEL_WIDTH : 600,
FAMILY_SEL_HEIGHT : 450,
NOTE_SEL_WIDTH : 600,
NOTE_SEL_HEIGHT : 450,
REPO_SEL_WIDTH : 600,
REPO_SEL_HEIGHT : 450,
PLACE_SEL_WIDTH : 600,
PLACE_SEL_HEIGHT : 450,
PERSON_SEL_WIDTH : 600,
PERSON_SEL_HEIGHT : 450,
MEDIA_SEL_WIDTH : 600,
MEDIA_SEL_HEIGHT : 450,
FILTER : False,
PEDVIEW_TREESIZE : 0,
PEDVIEW_LAYOUT : 0,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -34,6 +35,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import EventModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -42,6 +44,13 @@ from _BaseSelector import BaseSelector
#-------------------------------------------------------------------------
class SelectEvent(BaseSelector):
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.EVENT_SEL_WIDTH
self.height_key = Config.EVENT_SEL_HEIGHT
def get_window_title(self):
return _("Select Event")

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -34,6 +35,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import FamilyModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -42,6 +44,13 @@ from _BaseSelector import BaseSelector
#-------------------------------------------------------------------------
class SelectFamily(BaseSelector):
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.FAMILY_SEL_WIDTH
self.height_key = Config.FAMILY_SEL_HEIGHT
def get_window_title(self):
return _("Select Family")

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -37,6 +38,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import NoteModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -47,6 +49,13 @@ class SelectNote(BaseSelector):
""" Class that handles the selection of a note
"""
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.NOTE_SEL_WIDTH
self.height_key = Config.NOTE_SEL_HEIGHT
def get_window_title(self):
return _("Select Note")

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -48,6 +49,7 @@ from Utils import media_path_full
import ThumbNails
from DisplayModels import MediaModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -76,6 +78,11 @@ class SelectObject(BaseSelector):
]
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.MEDIA_SEL_WIDTH
self.height_key = Config.MEDIA_SEL_HEIGHT
self.preview = gtk.Image()
self.preview.set_size_request(int(const.THUMBSCALE),
int(const.THUMBSCALE))

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -34,6 +35,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import PlaceModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -42,6 +44,13 @@ from _BaseSelector import BaseSelector
#-------------------------------------------------------------------------
class SelectPlace(BaseSelector):
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.PLACE_SEL_WIDTH
self.height_key = Config.PLACE_SEL_HEIGHT
def get_window_title(self):
return _("Select Place")

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -34,6 +35,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import RepositoryModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -42,6 +44,13 @@ from _BaseSelector import BaseSelector
#-------------------------------------------------------------------------
class SelectRepository(BaseSelector):
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.REPO_SEL_WIDTH
self.height_key = Config.REPO_SEL_HEIGHT
def get_window_title(self):
return _("Select Repository")

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# 2009 Gary Burton
#
# 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
@ -34,6 +35,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from DisplayModels import SourceModel
from _BaseSelector import BaseSelector
import Config
#-------------------------------------------------------------------------
#
@ -42,6 +44,13 @@ from _BaseSelector import BaseSelector
#-------------------------------------------------------------------------
class SelectSource(BaseSelector):
def _local_init(self):
"""
Perform local initialisation for this class
"""
self.width_key = Config.SOURCE_SEL_WIDTH
self.height_key = Config.SOURCE_SEL_HEIGHT
def get_window_title(self):
return _("Select Source")