[fractal] Reset new room dialog after state is retrieved
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] Reset new room dialog after state is retrieved
- Date: Sat, 10 Apr 2021 10:04:49 +0000 (UTC)
commit bde79fcc858e854b2b4f9e6635a90b4db02b4f76
Author: Kévin Commaille <zecakeh pm me>
Date: Sat Apr 10 11:04:32 2021 +0200
Reset new room dialog after state is retrieved
fractal-gtk/src/appop/room.rs | 3 +++
fractal-gtk/src/ui/connect/new_room.rs | 16 +++++-----------
2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/fractal-gtk/src/appop/room.rs b/fractal-gtk/src/appop/room.rs
index 49ba6cc8..ad3deb31 100644
--- a/fractal-gtk/src/appop/room.rs
+++ b/fractal-gtk/src/appop/room.rs
@@ -385,10 +385,13 @@ impl AppOp {
.expect("Can't find private_visibility_button in ui file.");
let name = name_entry.get_text().to_string();
+ name_entry.set_text("");
+
// Since the switcher
let privacy = if private.get_active() {
room::RoomType::Private
} else {
+ private.set_active(true);
room::RoomType::Public
};
diff --git a/fractal-gtk/src/ui/connect/new_room.rs b/fractal-gtk/src/ui/connect/new_room.rs
index b7dc8e78..5f3c5cf2 100644
--- a/fractal-gtk/src/ui/connect/new_room.rs
+++ b/fractal-gtk/src/ui/connect/new_room.rs
@@ -43,20 +43,14 @@ pub fn connect(ui: &UI, app_runtime: AppRuntime) {
}),
);
- confirm.connect_clicked(
- clone!(@strong entry, @strong dialog, @strong private, @strong app_runtime => move |_| {
- dialog.hide();
- app_runtime.update_state_with(|state| state.create_new_room());
- entry.set_text("");
- private.set_active(true);
- }),
- );
+ confirm.connect_clicked(clone!(@strong dialog, @strong app_runtime => move |_| {
+ dialog.hide();
+ app_runtime.update_state_with(|state| state.create_new_room());
+ }));
- entry.connect_activate(clone!(@strong dialog => move |entry| {
+ entry.connect_activate(clone!(@strong dialog => move |_| {
dialog.hide();
app_runtime.update_state_with(|state| state.create_new_room());
- entry.set_text("");
- private.set_active(true);
}));
entry.connect_changed(clone!(@strong confirm => move |entry| {
confirm.set_sensitive(entry.get_buffer().get_length() > 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]