From c1a97472b405706e3075825a75a45775478835e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 26 Mar 2022 18:32:57 +0100 Subject: [PATCH] login: Move to its own module --- data/resources/resources.gresource.xml | 2 +- data/resources/ui/{idp-button.ui => login-idp-button.ui} | 0 po/POTFILES.in | 2 +- src/{ => login}/idp_button.rs | 2 +- src/{ => login}/login_advanced_dialog.rs | 0 src/{login.rs => login/mod.rs} | 8 ++++++-- src/main.rs | 2 -- 7 files changed, 9 insertions(+), 7 deletions(-) rename data/resources/ui/{idp-button.ui => login-idp-button.ui} (100%) rename src/{ => login}/idp_button.rs (98%) rename src/{ => login}/login_advanced_dialog.rs (100%) rename src/{login.rs => login/mod.rs} (99%) diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml index 2b4f94aa..f9eb156f 100644 --- a/data/resources/resources.gresource.xml +++ b/data/resources/resources.gresource.xml @@ -73,9 +73,9 @@ ui/event-source-dialog.ui ui/greeter.ui ui/identity-verification-widget.ui - ui/idp-button.ui ui/in-app-notification.ui ui/login-advanced-dialog.ui + ui/login-idp-button.ui ui/login.ui ui/media-viewer.ui ui/member-menu.ui diff --git a/data/resources/ui/idp-button.ui b/data/resources/ui/login-idp-button.ui similarity index 100% rename from data/resources/ui/idp-button.ui rename to data/resources/ui/login-idp-button.ui diff --git a/po/POTFILES.in b/po/POTFILES.in index 5b43e68d..7a8aaf07 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -44,7 +44,7 @@ data/resources/ui/qr-code-scanner.ui src/application.rs src/components/editable_avatar.rs src/error_page.rs -src/login.rs +src/login/mod.rs src/secret.rs src/session/account_settings/devices_page/device_list.rs src/session/account_settings/devices_page/device_row.rs diff --git a/src/idp_button.rs b/src/login/idp_button.rs similarity index 98% rename from src/idp_button.rs rename to src/login/idp_button.rs index ac459b80..0963b3b7 100644 --- a/src/idp_button.rs +++ b/src/login/idp_button.rs @@ -73,7 +73,7 @@ mod imp { use super::*; #[derive(Debug, Default, CompositeTemplate)] - #[template(resource = "/org/gnome/FractalNext/idp-button.ui")] + #[template(resource = "/org/gnome/FractalNext/login-idp-button.ui")] pub struct IdpButton { pub brand: Cell, pub id: RefCell>, diff --git a/src/login_advanced_dialog.rs b/src/login/login_advanced_dialog.rs similarity index 100% rename from src/login_advanced_dialog.rs rename to src/login/login_advanced_dialog.rs diff --git a/src/login.rs b/src/login/mod.rs similarity index 99% rename from src/login.rs rename to src/login/mod.rs index 8ad9aadf..7c61fba5 100644 --- a/src/login.rs +++ b/src/login/mod.rs @@ -20,10 +20,14 @@ use matrix_sdk::{ use tokio::task::JoinHandle; use url::{ParseError, Url}; +mod idp_button; +mod login_advanced_dialog; + +use idp_button::IdpButton; +use login_advanced_dialog::LoginAdvancedDialog; + use crate::{ components::{SpinnerButton, Toast}, - idp_button::IdpButton, - login_advanced_dialog::LoginAdvancedDialog, spawn, spawn_tokio, user_facing_error::UserFacingError, Session, diff --git a/src/main.rs b/src/main.rs index 3ba18e61..8a58c6cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,9 +11,7 @@ mod components; mod contrib; mod error_page; mod greeter; -mod idp_button; mod login; -mod login_advanced_dialog; mod secret; mod session; mod user_facing_error;