diff --git a/ChangeLog b/ChangeLog index 5f8ee6b21..8338bcbdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-05-21 Don Allingham + * src/ViewManager.py: handle export, import, and save as if + database does not exist, yet UIManager still wants to call them. + 2006-05-21 Alex Roitman * configure.in: Set up for the next release. diff --git a/src/ViewManager.py b/src/ViewManager.py index 49b0ed531..83d0b3f48 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -694,16 +694,18 @@ class ViewManager: self.pages[num].change_page() def import_data(self, obj): - self.db_loader.import_file() - self.post_load() + if self.state.db.db_is_open: + self.db_loader.import_file() + self.post_load() def open_activate(self, obj): (filename,filetype) = self.db_loader.open_file() self.post_load_newdb(filename,filetype) def save_as_activate(self,obj): - (filename,filetype) = self.db_loader.save_as() - self.post_load_newdb(filename,filetype) + if self.state.db.db_is_open: + (filename,filetype) = self.db_loader.save_as() + self.post_load_newdb(filename,filetype) def new_activate(self,obj): (filename,filetype) = self.db_loader.new_file() @@ -874,8 +876,9 @@ class ViewManager: pass def export_data(self, obj): - import Exporter - Exporter.Exporter(self.state, self.uistate) + if self.state.db.db_is_open: + import Exporter + Exporter.Exporter(self.state, self.uistate) def build_tools_menu(self): self.toolactions = gtk.ActionGroup('ToolWindow')