summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-10-09 20:57:38 +0000
committerGitHub <noreply@github.com>2021-10-09 20:57:38 +0000
commit7eb9071b50e540fdcde4d132bdf76825da4518e4 (patch)
tree4736f7d46480146f5ddb41bd1cc598aaca05534f /resources
parentMerge pull request #752 from Thulinma/devicelistEdits (diff)
parentmake lint (diff)
downloadnheko-7eb9071b50e540fdcde4d132bdf76825da4518e4.tar.xz
Merge pull request #743 from LorenDB/qmlLogout
QML the logout dialog
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/Root.qml16
-rw-r--r--resources/qml/dialogs/LogoutDialog.qml19
-rw-r--r--resources/res.qrc1
3 files changed, 36 insertions, 0 deletions
diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml

index 4207f35b..29da45eb 100644 --- a/resources/qml/Root.qml +++ b/resources/qml/Root.qml
@@ -111,6 +111,13 @@ Page { } + Component { + id: logoutDialog + + LogoutDialog { + } + } + Shortcut { sequence: "Ctrl+K" onActivated: { @@ -136,6 +143,15 @@ Page { } Connections { + function onOpenLogoutDialog() { + var dialog = logoutDialog.createObject(timelineRoot); + dialog.open(); + } + + target: Nheko + } + + Connections { function onNewDeviceVerificationRequest(flow) { var dialog = deviceVerificationDialog.createObject(timelineRoot, { "flow": flow diff --git a/resources/qml/dialogs/LogoutDialog.qml b/resources/qml/dialogs/LogoutDialog.qml new file mode 100644
index 00000000..9e107097 --- /dev/null +++ b/resources/qml/dialogs/LogoutDialog.qml
@@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2021 Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import Qt.labs.platform 1.1 +import im.nheko 1.0 + +MessageDialog { + id: logoutRoot + + title: qsTr("Log out") + text: CallManager.isOnCall ? qsTr("A call is in progress. Log out?") : qsTr("Are you sure you want to log out?") + modality: Qt.WindowModal + flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + buttons: Dialog.Ok | Dialog.Cancel + onAccepted: Nheko.logout() +} diff --git a/resources/res.qrc b/resources/res.qrc
index 3bd301f7..c18a6109 100644 --- a/resources/res.qrc +++ b/resources/res.qrc
@@ -184,6 +184,7 @@ <file>qml/dialogs/RoomMembers.qml</file> <file>qml/dialogs/RoomSettings.qml</file> <file>qml/dialogs/UserProfile.qml</file> + <file>qml/dialogs/LogoutDialog.qml</file> </qresource> <qresource prefix="/media"> <file>media/ring.ogg</file>