Move the sign out button outside the editor, and close the dialog
This commit is contained in:
@@ -51,6 +51,8 @@ QQC2.Menu {
|
|||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: confirmLogoutDialogComponent
|
id: confirmLogoutDialogComponent
|
||||||
Dialog.ConfirmLogout {}
|
Dialog.ConfirmLogout {
|
||||||
|
connection: Controller.activeConnection
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,28 +249,6 @@ Kirigami.ScrollablePage {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18n("Sign out")
|
|
||||||
}
|
|
||||||
MobileForm.FormCard {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormButtonDelegate {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: i18n("Sign out")
|
|
||||||
onClicked: {
|
|
||||||
Controller.logout(root.connection, true);
|
|
||||||
root.closeDialog();
|
|
||||||
if (Controller.accountCount === 1) {
|
|
||||||
pageStack.layers.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: openFileDialog
|
id: openFileDialog
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
|
import QtQuick.Window 2.15
|
||||||
import Qt.labs.platform 1.1
|
import Qt.labs.platform 1.1
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
@@ -11,8 +12,11 @@ import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
|||||||
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
import 'Dialog' as Dialog
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
|
id: page
|
||||||
|
|
||||||
title: i18n("Accounts")
|
title: i18n("Accounts")
|
||||||
topPadding: 0
|
topPadding: 0
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
@@ -32,7 +36,7 @@ Kirigami.ScrollablePage {
|
|||||||
model: AccountRegistry
|
model: AccountRegistry
|
||||||
delegate: MobileForm.AbstractFormDelegate {
|
delegate: MobileForm.AbstractFormDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onClicked: pageSettingStack.pushDialogLayer("qrc:/AccountEditorPage.qml", {
|
onClicked: pageStack.layers.push("qrc:/AccountEditorPage.qml", {
|
||||||
connection: model.connection
|
connection: model.connection
|
||||||
}, {
|
}, {
|
||||||
title: i18n("Account editor")
|
title: i18n("Account editor")
|
||||||
@@ -71,6 +75,20 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QQC2.ToolButton {
|
||||||
|
text: i18n("Logout")
|
||||||
|
icon.name: "im-kick-user"
|
||||||
|
onClicked: confirmLogoutDialogComponent.createObject(QQC2.ApplicationWindow.overlay).open()
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: confirmLogoutDialogComponent
|
||||||
|
Dialog.ConfirmLogout {
|
||||||
|
connection: model.connection
|
||||||
|
onAccepted: page.Window.window.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MobileForm.FormArrow {
|
MobileForm.FormArrow {
|
||||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||||
direction: MobileForm.FormArrow.Right
|
direction: MobileForm.FormArrow.Right
|
||||||
|
|||||||
Reference in New Issue
Block a user