From 2209020653ec60bd46f54cec97b74f2fc1871d6d Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 28 Nov 2006 07:10:37 +0000 Subject: [PATCH] * src/DbLoader.py (DbLoader.save_as): Prohibit SaveAs into the currently opened database. (DbLoader.import_file): Prohibit importing from the currently opened database. svn: r7724 --- gramps2/ChangeLog | 4 ++++ gramps2/src/DbLoader.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 46e8faffe..a3aeb9a59 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,8 @@ 2006-11-27 Alex Roitman + * src/DbLoader.py (DbLoader.save_as): Prohibit SaveAs into the + currently opened database. + (DbLoader.import_file): Prohibit importing from the currently + opened database. * src/GrampsDb/_WriteXML.py (dump_person_ref): Properly export associations. diff --git a/gramps2/src/DbLoader.py b/gramps2/src/DbLoader.py index 3c150727b..6dd07abe9 100644 --- a/gramps2/src/DbLoader.py +++ b/gramps2/src/DbLoader.py @@ -213,6 +213,10 @@ class DbLoader: if self.check_errors(filename): return ('','') + # Do not allow saving as into the currently open file + if filename == self.dbstate.db.full_name: + return ('','') + filetype = type_selector.get_value() if filetype == 'auto': try: @@ -300,6 +304,10 @@ class DbLoader: if self.check_errors(filename): return False + # Do not allow importing from the currently open file + if filename == self.dbstate.db.full_name: + return False + filetype = type_selector.get_value() if filetype == 'auto': try: