From 093cbe0775f4c67525e6f858bdcce417bb18c730 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 23 Apr 2006 22:43:36 +0000 Subject: [PATCH] Update svn: r6426 --- src/Editors/_EditAddress.py | 3 +-- src/Editors/_EditAttribute.py | 4 +--- src/Editors/_EditChildRef.py | 3 +-- src/Editors/_EditEvent.py | 2 +- src/Editors/_EditEventRef.py | 2 +- src/Editors/_EditFamily.py | 8 ++++---- src/Editors/_EditLdsOrd.py | 4 ++-- src/Editors/_EditMedia.py | 2 +- src/Editors/_EditMediaRef.py | 2 +- src/Editors/_EditName.py | 2 +- src/Editors/_EditPersonRef.py | 2 +- src/Editors/_EditPrimary.py | 12 ++++++------ src/Editors/_EditReference.py | 6 +++--- src/Editors/_EditRepoRef.py | 2 +- src/Editors/_EditSecondary.py | 12 +++--------- src/Editors/_EditSourceRef.py | 2 +- src/Editors/_EditUrl.py | 3 +-- src/ManagedWindow.py | 4 ++-- 18 files changed, 32 insertions(+), 43 deletions(-) diff --git a/src/Editors/_EditAddress.py b/src/Editors/_EditAddress.py index 867162627..f518ae193 100644 --- a/src/Editors/_EditAddress.py +++ b/src/Editors/_EditAddress.py @@ -144,5 +144,4 @@ class EditAddress(EditSecondary): """ if self.callback: self.callback(self.obj) - self.close_window(obj) - + self.close() diff --git a/src/Editors/_EditAttribute.py b/src/Editors/_EditAttribute.py index f2764e6e1..28d1d6de6 100644 --- a/src/Editors/_EditAttribute.py +++ b/src/Editors/_EditAttribute.py @@ -136,8 +136,7 @@ class EditAttribute(EditSecondary): """ if self.callback: self.callback(self.obj) - self.close_window(obj) - + self.close() #------------------------------------------------------------------------- # @@ -159,4 +158,3 @@ class EditFamilyAttribute(EditAttribute): """ EditAttribute.__init__(self, state, uistate, track, attrib, title, data_list, callback) - diff --git a/src/Editors/_EditChildRef.py b/src/Editors/_EditChildRef.py index e942c4946..ebb32b9ef 100644 --- a/src/Editors/_EditChildRef.py +++ b/src/Editors/_EditChildRef.py @@ -131,5 +131,4 @@ class EditChildRef(EditSecondary): """ if self.callback: self.callback(self.obj) - self.close_window(obj) - + self.close() diff --git a/src/Editors/_EditEvent.py b/src/Editors/_EditEvent.py index c238d26c7..aa24b3f45 100644 --- a/src/Editors/_EditEvent.py +++ b/src/Editors/_EditEvent.py @@ -95,7 +95,7 @@ class EditEvent(EditPrimary): etitle, etitle) def _connect_signals(self): - self.top.get_widget('button111').connect('clicked',self.delete_event) + self.top.get_widget('button111').connect('clicked',self.close) self.top.get_widget('button126').connect('clicked',self.help_clicked) ok = self.top.get_widget('ok') diff --git a/src/Editors/_EditEventRef.py b/src/Editors/_EditEventRef.py index b76e09b11..bc7b3ba69 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/Editors/_EditEventRef.py @@ -208,7 +208,7 @@ class EditEventRef(EditReference): if self.update: self.update(self.source_ref,self.source) - self.close_window(None) + self.close() class EditFamilyEventRef(EditEventRef): diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index bf072cb90..a85ec0b86 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -618,7 +618,7 @@ class EditFamily(EditPrimary): clist = self.obj.get_child_ref_list() self.obj = self.dbstate.db.get_family_from_handle(common[0]) self.obj.add_child_ref(clist[0]) - self.close_window() + self.close() try: EditFamily(self.dbstate,self.uistate,[],self.obj) except Errors.WindowActiveError: @@ -634,7 +634,7 @@ class EditFamily(EditPrimary): for fh in father.get_family_handle_list(): fam = self.dbstate.db.get_family_from_handle(fh) if fam.get_mother_handle() == None: - self.close_window() + self.close() try: clist = self.obj.get_child_ref_list() fam.add_child_ref(clist[-1]) @@ -646,7 +646,7 @@ class EditFamily(EditPrimary): for fh in mother.get_family_handle_list(): fam = self.dbstate.db.get_family_from_handle(fh) if fam.get_father_handle() == None: - self.close_window() + self.close() try: clist = self.obj.get_child_ref_list() fam.add_child_ref(clist[-1]) @@ -822,4 +822,4 @@ class EditFamily(EditPrimary): self.db.commit_family(self.obj,trans) self.db.transaction_commit(trans,_("Edit Family")) - self.close_window() + self.close() diff --git a/src/Editors/_EditLdsOrd.py b/src/Editors/_EditLdsOrd.py index a48262e83..c1a4e0ab7 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/Editors/_EditLdsOrd.py @@ -277,7 +277,7 @@ class EditLdsOrd(EditSecondary): if self.callback: self.callback(self.obj) - self.close_window(obj) + self.close() #------------------------------------------------------------------------- # @@ -405,4 +405,4 @@ class EditFamilyLdsOrd(EditSecondary): if self.callback: self.callback(self.obj) - self.close_window(obj) + self.close() diff --git a/src/Editors/_EditMedia.py b/src/Editors/_EditMedia.py index f9d9b0412..71465f7c3 100644 --- a/src/Editors/_EditMedia.py +++ b/src/Editors/_EditMedia.py @@ -206,7 +206,7 @@ class EditMedia(EditPrimary): trans = self.db.transaction_begin() self.db.commit_media_object(self.obj,trans) self.db.transaction_commit(trans,_("Edit Media Object")) - self.close_window() + self.close() class DeleteMediaQuery: diff --git a/src/Editors/_EditMediaRef.py b/src/Editors/_EditMediaRef.py index 52699d811..48d4fd0e9 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/Editors/_EditMediaRef.py @@ -191,4 +191,4 @@ class EditMediaRef(EditReference): if self.update: self.update(self.source_ref,self.source) - self.close_window() + self.close() diff --git a/src/Editors/_EditName.py b/src/Editors/_EditName.py index c391259e7..6067eb68e 100644 --- a/src/Editors/_EditName.py +++ b/src/Editors/_EditName.py @@ -223,6 +223,6 @@ class EditName(EditSecondary): if self.callback: self.callback(self.obj) - self.close_window(obj) + self.close() diff --git a/src/Editors/_EditPersonRef.py b/src/Editors/_EditPersonRef.py index f716a4d23..9b8b3ecfd 100644 --- a/src/Editors/_EditPersonRef.py +++ b/src/Editors/_EditPersonRef.py @@ -142,7 +142,7 @@ class EditPersonRef(EditSecondary): if self.obj.ref: if self.callback: self.callback(self.obj) - self.close_window(obj) + self.close() else: from QuestionDialog import ErrorDialog diff --git a/src/Editors/_EditPrimary.py b/src/Editors/_EditPrimary.py index b7c3c3ff2..fd1abb76d 100644 --- a/src/Editors/_EditPrimary.py +++ b/src/Editors/_EditPrimary.py @@ -102,18 +102,18 @@ class EditPrimary(ManagedWindow.ManagedWindow): button.set_sensitive(not self.db.readonly) def define_cancel_button(self,button): - button.connect('clicked',self.delete_event) + button.connect('clicked',self.close) def define_help_button(self,button,tag): button.connect('clicked', lambda x: GrampsDisplay.help(tag)) - def close_window(self,*obj): + def _do_close(self,*obj): for key in self.signal_keys: self.db.disconnect(key) self._cleanup_on_exit() - self.close() + ManagedWindow.ManagedWindow.close(self) - def delete_event(self,*obj): + def close(self,*obj): """If the data has changed, give the user a chance to cancel the close window""" if not Config.get_dont_ask() and self.data_has_changed(): @@ -121,11 +121,11 @@ class EditPrimary(ManagedWindow.ManagedWindow): _('Save Changes?'), _('If you close without saving, the changes you ' 'have made will be lost'), - self.close_window, + self._do_close, self.save) return True else: - self.close_window() + self._do_close() return False def empty_object(self): diff --git a/src/Editors/_EditReference.py b/src/Editors/_EditReference.py index d3b22a6f4..d765e825e 100644 --- a/src/Editors/_EditReference.py +++ b/src/Editors/_EditReference.py @@ -128,7 +128,7 @@ class EditReference(ManagedWindow.ManagedWindow): button.set_sensitive(not self.db.readonly) def define_cancel_button(self,button): - button.connect('clicked',self.close_window) + button.connect('clicked',self.close) def define_help_button(self,button,tag): import GrampsDisplay @@ -137,8 +137,8 @@ class EditReference(ManagedWindow.ManagedWindow): def _cleanup_on_exit(self): pass - def close_window(self,*obj): + def close(self,*obj): for key in self.signal_keys: self.db.disconnect(key) self._cleanup_on_exit() - self.close() + ManagedWindow.ManagedWindow.close(self) diff --git a/src/Editors/_EditRepoRef.py b/src/Editors/_EditRepoRef.py index 6d6b704f3..da55e77eb 100644 --- a/src/Editors/_EditRepoRef.py +++ b/src/Editors/_EditRepoRef.py @@ -165,5 +165,5 @@ class EditRepoRef(EditReference): if self.update: self.update((self.source_ref,self.source)) - self.close_window() + self.close() diff --git a/src/Editors/_EditSecondary.py b/src/Editors/_EditSecondary.py index 7be1d38ae..3d7883ffd 100644 --- a/src/Editors/_EditSecondary.py +++ b/src/Editors/_EditSecondary.py @@ -88,19 +88,13 @@ class EditSecondary(ManagedWindow.ManagedWindow): button.set_sensitive(not self.db.readonly) def define_cancel_button(self,button): - button.connect('clicked',self.delete_event) + button.connect('clicked',self.close) def define_help_button(self,button,tag): button.connect('clicked', lambda x: GrampsDisplay.help(tag)) - def close_window(self,*obj): + def close(self,*obj): for key in self.signal_keys: self.db.disconnect(key) self._cleanup_on_exit() - self.close() - - def delete_event(self,*obj): - """If the data has changed, give the user a chance to cancel - the close window""" - self.close_window() - + ManagedWindow.ManagedWindow.close(self) diff --git a/src/Editors/_EditSourceRef.py b/src/Editors/_EditSourceRef.py index 9ba7ec6bc..10acda89b 100644 --- a/src/Editors/_EditSourceRef.py +++ b/src/Editors/_EditSourceRef.py @@ -180,5 +180,5 @@ class EditSourceRef(EditReference): if self.update: self.update(self.source_ref,self.source) - self.close_window() + self.close() diff --git a/src/Editors/_EditUrl.py b/src/Editors/_EditUrl.py index 558ae3bd6..dbd6e4195 100644 --- a/src/Editors/_EditUrl.py +++ b/src/Editors/_EditUrl.py @@ -98,5 +98,4 @@ class EditUrl(EditSecondary): def save(self,*obj): self.callback(self.obj) - self.close_window() - + self.close() diff --git a/src/ManagedWindow.py b/src/ManagedWindow.py index 5835b7a56..4f958b70d 100644 --- a/src/ManagedWindow.py +++ b/src/ManagedWindow.py @@ -338,7 +338,7 @@ class ManagedWindow: def set_window(self,window,title,text,msg=None): set_titles(window,title,text,msg) self.window = window - self.window.connect('delete-event',self.delete_event) + self.window.connect('delete-event',self.close) def build_menu_names(self,obj): return ('Undefined Menu','Undefined Submenu') @@ -351,7 +351,7 @@ class ManagedWindow: self.window.set_transient_for(self.parent_window) self.window.show() - def close(self): + def close(self,*obj): """ Close itself.