From 0d2a1d25e542da61096c70af33bf0ffb3a5f153e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 5 Dec 2023 11:15:09 +0100 Subject: [PATCH] account-settings: Rename UserPage to GeneralPage This is more consistent with the strings in the interface. Furthermore, I would like to user that name for a page showing a Matrix User --- po/POTFILES.in | 14 ++++++------ .../change_password_subpage.rs | 2 +- .../change_password_subpage.ui | 0 .../deactivate_account_subpage.rs | 2 +- .../deactivate_account_subpage.ui | 0 .../log_out_subpage.rs | 2 +- .../log_out_subpage.ui | 0 .../{user_page => general_page}/mod.rs | 22 ++++++++++--------- .../{user_page => general_page}/mod.ui | 12 +++++----- src/session/view/account_settings/mod.rs | 12 +++++----- src/session/view/account_settings/mod.ui | 2 +- src/ui-resources.gresource.xml | 8 +++---- 12 files changed, 39 insertions(+), 37 deletions(-) rename src/session/view/account_settings/{user_page => general_page}/change_password_subpage.rs (99%) rename src/session/view/account_settings/{user_page => general_page}/change_password_subpage.ui (100%) rename src/session/view/account_settings/{user_page => general_page}/deactivate_account_subpage.rs (99%) rename src/session/view/account_settings/{user_page => general_page}/deactivate_account_subpage.ui (100%) rename src/session/view/account_settings/{user_page => general_page}/log_out_subpage.rs (98%) rename src/session/view/account_settings/{user_page => general_page}/log_out_subpage.ui (100%) rename src/session/view/account_settings/{user_page => general_page}/mod.rs (97%) rename src/session/view/account_settings/{user_page => general_page}/mod.ui (90%) diff --git a/po/POTFILES.in b/po/POTFILES.in index cfdb0382..80845eb6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -37,6 +37,13 @@ src/session/view/account_settings/devices_page/device_list.rs src/session/view/account_settings/devices_page/device_row.rs src/session/view/account_settings/devices_page/device_row.ui src/session/view/account_settings/devices_page/mod.ui +src/session/view/account_settings/general_page/change_password_subpage.rs +src/session/view/account_settings/general_page/change_password_subpage.ui +src/session/view/account_settings/general_page/deactivate_account_subpage.rs +src/session/view/account_settings/general_page/deactivate_account_subpage.ui +src/session/view/account_settings/general_page/log_out_subpage.ui +src/session/view/account_settings/general_page/mod.rs +src/session/view/account_settings/general_page/mod.ui src/session/view/account_settings/mod.ui src/session/view/account_settings/notifications_page.rs src/session/view/account_settings/notifications_page.ui @@ -44,13 +51,6 @@ src/session/view/account_settings/security_page/import_export_keys_subpage.rs src/session/view/account_settings/security_page/import_export_keys_subpage.ui src/session/view/account_settings/security_page/mod.rs src/session/view/account_settings/security_page/mod.ui -src/session/view/account_settings/user_page/change_password_subpage.rs -src/session/view/account_settings/user_page/change_password_subpage.ui -src/session/view/account_settings/user_page/deactivate_account_subpage.rs -src/session/view/account_settings/user_page/deactivate_account_subpage.ui -src/session/view/account_settings/user_page/log_out_subpage.ui -src/session/view/account_settings/user_page/mod.rs -src/session/view/account_settings/user_page/mod.ui src/session/view/content/explore/mod.ui src/session/view/content/explore/public_room_row.rs src/session/view/content/explore/servers_popover.ui diff --git a/src/session/view/account_settings/user_page/change_password_subpage.rs b/src/session/view/account_settings/general_page/change_password_subpage.rs similarity index 99% rename from src/session/view/account_settings/user_page/change_password_subpage.rs rename to src/session/view/account_settings/general_page/change_password_subpage.rs index 5f966817..867485fd 100644 --- a/src/session/view/account_settings/user_page/change_password_subpage.rs +++ b/src/session/view/account_settings/general_page/change_password_subpage.rs @@ -24,7 +24,7 @@ mod imp { #[derive(Debug, Default, CompositeTemplate)] #[template( - resource = "/org/gnome/Fractal/ui/session/view/account_settings/user_page/change_password_subpage.ui" + resource = "/org/gnome/Fractal/ui/session/view/account_settings/general_page/change_password_subpage.ui" )] pub struct ChangePasswordSubpage { pub session: WeakRef, diff --git a/src/session/view/account_settings/user_page/change_password_subpage.ui b/src/session/view/account_settings/general_page/change_password_subpage.ui similarity index 100% rename from src/session/view/account_settings/user_page/change_password_subpage.ui rename to src/session/view/account_settings/general_page/change_password_subpage.ui diff --git a/src/session/view/account_settings/user_page/deactivate_account_subpage.rs b/src/session/view/account_settings/general_page/deactivate_account_subpage.rs similarity index 99% rename from src/session/view/account_settings/user_page/deactivate_account_subpage.rs rename to src/session/view/account_settings/general_page/deactivate_account_subpage.rs index 4e6f3ab5..cb5ee7d2 100644 --- a/src/session/view/account_settings/user_page/deactivate_account_subpage.rs +++ b/src/session/view/account_settings/general_page/deactivate_account_subpage.rs @@ -21,7 +21,7 @@ mod imp { #[derive(Debug, Default, CompositeTemplate)] #[template( - resource = "/org/gnome/Fractal/ui/session/view/account_settings/user_page/deactivate_account_subpage.ui" + resource = "/org/gnome/Fractal/ui/session/view/account_settings/general_page/deactivate_account_subpage.ui" )] pub struct DeactivateAccountSubpage { pub session: WeakRef, diff --git a/src/session/view/account_settings/user_page/deactivate_account_subpage.ui b/src/session/view/account_settings/general_page/deactivate_account_subpage.ui similarity index 100% rename from src/session/view/account_settings/user_page/deactivate_account_subpage.ui rename to src/session/view/account_settings/general_page/deactivate_account_subpage.ui diff --git a/src/session/view/account_settings/user_page/log_out_subpage.rs b/src/session/view/account_settings/general_page/log_out_subpage.rs similarity index 98% rename from src/session/view/account_settings/user_page/log_out_subpage.rs rename to src/session/view/account_settings/general_page/log_out_subpage.rs index de484375..07f66c65 100644 --- a/src/session/view/account_settings/user_page/log_out_subpage.rs +++ b/src/session/view/account_settings/general_page/log_out_subpage.rs @@ -13,7 +13,7 @@ mod imp { #[derive(Debug, Default, CompositeTemplate)] #[template( - resource = "/org/gnome/Fractal/ui/session/view/account_settings/user_page/log_out_subpage.ui" + resource = "/org/gnome/Fractal/ui/session/view/account_settings/general_page/log_out_subpage.ui" )] pub struct LogOutSubpage { pub session: WeakRef, diff --git a/src/session/view/account_settings/user_page/log_out_subpage.ui b/src/session/view/account_settings/general_page/log_out_subpage.ui similarity index 100% rename from src/session/view/account_settings/user_page/log_out_subpage.ui rename to src/session/view/account_settings/general_page/log_out_subpage.ui diff --git a/src/session/view/account_settings/user_page/mod.rs b/src/session/view/account_settings/general_page/mod.rs similarity index 97% rename from src/session/view/account_settings/user_page/mod.rs rename to src/session/view/account_settings/general_page/mod.rs index a7bdd222..4f40da2a 100644 --- a/src/session/view/account_settings/user_page/mod.rs +++ b/src/session/view/account_settings/general_page/mod.rs @@ -32,8 +32,10 @@ mod imp { use super::*; #[derive(Debug, Default, CompositeTemplate)] - #[template(resource = "/org/gnome/Fractal/ui/session/view/account_settings/user_page/mod.ui")] - pub struct UserPage { + #[template( + resource = "/org/gnome/Fractal/ui/session/view/account_settings/general_page/mod.ui" + )] + pub struct GeneralPage { pub session: WeakRef, #[template_child] pub avatar: TemplateChild, @@ -60,9 +62,9 @@ mod imp { } #[glib::object_subclass] - impl ObjectSubclass for UserPage { - const NAME: &'static str = "UserPage"; - type Type = super::UserPage; + impl ObjectSubclass for GeneralPage { + const NAME: &'static str = "AccountSettingsGeneralPage"; + type Type = super::GeneralPage; type ParentType = adw::PreferencesPage; fn class_init(klass: &mut Self::Class) { @@ -96,7 +98,7 @@ mod imp { } } - impl ObjectImpl for UserPage { + impl ObjectImpl for GeneralPage { fn properties() -> &'static [glib::ParamSpec] { use once_cell::sync::Lazy; static PROPERTIES: Lazy> = Lazy::new(|| { @@ -132,18 +134,18 @@ mod imp { } } - impl WidgetImpl for UserPage {} - impl PreferencesPageImpl for UserPage {} + impl WidgetImpl for GeneralPage {} + impl PreferencesPageImpl for GeneralPage {} } glib::wrapper! { /// Account settings page about the user and the session. - pub struct UserPage(ObjectSubclass) + pub struct GeneralPage(ObjectSubclass) @extends gtk::Widget, adw::PreferencesPage, @implements gtk::Accessible; } #[gtk::template_callbacks] -impl UserPage { +impl GeneralPage { pub fn new(session: &Session) -> Self { glib::Object::builder().property("session", session).build() } diff --git a/src/session/view/account_settings/user_page/mod.ui b/src/session/view/account_settings/general_page/mod.ui similarity index 90% rename from src/session/view/account_settings/user_page/mod.ui rename to src/session/view/account_settings/general_page/mod.ui index bcc5f301..ea0e2b17 100644 --- a/src/session/view/account_settings/user_page/mod.ui +++ b/src/session/view/account_settings/general_page/mod.ui @@ -1,6 +1,6 @@ -