mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-21 22:44:23 +00:00
Fix channel join button not getting sensitive
This commit is contained in:
parent
146af31524
commit
21ab48e09a
1 changed files with 18 additions and 13 deletions
|
@ -12,17 +12,7 @@ protected class ConferenceDetailsFragment : Box {
|
|||
|
||||
public signal void joined();
|
||||
|
||||
public bool done {
|
||||
get {
|
||||
try {
|
||||
Jid parsed_jid = new Jid(jid);
|
||||
return parsed_jid.localpart != null && parsed_jid.resourcepart == null && nick != null;
|
||||
} catch (InvalidJidError e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private set {}
|
||||
}
|
||||
public bool done { get; private set; }
|
||||
|
||||
public Account account {
|
||||
owned get { return account_combobox.selected; }
|
||||
|
@ -118,8 +108,14 @@ protected class ConferenceDetailsFragment : Box {
|
|||
// nick_entry.key_release_event.connect(on_nick_key_release_event);
|
||||
// password_entry.key_release_event.connect(on_password_key_release_event);
|
||||
|
||||
// jid_entry.key_release_event.connect(() => { done = true; return false; }); // just for notifying
|
||||
// nick_entry.key_release_event.connect(() => { done = true; return false; });
|
||||
var jid_entry_controller = new EventControllerKey();
|
||||
jid_entry_controller.key_released.connect(() => { check_if_done(); });
|
||||
jid_entry.add_controller(jid_entry_controller);
|
||||
|
||||
var nick_entry_controller = new EventControllerKey();
|
||||
nick_entry_controller.key_released.connect(() => { check_if_done(); });
|
||||
nick_entry.add_controller(nick_entry_controller);
|
||||
|
||||
|
||||
notification_button.clicked.connect(() => { notification_revealer.set_reveal_child(false); });
|
||||
|
||||
|
@ -195,6 +191,15 @@ protected class ConferenceDetailsFragment : Box {
|
|||
notification_revealer.set_reveal_child(true);
|
||||
}
|
||||
|
||||
private void check_if_done() {
|
||||
try {
|
||||
Jid parsed_jid = new Jid(jid);
|
||||
done = parsed_jid.localpart != null && parsed_jid.resourcepart == null && nick != null;
|
||||
} catch (InvalidJidError e) {
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
|
||||
// private bool on_jid_key_release_event(EventKey event) {
|
||||
// jid_label.label = jid_entry.text;
|
||||
// if (event.keyval == Key.Return) jid_stack.set_visible_child_name("label");
|
||||
|
|
Loading…
Reference in a new issue