aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/add_conversation
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-25 21:20:09 +0200
committerfiaxh <git@mx.ax.lt>2017-08-25 22:30:03 +0200
commit8533ba645046e03378d7b9fd3048f15c05f332f7 (patch)
tree8e616e8ac8e598bff9b45dd2237e94361b3635f6 /main/src/ui/add_conversation
parentf3e587d7663edd6dd2bdb2c87a337156d2e9d0e9 (diff)
downloaddino-8533ba645046e03378d7b9fd3048f15c05f332f7.tar.gz
dino-8533ba645046e03378d7b9fd3048f15c05f332f7.zip
Handle xmpp ?join and ?message uris
Diffstat (limited to 'main/src/ui/add_conversation')
-rw-r--r--main/src/ui/add_conversation/chat/dialog.vala4
-rw-r--r--main/src/ui/add_conversation/conference/conference_details_fragment.vala1
-rw-r--r--main/src/ui/add_conversation/select_jid_fragment.vala21
3 files changed, 14 insertions, 12 deletions
diff --git a/main/src/ui/add_conversation/chat/dialog.vala b/main/src/ui/add_conversation/chat/dialog.vala
index 4b618bc5..361f70ba 100644
--- a/main/src/ui/add_conversation/chat/dialog.vala
+++ b/main/src/ui/add_conversation/chat/dialog.vala
@@ -28,6 +28,10 @@ public class Dialog : Gtk.Dialog {
setup_view();
}
+ public void set_filter(string str) {
+ select_jid_fragment.set_filter(str);
+ }
+
private void setup_headerbar() {
HeaderBar header_bar = get_header_bar() as HeaderBar;
header_bar.show_close_button = false;
diff --git a/main/src/ui/add_conversation/conference/conference_details_fragment.vala b/main/src/ui/add_conversation/conference/conference_details_fragment.vala
index d99681a1..9f9ffe9c 100644
--- a/main/src/ui/add_conversation/conference/conference_details_fragment.vala
+++ b/main/src/ui/add_conversation/conference/conference_details_fragment.vala
@@ -83,6 +83,7 @@ protected class ConferenceDetailsFragment : Box {
password_button.clicked.connect(() => { set_active_stack(password_stack); });
account_combobox.changed.connect(() => { accounts_label.label = account_combobox.selected.bare_jid.to_string(); });
+ accounts_label.label = account_combobox.selected.bare_jid.to_string();
jid_entry.key_release_event.connect(on_jid_key_release_event);
nick_entry.key_release_event.connect(on_nick_key_release_event);
password_entry.key_release_event.connect(on_password_key_release_event);
diff --git a/main/src/ui/add_conversation/select_jid_fragment.vala b/main/src/ui/add_conversation/select_jid_fragment.vala
index 98ceb2fa..8e975d2d 100644
--- a/main/src/ui/add_conversation/select_jid_fragment.vala
+++ b/main/src/ui/add_conversation/select_jid_fragment.vala
@@ -11,10 +11,9 @@ public class SelectJidFragment : Gtk.Box {
public signal void add_jid();
public signal void remove_jid(ListRow row);
public bool done {
- get {
- return filterable_list.get_selected_row() != null;
- }
- private set {} }
+ get { return filterable_list.get_selected_row() != null; }
+ private set {}
+ }
[GtkChild] private Entry entry;
[GtkChild] private Box box;
@@ -40,20 +39,18 @@ public class SelectJidFragment : Gtk.Box {
filterable_list.set_sort_func(sort);
filterable_list.row_selected.connect(check_buttons_active);
filterable_list.row_selected.connect(() => { done = true; }); // just for notifying
- entry.changed.connect(on_entry_changed);
+ entry.changed.connect(() => { set_filter(entry.text); });
add_button.clicked.connect(() => { add_jid(); });
remove_button.clicked.connect(() => { remove_jid(filterable_list.get_selected_row() as ListRow); });
}
- private void on_entry_changed() {
- foreach (AddListRow row in added_rows) {
- filterable_list.remove(row);
- }
+ public void set_filter(string str) {
+ if (entry.text != str) entry.text = str;
+
+ foreach (AddListRow row in added_rows) filterable_list.remove(row);
added_rows.clear();
- string[] ? values;
- string str = entry.get_text();
- values = str == "" ? null : str.split(" ");
+ string[] ? values = str == "" ? null : str.split(" ");
filterable_list.set_filter_values(values);
Jid? parsed_jid = Jid.parse(str);
if (parsed_jid != null && parsed_jid.localpart != null) {