Update
svn: r6426
This commit is contained in:
parent
25949b819e
commit
ccb0ce6fe1
@ -144,5 +144,4 @@ class EditAddress(EditSecondary):
|
||||
"""
|
||||
if self.callback:
|
||||
self.callback(self.obj)
|
||||
self.close_window(obj)
|
||||
|
||||
self.close()
|
||||
|
@ -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)
|
||||
|
||||
|
@ -131,5 +131,4 @@ class EditChildRef(EditSecondary):
|
||||
"""
|
||||
if self.callback:
|
||||
self.callback(self.obj)
|
||||
self.close_window(obj)
|
||||
|
||||
self.close()
|
||||
|
@ -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')
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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:
|
||||
|
||||
|
@ -191,4 +191,4 @@ class EditMediaRef(EditReference):
|
||||
|
||||
if self.update:
|
||||
self.update(self.source_ref,self.source)
|
||||
self.close_window()
|
||||
self.close()
|
||||
|
@ -223,6 +223,6 @@ class EditName(EditSecondary):
|
||||
|
||||
if self.callback:
|
||||
self.callback(self.obj)
|
||||
self.close_window(obj)
|
||||
self.close()
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -165,5 +165,5 @@ class EditRepoRef(EditReference):
|
||||
if self.update:
|
||||
self.update((self.source_ref,self.source))
|
||||
|
||||
self.close_window()
|
||||
self.close()
|
||||
|
||||
|
@ -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)
|
||||
|
@ -180,5 +180,5 @@ class EditSourceRef(EditReference):
|
||||
if self.update:
|
||||
self.update(self.source_ref,self.source)
|
||||
|
||||
self.close_window()
|
||||
self.close()
|
||||
|
||||
|
@ -98,5 +98,4 @@ class EditUrl(EditSecondary):
|
||||
|
||||
def save(self,*obj):
|
||||
self.callback(self.obj)
|
||||
self.close_window()
|
||||
|
||||
self.close()
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user