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
This commit is contained in:
Kévin Commaille 2023-12-05 11:15:09 +01:00
parent 929ae724a3
commit 0d2a1d25e5
No known key found for this signature in database
GPG key ID: 29A48C1F03620416
12 changed files with 39 additions and 37 deletions

View file

@ -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

View file

@ -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<Session>,

View file

@ -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<Session>,

View file

@ -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<Session>,

View file

@ -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<Session>,
#[template_child]
pub avatar: TemplateChild<EditableAvatar>,
@ -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<Vec<glib::ParamSpec>> = 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<imp::UserPage>)
pub struct GeneralPage(ObjectSubclass<imp::GeneralPage>)
@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()
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="UserPage" parent="AdwPreferencesPage">
<template class="AccountSettingsGeneralPage" parent="AdwPreferencesPage">
<property name="icon-name">settings-symbolic</property>
<property name="title" translatable="yes">General</property>
<property name="name">general</property>
@ -11,7 +11,7 @@
<binding name="data">
<lookup name="avatar-data">
<lookup name="user">
<lookup name="session">UserPage</lookup>
<lookup name="session">AccountSettingsGeneralPage</lookup>
</lookup>
</lookup>
</binding>
@ -28,7 +28,7 @@
<binding name="text">
<lookup name="display-name">
<lookup name="user">
<lookup name="session">UserPage</lookup>
<lookup name="session">AccountSettingsGeneralPage</lookup>
</lookup>
</lookup>
</binding>
@ -147,12 +147,12 @@
</child>
</template>
<object class="ChangePasswordSubpage" id="change_password_subpage">
<property name="session" bind-source="UserPage" bind-property="session" bind-flags="sync-create"/>
<property name="session" bind-source="AccountSettingsGeneralPage" bind-property="session" bind-flags="sync-create"/>
</object>
<object class="DeactivateAccountSubpage" id="deactivate_account_subpage">
<property name="session" bind-source="UserPage" bind-property="session" bind-flags="sync-create"/>
<property name="session" bind-source="AccountSettingsGeneralPage" bind-property="session" bind-flags="sync-create"/>
</object>
<object class="LogOutSubpage" id="log_out_subpage">
<property name="session" bind-source="UserPage" bind-property="session" bind-flags="sync-create"/>
<property name="session" bind-source="AccountSettingsGeneralPage" bind-property="session" bind-flags="sync-create"/>
</object>
</interface>

View file

@ -6,13 +6,13 @@ use gtk::{
};
mod devices_page;
mod general_page;
mod notifications_page;
mod security_page;
mod user_page;
use self::{
devices_page::DevicesPage, notifications_page::NotificationsPage, security_page::SecurityPage,
user_page::UserPage,
devices_page::DevicesPage, general_page::GeneralPage, notifications_page::NotificationsPage,
security_page::SecurityPage,
};
use crate::session::model::Session;
@ -29,7 +29,7 @@ mod imp {
pub session: WeakRef<Session>,
pub session_handler: RefCell<Option<glib::SignalHandlerId>>,
#[template_child]
pub user_page: TemplateChild<UserPage>,
pub general_page: TemplateChild<GeneralPage>,
#[template_child]
pub security_page: TemplateChild<SecurityPage>,
}
@ -42,7 +42,7 @@ mod imp {
fn class_init(klass: &mut Self::Class) {
DevicesPage::static_type();
UserPage::static_type();
GeneralPage::static_type();
NotificationsPage::static_type();
SecurityPage::static_type();
Self::bind_template(klass);
@ -52,7 +52,7 @@ mod imp {
});
klass.install_action("account-settings.logout", None, |obj, _, _| {
obj.imp().user_page.show_log_out_page();
obj.imp().general_page.show_log_out_page();
});
klass.install_action("account-settings.export_keys", None, |obj, _, _| {

View file

@ -5,7 +5,7 @@
<property name="search-enabled">false</property>
<property name="default-height">630</property>
<child>
<object class="UserPage" id="user_page">
<object class="AccountSettingsGeneralPage" id="general_page">
<property name="session" bind-source="AccountSettings" bind-property="session" bind-flags="sync-create"/>
</object>
</child>

View file

@ -32,14 +32,14 @@
<file compressed="true" preprocess="xml-stripblanks">login/sso_page.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/devices_page/device_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/devices_page/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/general_page/change_password_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/general_page/deactivate_account_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/general_page/log_out_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/general_page/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/notifications_page.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/security_page/import_export_keys_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/security_page/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/user_page/change_password_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/user_page/deactivate_account_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/user_page/log_out_subpage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/account_settings/user_page/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/content/explore/mod.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/content/explore/public_room_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">session/view/content/explore/server_row.ui</file>