Port all confirm dialogs to Kirigami.PromptDialog
This commit is contained in:
committed by
Tobias Fella
parent
40d55805ff
commit
f45226a680
@@ -3,38 +3,28 @@
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
QQC2.Dialog {
|
||||
Kirigami.PromptDialog {
|
||||
id: root
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
ColumnLayout {
|
||||
Kirigami.Heading {
|
||||
text: i18n("Sign out")
|
||||
}
|
||||
QQC2.Label {
|
||||
text: i18n("Are you sure you want to sign out?")
|
||||
}
|
||||
title: i18nc("@title:dialog", "Sign out")
|
||||
subtitle: i18n("Are you sure you want to sign out?")
|
||||
dialogType: Kirigami.PromptDialog.Warning
|
||||
|
||||
onRejected: {
|
||||
root.close();
|
||||
}
|
||||
|
||||
x: parent ? Math.round((parent.width - width) / 2) : 0
|
||||
y: parent ? Math.round((parent.height - height) / 2) : 0
|
||||
modal: true
|
||||
|
||||
footer: QQC2.DialogButtonBox {
|
||||
QQC2.Button {
|
||||
text: i18n("Cancel")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
||||
onClicked: root.close()
|
||||
}
|
||||
standardButtons: QQC2.Dialog.Cancel
|
||||
|
||||
QQC2.Button {
|
||||
text: i18n("Sign out")
|
||||
text: i18nc("@action:button", "Sign out")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
root.connection.logout(true);
|
||||
|
||||
Reference in New Issue
Block a user