ServiceRegistration: Validate form before sending
This commit is contained in:
parent
6b65a23371
commit
4753e6015e
1 changed files with 5 additions and 0 deletions
|
@ -89,6 +89,8 @@ class ServiceRegistration(Gtk.Assistant):
|
|||
if is_form:
|
||||
dataform = dataforms.extend_form(node=form)
|
||||
self._data_form_widget = DataFormWidget(dataform)
|
||||
self._data_form_widget.connect('is-valid', self._on_is_valid)
|
||||
self._data_form_widget.validate()
|
||||
else:
|
||||
from gajim import config
|
||||
self._data_form_widget = config.FakeDataForm(form)
|
||||
|
@ -98,6 +100,9 @@ class ServiceRegistration(Gtk.Assistant):
|
|||
self._data_form_widget.show_all()
|
||||
self.set_current_page(Page.FORM)
|
||||
|
||||
def _on_is_valid(self, _widget, is_valid):
|
||||
self.set_page_complete(self.get_nth_page(Page.FORM), is_valid)
|
||||
|
||||
def _on_error(self, error_text):
|
||||
log.info('Show Error page')
|
||||
page = self.get_nth_page(Page.ERROR)
|
||||
|
|
Loading…
Add table
Reference in a new issue