Disable OK button if no one selected

svn: r875
This commit is contained in:
Don Allingham 2002-03-29 13:50:02 +00:00
parent 35e9005c33
commit 0b08d597b8
2 changed files with 18 additions and 3 deletions

View File

@ -82,7 +82,9 @@ class AddSpouse:
self.spouse_list = self.glade.get_widget("spouseList") self.spouse_list = self.glade.get_widget("spouseList")
self.relation_def = self.glade.get_widget("reldef") self.relation_def = self.glade.get_widget("reldef")
self.top = self.glade.get_widget("spouseDialog") self.top = self.glade.get_widget("spouseDialog")
self.ok = self.glade.get_widget('spouse_ok')
self.ok.set_sensitive(0)
self.name_list = self.db.getPersonMap().values() self.name_list = self.db.getPersonMap().values()
self.name_list.sort(sort.by_last_name) self.name_list.sort(sort.by_last_name)
self.rel_combo.set_popdown_strings(const.familyRelations) self.rel_combo.set_popdown_strings(const.familyRelations)
@ -94,11 +96,19 @@ class AddSpouse:
"on_new_spouse_clicked" : self.new_spouse_clicked, "on_new_spouse_clicked" : self.new_spouse_clicked,
"on_rel_type_changed" : self.relation_type_changed, "on_rel_type_changed" : self.relation_type_changed,
"on_combo_insert_text" : Utils.combo_insert_text, "on_combo_insert_text" : Utils.combo_insert_text,
"on_select_row" : self.select_row,
"on_unselect_row" : self.unselect_row,
"destroy_passed_object" : Utils.destroy_passed_object "destroy_passed_object" : Utils.destroy_passed_object
}) })
self.relation_type.set_text(_("Married")) self.relation_type.set_text(_("Married"))
def select_row(self,obj,a,b,c):
self.ok.set_sensitive(1)
def unselect_row(self,obj,a,b,c):
self.ok.set_sensitive(0)
def new_spouse_clicked(self,obj): def new_spouse_clicked(self,obj):
""" """
Called when the spouse to be added does not exist, and needs Called when the spouse to be added does not exist, and needs

View File

@ -4594,7 +4594,7 @@
<widget> <widget>
<class>GtkButton</class> <class>GtkButton</class>
<name>spouseExistingPerson</name> <name>spouse_ok</name>
<can_default>True</can_default> <can_default>True</can_default>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
@ -4680,8 +4680,13 @@
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
<name>select_row</name> <name>select_row</name>
<handler>on_spouseList_select_row</handler> <handler>on_select_row</handler>
<last_modification_time>Sun, 19 Nov 2000 00:44:36 GMT</last_modification_time> <last_modification_time>Fri, 29 Mar 2002 13:44:27 GMT</last_modification_time>
</signal>
<signal>
<name>unselect_row</name>
<handler>on_unselect_row</handler>
<last_modification_time>Fri, 29 Mar 2002 13:44:33 GMT</last_modification_time>
</signal> </signal>
<columns>2</columns> <columns>2</columns>
<column_widths>256,80</column_widths> <column_widths>256,80</column_widths>