diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-26 20:52:45 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-26 20:52:45 (GMT) |
commit | 7443ee4c8ba36e1867fc7f89096c34d08c1c69da (patch) | |
tree | 9f8e0097abbb2ce0248aef6974b2dbd1fcc526cb /shell/view | |
parent | 72d43fde28c19adf61f37c38d4168c02efed0582 (diff) |
Don't allow empty nick names and if it happens consider
the profile invalid.
Diffstat (limited to 'shell/view')
-rw-r--r-- | shell/view/FirstTimeDialog.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/shell/view/FirstTimeDialog.py b/shell/view/FirstTimeDialog.py index abf6bd8..62b5c8b 100644 --- a/shell/view/FirstTimeDialog.py +++ b/shell/view/FirstTimeDialog.py @@ -14,13 +14,19 @@ class FirstTimeDialog(gtk.Dialog): label.show() self._entry = gtk.Entry() + self._entry.connect('changed', self._entry_changed_cb) self.vbox.pack_start(self._entry) self._entry.show() - button = gtk.Button(None, gtk.STOCK_OK) - self.vbox.pack_start(button) - button.connect('clicked', self.__ok_button_clicked_cb) - button.show() + self._ok = gtk.Button(None, gtk.STOCK_OK) + self._ok.set_sensitive(False) + self.vbox.pack_start(self._ok) + self._ok.connect('clicked', self.__ok_button_clicked_cb) + self._ok.show() + + def _entry_changed_cb(self, entry): + valid = (len(entry.get_text()) > 0) + self._ok.set_sensitive(valid) def __ok_button_clicked_cb(self, button): profile = conf.get_profile() |