Rework config dialog
Use new KirigamiAddons ConfigurationsView as a replacement for CategorizedSettings. Fix some issues on desktop when running Qt 6.8 and some less recent issues on mobile. Visually this looks the same.
This commit is contained in:
@@ -15,13 +15,14 @@ QQC2.Menu {
|
||||
id: root
|
||||
|
||||
required property NeoChatConnection connection
|
||||
required property Kirigami.ApplicationWindow window
|
||||
|
||||
margins: Kirigami.Units.smallSpacing
|
||||
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Edit this account")
|
||||
icon.name: "document-edit"
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
onTriggered: root.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -30,32 +31,22 @@ QQC2.Menu {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Notification settings")
|
||||
icon.name: "notifications"
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
defaultPage: "notifications",
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
})
|
||||
onTriggered: {
|
||||
NeoChatSettingsView.open('notifications');
|
||||
}
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Devices")
|
||||
icon.name: "computer-symbolic"
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
defaultPage: "devices",
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
})
|
||||
onTriggered: {
|
||||
NeoChatSettingsView.open('devices');
|
||||
}
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Open developer tools")
|
||||
icon.name: "tools"
|
||||
visible: Config.developerTools
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||
onTriggered: root.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title:window", "Developer Tools"),
|
||||
@@ -67,7 +58,7 @@ QQC2.Menu {
|
||||
text: i18nc("@action:inmenu", "Open Secret Backup")
|
||||
icon.name: "unlock"
|
||||
visible: Config.secretBackup
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UnlockSSSSDialog'), {}, {
|
||||
onTriggered: root.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UnlockSSSSDialog'), {}, {
|
||||
title: i18nc("@title:window", "Open Key Backup")
|
||||
})
|
||||
}
|
||||
@@ -80,7 +71,7 @@ QQC2.Menu {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Logout")
|
||||
icon.name: "list-remove-user"
|
||||
onTriggered: confirmLogoutDialogComponent.createObject(applicationWindow().overlay).open()
|
||||
onTriggered: confirmLogoutDialogComponent.createObject(root.window.overlay).open()
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
@@ -108,14 +108,11 @@ Loader {
|
||||
}
|
||||
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Room Settings")
|
||||
icon.name: "configure"
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
text: i18nc("@action:inmenu", "Room Settings")
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
onTriggered: {
|
||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Room);
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.MenuSeparator {}
|
||||
@@ -187,14 +184,10 @@ Loader {
|
||||
}
|
||||
|
||||
QQC2.ToolButton {
|
||||
icon.name: 'settings-configure'
|
||||
text: i18nc("@action:button", "Room Settings")
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
onClicked: {
|
||||
QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
});
|
||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Room);
|
||||
drawer.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,7 @@ Labs.MenuBar {
|
||||
text: i18nc("menu", "Configure NeoChat...")
|
||||
|
||||
shortcut: StandardKey.Preferences
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
})
|
||||
onTriggered: NeoChatSettingsView.open()
|
||||
}
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "Quit NeoChat")
|
||||
|
||||
@@ -41,6 +41,7 @@ Kirigami.ApplicationWindow {
|
||||
onConnectionChanged: {
|
||||
CustomEmojiModel.connection = root.connection;
|
||||
SpaceHierarchyCache.connection = root.connection;
|
||||
NeoChatSettingsView.connection = root.connection;
|
||||
if (ShareHandler.text && root.connection) {
|
||||
root.handleShare();
|
||||
}
|
||||
@@ -190,6 +191,9 @@ Kirigami.ApplicationWindow {
|
||||
Component.onCompleted: {
|
||||
CustomEmojiModel.connection = root.connection;
|
||||
SpaceHierarchyCache.connection = root.connection;
|
||||
RoomSettingsView.window = root;
|
||||
NeoChatSettingsView.window = root;
|
||||
NeoChatSettingsView.connection = root.connection;
|
||||
WindowController.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
||||
if (ShareHandler.text && root.connection) {
|
||||
root.handleShare()
|
||||
@@ -321,15 +325,10 @@ Kirigami.ApplicationWindow {
|
||||
Shortcut {
|
||||
sequence: "Ctrl+Shift+,"
|
||||
onActivated: {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
});
|
||||
NeoChatSettingsView.open();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ShareHandler
|
||||
function onTextChanged(): void {
|
||||
|
||||
@@ -100,20 +100,17 @@ Kirigami.OverlayDrawer {
|
||||
QQC2.ToolButton {
|
||||
id: settingsButton
|
||||
|
||||
icon.name: "settings-configure"
|
||||
text: i18n("Room settings")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
text: i18nc("@action:button", "Room settings")
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
QQC2.ToolTip.visible: hovered
|
||||
|
||||
onClicked: {
|
||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Room);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ QQC2.Control {
|
||||
}
|
||||
}
|
||||
|
||||
function createContextMenu(room) {
|
||||
function createContextMenu(room: NeoChatRoom): void {
|
||||
let context = spaceListContextMenu.createObject(root, {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
@@ -309,6 +309,8 @@ QQC2.Control {
|
||||
}
|
||||
Component {
|
||||
id: spaceListContextMenu
|
||||
SpaceListContextMenu {}
|
||||
SpaceListContextMenu {
|
||||
window: root.QQC2.ApplicationWindow.window
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,15 +70,15 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
QQC2.Button {
|
||||
text: i18nc("@button", "Space settings")
|
||||
icon.name: "settings-configure"
|
||||
id: settingsButton
|
||||
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: root.currentRoom,
|
||||
connection: root.currentRoom.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||
onClicked: {
|
||||
RoomSettingsView.openRoomSettings(root.currentRoom, RoomSettingsView.Space);
|
||||
drawer.close();
|
||||
}
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
@@ -21,6 +21,7 @@ Loader {
|
||||
|
||||
property NeoChatRoom room
|
||||
required property NeoChatConnection connection
|
||||
required property Kirigami.ApplicationWindow window
|
||||
|
||||
signal closed
|
||||
|
||||
@@ -45,13 +46,10 @@ Loader {
|
||||
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||
icon.name: 'settings-configure'
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
title: i18n("Space Settings")
|
||||
})
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
onTriggered: {
|
||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Space);
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.MenuSeparator {}
|
||||
@@ -130,13 +128,11 @@ Loader {
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||
icon.name: 'settings-configure'
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'RoomSettings'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
title: i18n("Space Settings")
|
||||
})
|
||||
icon.name: 'settings-configure-symbolic'
|
||||
onClicked: {
|
||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Space);
|
||||
drawer.close();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
|
||||
@@ -48,21 +48,16 @@ RowLayout {
|
||||
|
||||
activeFocusOnTab: true
|
||||
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
defaultPage: "accounts",
|
||||
connection: root.connection,
|
||||
initialAccount: root.connection
|
||||
}, {
|
||||
title: i18nc("@action:button", "Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
})
|
||||
onClicked: {
|
||||
NeoChatSettingsView.open("accounts")
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onTapped: accountMenu.open()
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: Math.round(root.width * 0.55)
|
||||
@@ -99,15 +94,13 @@ RowLayout {
|
||||
}).open();
|
||||
},
|
||||
Kirigami.Action {
|
||||
id: openSettingsAction
|
||||
|
||||
text: i18n("Open Settings")
|
||||
icon.name: "settings-configure"
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.settings', 'NeoChatSettings'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
width: Kirigami.Units.gridUnit * 50,
|
||||
height: Kirigami.Units.gridUnit * 42
|
||||
})
|
||||
icon.name: "settings-configure-symbolic"
|
||||
onTriggered: {
|
||||
NeoChatSettingsView.open();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
|
||||
FormCard.AboutPage {
|
||||
title: i18nc("@title:window", "About NeoChat")
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
|
||||
FormCard.AboutKDE {
|
||||
title: i18nc("@title:window", "About KDE")
|
||||
}
|
||||
@@ -28,7 +28,7 @@ FormCard.FormCardPage {
|
||||
id: intialAccountTimer
|
||||
interval: 10
|
||||
running: false
|
||||
onTriggered: applicationWindow().pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
onTriggered: root.QQC2.ApplicationWindow.window.pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
connection: initialAccount
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -45,7 +45,7 @@ FormCard.FormCardPage {
|
||||
id: accountDelegate
|
||||
required property NeoChatConnection connection
|
||||
Layout.fillWidth: true
|
||||
onClicked: applicationWindow().pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
onClicked: root.QQC2.ApplicationWindow.window.pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
connection: accountDelegate.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -87,7 +87,7 @@ FormCard.FormCardPage {
|
||||
QQC2.ToolButton {
|
||||
text: i18n("Logout")
|
||||
icon.name: "im-kick-user"
|
||||
onClicked: confirmLogoutDialogComponent.createObject(applicationWindow().overlay).open()
|
||||
onClicked: confirmLogoutDialogComponent.createObject(root.QQC2.Overlay.overlay).open()
|
||||
}
|
||||
|
||||
Component {
|
||||
@@ -117,7 +117,7 @@ FormCard.FormCardPage {
|
||||
id: addAccountDelegate
|
||||
text: i18n("Add Account")
|
||||
icon.name: "list-add"
|
||||
onClicked: applicationWindow().pageStack.layers.push(Qt.createComponent('org.kde.neochat.login', 'WelcomePage'))
|
||||
onClicked: root.QQC2.ApplicationWindow.window.pageStack.layers.push(Qt.createComponent('org.kde.neochat.login', 'WelcomePage'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
qt_add_library(settings STATIC)
|
||||
|
||||
set_source_files_properties(
|
||||
RoomSettingsView.qml
|
||||
NeoChatSettingsView.qml
|
||||
PROPERTIES
|
||||
QT_QML_SINGLETON_TYPE TRUE
|
||||
)
|
||||
|
||||
qt_add_qml_module(settings
|
||||
URI org.kde.neochat.settings
|
||||
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/settings
|
||||
QML_FILES
|
||||
NeoChatSettings.qml
|
||||
RoomSettings.qml
|
||||
About.qml
|
||||
AboutKDE.qml
|
||||
NeoChatSettingsView.qml
|
||||
RoomSettingsView.qml
|
||||
AccountsPage.qml
|
||||
AccountEditorPage.qml
|
||||
AppearanceSettingsPage.qml
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.settings as KirigamiSettings
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
KirigamiSettings.CategorizedSettings {
|
||||
id: root
|
||||
|
||||
property NeoChatConnection connection
|
||||
|
||||
property NeoChatConnection initialAccount
|
||||
|
||||
objectName: "settingsPage"
|
||||
actions: [
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "general"
|
||||
text: i18n("General")
|
||||
icon.name: "org.kde.neochat"
|
||||
page: Qt.resolvedUrl("NeoChatGeneralPage.qml")
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "appearance"
|
||||
text: i18n("Appearance")
|
||||
icon.name: "preferences-desktop-theme-global"
|
||||
page: Qt.resolvedUrl("AppearanceSettingsPage.qml")
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "notifications"
|
||||
text: i18n("Notifications")
|
||||
icon.name: "preferences-desktop-notification"
|
||||
page: Qt.resolvedUrl("GlobalNotificationsPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "security"
|
||||
text: i18n("Security")
|
||||
icon.name: "preferences-security"
|
||||
page: Qt.resolvedUrl("NeoChatSecurityPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "accounts"
|
||||
text: i18n("Accounts")
|
||||
icon.name: "preferences-system-users"
|
||||
page: Qt.resolvedUrl("AccountsPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
initialAccount: root.initialAccount
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "emoticons"
|
||||
text: i18n("Stickers & Emojis")
|
||||
icon.name: "preferences-desktop-emoticons"
|
||||
page: Qt.resolvedUrl("EmoticonsPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "spellChecking"
|
||||
text: i18n("Spell Checking")
|
||||
icon.name: "tools-check-spelling"
|
||||
page: Qt.resolvedUrl("SonnetConfigPage.qml")
|
||||
visible: Qt.platform.os !== "android"
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "networkProxy"
|
||||
text: i18n("Network Proxy")
|
||||
icon.name: "network-connect"
|
||||
page: Qt.resolvedUrl("NetworkProxyPage.qml")
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "devices"
|
||||
text: i18n("Devices")
|
||||
icon.name: "computer"
|
||||
page: Qt.resolvedUrl("DevicesPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "aboutNeochat"
|
||||
text: i18n("About NeoChat")
|
||||
icon.name: "help-about"
|
||||
page: Qt.resolvedUrl("About.qml")
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "aboutKDE"
|
||||
text: i18n("About KDE")
|
||||
icon.name: "kde"
|
||||
page: Qt.resolvedUrl("AboutKDE.qml")
|
||||
}
|
||||
]
|
||||
}
|
||||
110
src/settings/NeoChatSettingsView.qml
Normal file
110
src/settings/NeoChatSettingsView.qml
Normal file
@@ -0,0 +1,110 @@
|
||||
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.settings as KirigamiSettings
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
KirigamiSettings.ConfigurationView {
|
||||
id: root
|
||||
|
||||
property NeoChatConnection connection
|
||||
|
||||
objectName: "settingsPage"
|
||||
modules: [
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "general"
|
||||
text: i18n("General")
|
||||
icon.name: "org.kde.neochat"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "NeoChatGeneralPage")
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "appearance"
|
||||
text: i18n("Appearance")
|
||||
icon.name: "preferences-desktop-theme-global"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "AppearanceSettingsPage")
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "notifications"
|
||||
text: i18n("Notifications")
|
||||
icon.name: "preferences-desktop-notification"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "GlobalNotificationsPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "security"
|
||||
text: i18n("Security")
|
||||
icon.name: "preferences-security"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "NeoChatSecurityPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "accounts"
|
||||
text: i18n("Accounts")
|
||||
icon.name: "preferences-system-users"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "AccountsPage")
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "emoticons"
|
||||
text: i18n("Stickers & Emojis")
|
||||
icon.name: "preferences-desktop-emoticons"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "EmoticonsPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "spellChecking"
|
||||
text: i18n("Spell Checking")
|
||||
icon.name: "tools-check-spelling"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "SonnetConfigPage")
|
||||
visible: Qt.platform.os !== "android"
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "networkProxy"
|
||||
text: i18n("Network Proxy")
|
||||
icon.name: "network-connect"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "NetworkProxyPage")
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "devices"
|
||||
text: i18n("Devices")
|
||||
icon.name: "computer"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "DevicesPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "aboutNeochat"
|
||||
text: i18n("About NeoChat")
|
||||
icon.name: "help-about"
|
||||
page: () => Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutPage")
|
||||
category: i18nc("@title:group", "About")
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "aboutKDE"
|
||||
text: i18n("About KDE")
|
||||
icon.name: "kde"
|
||||
page: () => Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutKDE")
|
||||
category: i18nc("@title:group", "About")
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.settings as KirigamiSettings
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
KirigamiSettings.CategorizedSettings {
|
||||
id: root
|
||||
|
||||
property NeoChatRoom room
|
||||
required property NeoChatConnection connection
|
||||
|
||||
objectName: "settingsPage"
|
||||
actions: [
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "general"
|
||||
text: i18n("General")
|
||||
icon.name: "settings-configure"
|
||||
page: Qt.resolvedUrl("RoomGeneralPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "security"
|
||||
text: i18n("Security")
|
||||
icon.name: "security-low"
|
||||
page: Qt.resolvedUrl("RoomSecurityPage.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "permissions"
|
||||
text: i18n("Permissions")
|
||||
icon.name: "visibility"
|
||||
page: Qt.resolvedUrl("Permissions.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "notifications"
|
||||
text: i18n("Notifications")
|
||||
icon.name: "notifications"
|
||||
page: Qt.resolvedUrl("PushNotification.qml")
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
83
src/settings/RoomSettingsView.qml
Normal file
83
src/settings/RoomSettingsView.qml
Normal file
@@ -0,0 +1,83 @@
|
||||
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.settings as KirigamiSettings
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
KirigamiSettings.ConfigurationView {
|
||||
id: root
|
||||
|
||||
enum Type {
|
||||
Room,
|
||||
Space
|
||||
}
|
||||
|
||||
property NeoChatRoom _room
|
||||
property NeoChatConnection _connection
|
||||
|
||||
function openRoomSettings(room: NeoChatRoom, type: int): void {
|
||||
root._room = room;
|
||||
root._connection = room.connection;
|
||||
if (type === RoomSettingsView.Type.Space) {
|
||||
root.title = i18nc("@title:window", "Space Settings");
|
||||
} else {
|
||||
root.title = i18nc("@title:window", "Room Settings");
|
||||
}
|
||||
open();
|
||||
}
|
||||
|
||||
objectName: "settingsPage"
|
||||
modules: [
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "general"
|
||||
text: i18n("General")
|
||||
icon.name: "settings-configure"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "RoomGeneralPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
room: root._room,
|
||||
connection: root._connection
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "security"
|
||||
text: i18n("Security")
|
||||
icon.name: "security-low"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "RoomSecurityPage")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
room: root._room
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "permissions"
|
||||
text: i18n("Permissions")
|
||||
icon.name: "visibility"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "Permissions")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
room: root._room
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.ConfigurationModule {
|
||||
moduleId: "notifications"
|
||||
text: i18n("Notifications")
|
||||
icon.name: "notifications"
|
||||
page: () => Qt.createComponent("org.kde.neochat.settings", "PushNotification")
|
||||
initialProperties: () => {
|
||||
return {
|
||||
room: root._room
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user