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:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user