2007-04-17 Don Allingham <don@gramps-project.org>
* src/Editors/_EditRepository.py: fix double click save bug * src/Editors/_EditSource.py: fix double click save bug * src/Editors/_EditEvent.py: fix double click save bug * src/Editors/_EditPlace.py: fix double click save bug * src/Editors/_EditFamily.py (EditFamily.save): fix potential double click of Family Editor dialog svn: r8399
This commit is contained in:
parent
2a3ef69c9e
commit
71162563ed
@ -1,3 +1,11 @@
|
||||
2007-04-17 Don Allingham <don@gramps-project.org>
|
||||
* src/Editors/_EditRepository.py: fix double click save bug
|
||||
* src/Editors/_EditSource.py: fix double click save bug
|
||||
* src/Editors/_EditEvent.py: fix double click save bug
|
||||
* src/Editors/_EditPlace.py: fix double click save bug
|
||||
* src/Editors/_EditFamily.py (EditFamily.save): fix potential double click of Family
|
||||
Editor dialog
|
||||
|
||||
2007-04-16 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/ViewManager.py (create_pages): fix off-by-one error when
|
||||
preselecting last view
|
||||
|
@ -103,12 +103,9 @@ class EditEvent(EditPrimary):
|
||||
self.window.resize(width, height)
|
||||
|
||||
def _connect_signals(self):
|
||||
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')
|
||||
ok.set_sensitive(not self.db.readonly)
|
||||
ok.connect('clicked',self.save)
|
||||
self.define_cancel_button(self.top.get_widget('button111'))
|
||||
self.define_help_button(self.top.get_widget('button126'), 'adv_ev')
|
||||
self.define_ok_button(self.top.get_widget('ok'), self.save)
|
||||
|
||||
def _setup_fields(self):
|
||||
|
||||
@ -214,10 +211,12 @@ class EditEvent(EditPrimary):
|
||||
GrampsDisplay.help('adv-ev')
|
||||
|
||||
def save(self,*obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save event"),
|
||||
_("No data exists for this event. Please "
|
||||
"enter data or cancel the edit."))
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
t = self.obj.get_type()
|
||||
@ -225,6 +224,7 @@ class EditEvent(EditPrimary):
|
||||
ErrorDialog(
|
||||
_("Cannot save event"),
|
||||
_("The event type cannot be empty"))
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
if self.obj.handle == None:
|
||||
|
@ -774,6 +774,7 @@ class EditFamily(EditPrimary):
|
||||
|
||||
def save(self,*obj):
|
||||
|
||||
self.ok_button.set_sensitive(False)
|
||||
if not self.added:
|
||||
original = self.db.get_family_from_handle(self.obj.handle)
|
||||
else:
|
||||
@ -791,6 +792,7 @@ class EditFamily(EditPrimary):
|
||||
QuestionDialog.ErrorDialog(_("A father cannot be his own child"),
|
||||
_("%s is listed as both the father and child "
|
||||
"of the family.") % name)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
elif self.obj.get_mother_handle() in child_list:
|
||||
|
||||
@ -800,6 +802,7 @@ class EditFamily(EditPrimary):
|
||||
QuestionDialog.ErrorDialog(_("A mother cannot be her own child"),
|
||||
_("%s is listed as both the mother and child "
|
||||
"of the family.") % name)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
||||
|
@ -194,6 +194,7 @@ class EditPlace(EditPrimary):
|
||||
Config.sync()
|
||||
|
||||
def save(self,*obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
title = self.obj.get_title()
|
||||
|
||||
trans = self.db.transaction_begin()
|
||||
|
@ -141,11 +141,13 @@ class EditRepository(EditPrimary):
|
||||
self.define_ok_button(self.glade.get_widget('ok'), self.save)
|
||||
|
||||
def save(self,*obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
from QuestionDialog import ErrorDialog
|
||||
ErrorDialog(_("Cannot save repository"),
|
||||
_("No data exists for this repository. Please "
|
||||
"enter data or cancel the edit."))
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
trans = self.db.transaction_begin()
|
||||
|
@ -160,12 +160,15 @@ class EditSource(EditPrimary):
|
||||
return (_('Edit Source'), self.get_menu_title())
|
||||
|
||||
def save(self,*obj):
|
||||
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
ErrorDialog(_("Cannot save source"),
|
||||
_("No data exists for this source. Please "
|
||||
"enter data or cancel the edit."))
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
trans = self.db.transaction_begin()
|
||||
|
Loading…
Reference in New Issue
Block a user