Initial Account

Restore the functionality where clicking on "edit this account" from the AccountMenu opens setting to the account rather than pushing as its own window
This commit is contained in:
James Graham
2025-06-27 16:08:14 +01:00
parent 6c7a7a7be5
commit 61f9cd41f7
2 changed files with 12 additions and 5 deletions

View File

@@ -47,11 +47,7 @@ KirigamiComponents.ConvergentContextMenu {
QQC2.Action {
text: i18n("Edit This Account")
icon.name: "document-edit"
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
connection: root.connection
}, {
title: i18n("Account editor")
})
onTriggered: NeoChatSettingsView.openWithInitialProperties("accounts", {initialAccount: root.connection});
}
QQC2.Action {

View File

@@ -59,6 +59,7 @@ KirigamiSettings.ConfigurationView {
visible: root.connection !== null
},
KirigamiSettings.ConfigurationModule {
id: accountsModule
moduleId: "accounts"
text: i18n("Accounts")
icon.name: "preferences-system-users-symbolic"
@@ -111,4 +112,14 @@ KirigamiSettings.ConfigurationView {
category: i18nc("@title:group", "About")
}
]
function openWithInitialProperties(defaultModule = '', initialProperties): void {
let module = modules.find(module => module.moduleId == defaultModule) ?? null;
if (module) {
module.initialProperties = () => {
return initialProperties;
}
}
root.open(defaultModule);
}
}