Add a confirm dialog for the sign out

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan
2022-11-16 11:23:03 +01:00
parent 05c4d6d90c
commit 5e15c38afb
3 changed files with 47 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.15 as Kirigami
QQC2.Dialog {
id: root
ColumnLayout {
Kirigami.Heading {
text: i18n("Sign out")
}
QQC2.Label {
text: i18n("Are you sure you want to sign out?")
}
}
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
modal: true
footer: QQC2.DialogButtonBox {
QQC2.Button {
text: i18n("Cancel")
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
onClicked: root.close()
}
QQC2.Button {
text: i18n("Sign out")
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
onClicked: {
Controller.logout(Controller.activeConnection, true);
root.close();
}
}
}
}