[fractal/multi-account: 4/5] Connect button to open login page
- From: Alejandro Domínguez <aledomu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/multi-account: 4/5] Connect button to open login page
- Date: Tue, 13 Jul 2021 19:21:24 +0000 (UTC)
commit 6d8da5338284373db216f810ca8b7988d1ed9e8a
Author: Alejandro Domínguez <adomu net-c com>
Date: Tue Jul 13 21:16:49 2021 +0200
Connect button to open login page
src/application.rs | 8 ++++++++
src/window.rs | 5 +++++
2 files changed, 13 insertions(+)
---
diff --git a/src/application.rs b/src/application.rs
index 0137f76d..7dc2aa4a 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -118,6 +118,14 @@ impl Application {
app.show_about_dialog();
})
);
+
+ action!(
+ self,
+ "new-login",
+ clone!(@weak self as app => move |_, _| {
+ app.get_main_window().switch_to_login_page();
+ })
+ );
}
/// Sets up keyboard shortcuts for application and window actions.
diff --git a/src/window.rs b/src/window.rs
index b28255d4..ffa4062d 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -182,4 +182,9 @@ impl Window {
let priv_ = imp::Window::from_instance(self);
priv_.main_stack.set_visible_child(&priv_.sessions.get());
}
+
+ pub fn switch_to_login_page(&self) {
+ let priv_ = imp::Window::from_instance(self);
+ priv_.main_stack.set_visible_child(&priv_.login.get());
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]