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

* src/Config/_GrampsConfigKeys.py: add saving of family editor size 
	* src/Editors/_EditFamily.py: add saving of family editor size 
	* src/DisplayTabs/_GalleryTab.py: Catch possible exception
	* src/glade/gramps.glade: add saving of family editor size 
	* src/DbLoader.py: Display error message on RUNRECOVERY error

	* src/DisplayTabs/_AddrEmbedList.py: make labels more consistent (#513)


svn: r7616
This commit is contained in:
Don Allingham 2006-11-12 03:12:57 +00:00
parent 682ea93e48
commit 6d5598173c
6 changed files with 49 additions and 40 deletions

View File

@ -1,3 +1,10 @@
2006-11-11 Don Allingham <don@gramps-project.org>
* src/Config/_GrampsConfigKeys.py: add saving of family editor size
* src/Editors/_EditFamily.py: add saving of family editor size
* src/DisplayTabs/_GalleryTab.py: Catch possible exception
* src/glade/gramps.glade: add saving of family editor size
* src/DbLoader.py: Display error message on RUNRECOVERY error
2006-11-11 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* test/GrampsDb/GrampsDbTestBase.py: Provide a callback to db.load().
Hmmm, that worked without sometime back.
@ -7,6 +14,7 @@
definition.
2006-11-10 Don Allingham <don@gramps-project.org>
* src/DisplayTabs/_AddrEmbedList.py: make labels more consistent (#513)
* src/GrampsDb/_ReadGedcom.py: handle GedcomError properly
* src/DisplayModels/_BaseModel.py: handle add properly with filters

View File

@ -39,6 +39,8 @@ DATE_FORMAT = ('preferences','date-format', 1)
DONT_ASK = ('interface','dont-ask', 0)
HEIGHT = ('interface','height', 1)
WIDTH = ('interface','width', 1)
FAM_HEIGHT = ('interface','height', 1)
FAM_WIDTH = ('interface','width', 1)
FILTER = ('interface','filter', 0)
FPREFIX = ('preferences','fprefix', 2)
EPREFIX = ('preferences','eprefix', 2)
@ -99,6 +101,8 @@ default_value = {
DONT_ASK : False,
HEIGHT : 500,
WIDTH : 775,
FAM_HEIGHT : 500,
FAM_WIDTH : 700,
FILTER : False,
FPREFIX : 'F%04d',
EPREFIX : 'E%04d',

View File

@ -30,7 +30,7 @@ Handling of loading new/existing databases.
#
#-------------------------------------------------------------------------
import os
from bsddb.db import DBAccessError
from bsddb.db import DBAccessError, DBRunRecoveryError, DBPageNotFoundError
from gettext import gettext as _
import logging
log = logging.getLogger(".")
@ -422,7 +422,17 @@ class DbLoader:
os.chdir(os.path.dirname(filename))
except:
print "could not change directory"
except DBAccessError, msg:
except DBRunRecoveryError, msg:
QuestionDialog.ErrorDialog(
_("Low level database corruption detected"),
_("GRAMPS has detected a problem in the underlying "
"Berkeley database. Please exit the program, and GRAMPS "
"will attempt to run the recovery repair operation "
"the next time you open this database. If this "
"problem persists, create a new database, import "
"from a backup database, and report the problem to "
"gramps-bugs@lists.sourceforge.net."))
except (DBAccessError, DBPageNotFoundError), msg:
QuestionDialog.ErrorDialog(
_("Could not open file: %s") % filename,
str(msg[1]))

View File

@ -303,19 +303,22 @@ class GalleryTab(ButtonTab):
# get the selected object, returning if not is defined
reflist = self.iconlist.get_selected_items()
obj = self.media_list[reflist[0][0]]
try:
reflist = self.iconlist.get_selected_items()
obj = self.media_list[reflist[0][0]]
if not obj:
if not obj:
return
# pickle the data, and build the tuple to be passed
value = (self._DND_TYPE.drag_type, id(self), obj, self.find_index(obj))
data = pickle.dumps(value)
# pass as a string (8 bits)
sel_data.set(sel_data.target, 8, data)
except IndexError:
return
# pickle the data, and build the tuple to be passed
value = (self._DND_TYPE.drag_type, id(self), obj, self.find_index(obj))
data = pickle.dumps(value)
# pass as a string (8 bits)
sel_data.set(sel_data.target, 8, data)
def drag_data_received(self, widget, context, x, y, sel_data, info, time):
"""
Handle the standard gtk interface for drag_data_received.

View File

@ -441,6 +441,11 @@ class EditFamily(EditPrimary):
self.set_window(self.top.get_widget("family_editor"),
None,_('Family Editor'))
# restore window size
width = Config.get(Config.FAM_WIDTH)
height = Config.get(Config.FAM_HEIGHT)
self.window.set_default_size(width, height)
self.fbirth = self.top.get_widget('fbirth')
self.fdeath = self.top.get_widget('fdeath')
@ -459,6 +464,7 @@ class EditFamily(EditPrimary):
self.mbox = self.top.get_widget('mbox')
self.fbox = self.top.get_widget('fbox')
self.window.show()
def _connect_signals(self):
self.define_ok_button(self.top.get_widget('ok'), self.save)
@ -882,3 +888,9 @@ class EditFamily(EditPrimary):
self.db.transaction_commit(trans,_("Edit Family"))
self.close()
def _cleanup_on_exit(self):
(width, height) = self.window.get_size()
Config.set(Config.FAM_WIDTH, width)
Config.set(Config.FAM_HEIGHT, height)
Config.sync()

View File

@ -582,13 +582,10 @@
</widget>
<widget class="GtkDialog" id="family_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">700</property>
<property name="default_height">500</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -672,31 +669,6 @@
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child>
<widget class="GtkLabel" id="label543">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;span size=&quot;larger&quot; weight=&quot;bold&quot;&gt;Family Editor&lt;/span&gt;</property>
<property name="use_underline">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>
<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="hbox121">
<property name="visible">True</property>