2007-06-13 Don Allingham <don@gramps-project.org>
* src/DbManager.py: handle broken dbs that have been opened * src/DbState.py: handle broken dbs that have been opened * src/GrampsDbUtils/_Backup.py: write intermediate file firs to make sure no errors occur when writing, then replace old backups * src/ViewManager.py: better rebuild recovery * src/GrampsDb/_GrampsDbConst.py: better rebuild recovery * src/GrampsDb/_GrampsDBCallback.py: better rebuild recovery * src/DbManager.py: better rebuild recovery * src/glade/gramps.glade: better rebuild recovery * src/const.py.in: better rebuild recovery * src/QuestionDialog.py: better rebuild recovery * src/GrampsDbUtils/_ReadGedcom.py: better rebuild recovery * src/ArgHandler.py: better rebuild recovery * src/DbLoader.py: better rebuild recovery 2007-06-12 Don Allingham <don@gramps-project.org> svn: r8546
This commit is contained in:
@@ -239,7 +239,8 @@ class DbManager:
|
||||
name = file(path_name).readline().strip()
|
||||
|
||||
(tval, last) = time_val(dirpath)
|
||||
(enable, stock_id) = icon_values(dirpath, self.active)
|
||||
(enable, stock_id) = icon_values(dirpath, self.active,
|
||||
self.dbstate.db.is_open())
|
||||
|
||||
self.current_names.append(
|
||||
(name, os.path.join(DEFAULT_DIR, dpath), path_name,
|
||||
@@ -444,15 +445,15 @@ def time_val(dirpath):
|
||||
last = _("Never")
|
||||
return (tval, last)
|
||||
|
||||
def icon_values(dirpath, active):
|
||||
def icon_values(dirpath, active, open):
|
||||
"""
|
||||
If the directory path is the active path, then return values
|
||||
that indicate to use the icon, and which icon to use.
|
||||
"""
|
||||
if dirpath == active:
|
||||
return (True, gtk.STOCK_OPEN)
|
||||
if os.path.isfile(os.path.join(dirpath,"need_recover")):
|
||||
return (True, gtk.STOCK_DIALOG_ERROR)
|
||||
elif dirpath == active and open:
|
||||
return (True, gtk.STOCK_OPEN)
|
||||
else:
|
||||
return (False, "")
|
||||
|
||||
|
Reference in New Issue
Block a user