diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6918a9a70..c269d51de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -177,6 +177,7 @@ if(ANDROID) "visibility" "home" "preferences-desktop-notification" + "computer-symbolic" ) else() target_link_libraries(neochat PUBLIC Qt::Widgets KF${QT_MAJOR_VERSION}::KIOWidgets) diff --git a/src/qml/Component/UserInfo.qml b/src/qml/Component/UserInfo.qml index 52305df1d..32cff67d7 100644 --- a/src/qml/Component/UserInfo.qml +++ b/src/qml/Component/UserInfo.qml @@ -144,12 +144,17 @@ QQC2.ToolBar { actions.main: Kirigami.Action { text: i18n("Edit this account") icon.name: "document-edit" - onTriggered: pageStack.pushDialogLayer(Qt.resolvedUrl('./AccountEditorPage.qml'), { + onTriggered: pageStack.pushDialogLayer(Qt.resolvedUrl('qrc:/AccountEditorPage.qml'), { connection: Controller.activeConnection }, { title: i18n("Account editor") }); } + TapHandler { + acceptedButtons: Qt.RightButton + acceptedDevices: PointerDevice.Mouse + onTapped: accountMenu.open() + } } } ColumnLayout { @@ -214,6 +219,11 @@ QQC2.ToolBar { Item { width: 1 } + + AccountMenu { + id: accountMenu + y: -height + } } } } diff --git a/src/qml/Menu/AccountMenu.qml b/src/qml/Menu/AccountMenu.qml new file mode 100644 index 000000000..a0218ea65 --- /dev/null +++ b/src/qml/Menu/AccountMenu.qml @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: 2022 James Graham +// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + +import QtQuick 2.15 +import QtQuick.Controls 2.15 as QQC2 +import QtQuick.Layouts 1.15 + +import org.kde.kirigami 2.19 as Kirigami + +import org.kde.neochat 1.0 + +QQC2.Menu { + id: root + margins: Kirigami.Units.smallSpacing + + QQC2.MenuItem { + text: i18n("Edit this account") + icon.name: "document-edit" + onTriggered: pageStack.pushDialogLayer("qrc:/AccountEditorPage.qml", { + connection: Controller.activeConnection + }, { + title: i18n("Account editor") + }); + } + QQC2.MenuItem { + text: i18n("Notification settings") + icon.name: "notifications" + onTriggered: pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {defaultPage: "notifications"}, { title: i18n("Configure")}) + } + QQC2.MenuItem { + text: i18n("Devices") + icon.name: "computer-symbolic" + onTriggered: pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {defaultPage: "devices"}, { title: i18n("Configure")}) + } + QQC2.MenuItem { + text: i18n("Logout") + icon.name: "list-remove-user" + onTriggered: confirmLogoutDialog.open() + } + + ConfirmLogoutDialog { + id: confirmLogoutDialog + } +} diff --git a/src/qml/Settings/SettingsPage.qml b/src/qml/Settings/SettingsPage.qml index f7a5dff55..19a78e8fb 100644 --- a/src/qml/Settings/SettingsPage.qml +++ b/src/qml/Settings/SettingsPage.qml @@ -9,47 +9,56 @@ Kirigami.CategorizedSettings { objectName: "settingsPage" actions: [ Kirigami.SettingAction { + actionName: "general" text: i18n("General") icon.name: "org.kde.neochat" page: Qt.resolvedUrl("GeneralSettingsPage.qml") }, Kirigami.SettingAction { + actionName: "appearance" text: i18n("Appearance") icon.name: "preferences-desktop-theme-global" page: Qt.resolvedUrl("AppearanceSettingsPage.qml") }, Kirigami.SettingAction { + actionName: "notifications" text: i18n("Notifications") icon.name: "preferences-desktop-notification" page: Qt.resolvedUrl("GlobalNotificationsPage.qml") }, Kirigami.SettingAction { + actionName: "accounts" text: i18n("Accounts") icon.name: "preferences-system-users" page: Qt.resolvedUrl("AccountsPage.qml") }, Kirigami.SettingAction { + actionName: "customEmojis" text: i18n("Custom Emojis") icon.name: "preferences-desktop-emoticons" page: Qt.resolvedUrl("Emoticons.qml") }, Kirigami.SettingAction { + actionName: "spellChecking" text: i18n("Spell Checking") icon.name: "tools-check-spelling" page: Qt.resolvedUrl("SonnetConfigPage.qml") visible: Qt.platform.os !== "android" }, Kirigami.SettingAction { + actionName: "netowrkProxy" text: i18n("Network Proxy") icon.name: "network-connect" page: Qt.resolvedUrl("NetworkProxyPage.qml") }, Kirigami.SettingAction { + actionName: "devices" text: i18n("Devices") icon.name: "computer" page: Qt.resolvedUrl("DevicesPage.qml") }, Kirigami.SettingAction { + actionName: "about" text: i18n("About NeoChat") icon.name: "help-about" page: Qt.resolvedUrl("About.qml") diff --git a/src/res.qrc b/src/res.qrc index fc26d0bd9..295236d06 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -73,6 +73,7 @@ qml/Dialog/KeyVerification/VerificationCanceled.qml qml/Menu/GlobalMenu.qml qml/Menu/EditMenu.qml + qml/Menu/AccountMenu.qml qml/Menu/Timeline/MessageDelegateContextMenu.qml qml/Menu/Timeline/FileDelegateContextMenu.qml qml/Menu/Timeline/MessageSourceSheet.qml