Disable ok button if no activity is set, but enable is selected.

This commit is contained in:
js 2008-07-28 21:36:11 +00:00
parent f7d8631a5c
commit 50406b13e6
1 changed files with 9 additions and 0 deletions

View File

@ -346,6 +346,7 @@ class ChangeActivityDialog:
self.checkbutton = self.xml.get_widget('enable_checkbutton') self.checkbutton = self.xml.get_widget('enable_checkbutton')
self.notebook = self.xml.get_widget('notebook') self.notebook = self.xml.get_widget('notebook')
self.entry = self.xml.get_widget('description_entry') self.entry = self.xml.get_widget('description_entry')
self.ok_button = self.xml.get_widget('ok_button')
self.activity = None self.activity = None
self.subactivity = None self.subactivity = None
@ -418,11 +419,19 @@ class ChangeActivityDialog:
self.notebook.set_sensitive(widget.get_active()) self.notebook.set_sensitive(widget.get_active())
self.entry.set_sensitive(widget.get_active()) self.entry.set_sensitive(widget.get_active())
if widget.get_active() and (self.activity is None \
or self.subactivity is None):
self.ok_button.set_sensitive(False)
else:
self.ok_button.set_sensitive(True)
def on_rbtn_toggled(self, widget, data): def on_rbtn_toggled(self, widget, data):
if widget.get_active(): if widget.get_active():
self.activity = data[0] self.activity = data[0]
self.subactivity = data[1] self.subactivity = data[1]
self.ok_button.set_sensitive(True)
def on_ok_button_clicked(self, widget): def on_ok_button_clicked(self, widget):
''' '''
Return activity and messsage (None if no activity selected) Return activity and messsage (None if no activity selected)