Commit 0c647ad3 authored by Florian Wagner's avatar Florian Wagner

Make "Start chat" buttons insensitive

parent 7373582c
Pipeline #9933 passed with stage
in 51 minutes and 4 seconds
...@@ -1726,6 +1726,10 @@ impl AppOp { ...@@ -1726,6 +1726,10 @@ impl AppOp {
} }
} }
let btn = self.ui.builder
.get_object::<gtk::Button>("invite_user_button")
.expect("Can't find invite_user_button in ui file.");
btn.set_sensitive(false);
dialog.present(); dialog.present();
scroll.hide(); scroll.hide();
} }
...@@ -1769,6 +1773,10 @@ impl AppOp { ...@@ -1769,6 +1773,10 @@ impl AppOp {
let dialog = self.ui.builder let dialog = self.ui.builder
.get_object::<gtk::Dialog>("new_room_dialog") .get_object::<gtk::Dialog>("new_room_dialog")
.expect("Can't find new_room_dialog in ui file."); .expect("Can't find new_room_dialog in ui file.");
let btn = self.ui.builder
.get_object::<gtk::Button>("new_room_button")
.expect("Can't find new_room_button in ui file.");
btn.set_sensitive(false);
dialog.present(); dialog.present();
} }
...@@ -1802,6 +1810,10 @@ impl AppOp { ...@@ -1802,6 +1810,10 @@ impl AppOp {
let dialog = self.ui.builder let dialog = self.ui.builder
.get_object::<gtk::Dialog>("join_room_dialog") .get_object::<gtk::Dialog>("join_room_dialog")
.expect("Can't find join_room_dialog in ui file."); .expect("Can't find join_room_dialog in ui file.");
let btn = self.ui.builder
.get_object::<gtk::Button>("join_room_button")
.expect("Can't find new_room_button in ui file.");
btn.set_sensitive(false);
dialog.present(); dialog.present();
} }
...@@ -2608,6 +2620,9 @@ impl App { ...@@ -2608,6 +2620,9 @@ impl App {
entry.set_text(""); entry.set_text("");
private.set_active(true); private.set_active(true);
})); }));
entry.connect_changed(clone!(confirm => move |entry| {
confirm.set_sensitive(entry.get_buffer().get_length() > 0);
}));
} }
fn connect_join_room_dialog(&self) { fn connect_join_room_dialog(&self) {
...@@ -2647,6 +2662,9 @@ impl App { ...@@ -2647,6 +2662,9 @@ impl App {
op.lock().unwrap().join_to_room(); op.lock().unwrap().join_to_room();
entry.set_text(""); entry.set_text("");
})); }));
entry.connect_changed(clone!(confirm => move |entry| {
confirm.set_sensitive(entry.get_buffer().get_length() > 0);
}));
} }
fn connect_room_config(&self) { fn connect_room_config(&self) {
...@@ -3163,6 +3181,9 @@ impl App { ...@@ -3163,6 +3181,9 @@ impl App {
invite.connect_clicked(clone!(op => move |_| { invite.connect_clicked(clone!(op => move |_| {
op.lock().unwrap().start_chat(); op.lock().unwrap().start_chat();
})); }));
entry.connect_changed(clone!(invite => move |entry| {
invite.set_sensitive(entry.get_buffer().get_length() > 0);
}));
} }
pub fn connect_roomlist_search(&self) { pub fn connect_roomlist_search(&self) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment