* src/DataViews/_RepositoryView.py (edit, on_double_click): Catch

exception.
	* src/GrampsWidgets.py (PlaceEntry.add_del_clicked) 
	(PlaceEntry.share_clicked): Catch exception.


svn: r6716
This commit is contained in:
Alex Roitman 2006-05-18 23:02:47 +00:00
parent 53269db447
commit b1b9987f52
3 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,8 @@
2006-05-18 Alex Roitman <shura@gramps-project.org> 2006-05-18 Alex Roitman <shura@gramps-project.org>
* src/DataViews/_RepositoryView.py (edit, on_double_click): Catch
exception.
* src/GrampsWidgets.py (PlaceEntry.add_del_clicked)
(PlaceEntry.share_clicked): Catch exception.
* src/GrampsDb/_DbUtils.py (db_copy): Copy bookmarks and gender stats. * src/GrampsDb/_DbUtils.py (db_copy): Copy bookmarks and gender stats.
* data/grampsxml.dtd: Update for new bookmarks. * data/grampsxml.dtd: Update for new bookmarks.
* data/grampsxml.rng: Update for new bookmarks. * data/grampsxml.rng: Update for new bookmarks.

View File

@ -38,7 +38,7 @@ import DisplayModels
import const import const
import Utils import Utils
import Bookmarks import Bookmarks
import Errors
from Editors import EditRepository, DelRepositoryQuery from Editors import EditRepository, DelRepositoryQuery
from DdTargets import DdTargets from DdTargets import DdTargets
@ -159,7 +159,10 @@ class RepositoryView(PageView.ListView):
def on_double_click(self,obj,event): def on_double_click(self,obj,event):
handle = self.first_selected() handle = self.first_selected()
repos = self.dbstate.db.get_repository_from_handle(handle) repos = self.dbstate.db.get_repository_from_handle(handle)
try:
EditRepository(self.dbstate, self.uistate,[],repos) EditRepository(self.dbstate, self.uistate,[],repos)
except Errors.WindowActiveError:
pass
def add(self,obj): def add(self,obj):
EditRepository(self.dbstate, self.uistate,[],RelLib.Repository()) EditRepository(self.dbstate, self.uistate,[],RelLib.Repository())
@ -197,5 +200,8 @@ class RepositoryView(PageView.ListView):
for handle in mlist: for handle in mlist:
repos = self.dbstate.db.get_repository_from_handle(handle) repos = self.dbstate.db.get_repository_from_handle(handle)
try:
EditRepository(self.dbstate, self.uistate, [], repos) EditRepository(self.dbstate, self.uistate, [], repos)
except Errors.WindowActiveError:
pass

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2005 Donald N. Allingham # Copyright (C) 2000-2006 Donald N. Allingham
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -36,6 +36,7 @@ import AutoComp
import DateHandler import DateHandler
import DateEdit import DateEdit
import const import const
import Errors
_lock_path = os.path.join(const.image_dir, 'stock_lock.png') _lock_path = os.path.join(const.image_dir, 'stock_lock.png')
_lock_open_path = os.path.join(const.image_dir, 'stock_lock-open.png') _lock_open_path = os.path.join(const.image_dir, 'stock_lock-open.png')
@ -523,8 +524,11 @@ class PlaceEntry:
from Editors import EditPlace from Editors import EditPlace
place = Place() place = Place()
try:
EditPlace(self.dbstate, self.uistate, self.track, EditPlace(self.dbstate, self.uistate, self.track,
place, self.place_added) place, self.place_added)
except Errors.WindowActiveError:
pass
def place_added(self, data): def place_added(self, data):
self.set_val(data.handle) self.set_val(data.handle)
@ -536,8 +540,11 @@ class PlaceEntry:
from Editors import EditPlace from Editors import EditPlace
place = self.db.get_place_from_handle(self.get_val()) place = self.db.get_place_from_handle(self.get_val())
try:
EditPlace(self.dbstate, self.uistate, self.track, place, EditPlace(self.dbstate, self.uistate, self.track, place,
self.after_edit) self.after_edit)
except Errors.WindowActiveError:
pass
else: else:
from Selectors import selector_factory from Selectors import selector_factory
cls = selector_factory('Place') cls = selector_factory('Place')
@ -570,8 +577,3 @@ class PlaceEntry:
image.set_from_stock(gtk.STOCK_INDEX,gtk.ICON_SIZE_BUTTON) image.set_from_stock(gtk.STOCK_INDEX,gtk.ICON_SIZE_BUTTON)
image.show() image.show()
self.share.add(image) self.share.add(image)