Move Controller::createRoom and Controller::createSpace to NeoChatConnection
This commit is contained in:
committed by
James Graham
parent
ff0990bb7c
commit
f7d2ffac66
@@ -12,6 +12,8 @@ FormCard.FormCardPage {
|
||||
|
||||
title: i18nc("@title", "Create a Room")
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
Component.onCompleted: roomNameField.forceActiveFocus()
|
||||
|
||||
FormCard.FormHeader {
|
||||
@@ -35,7 +37,7 @@ FormCard.FormCardPage {
|
||||
text: i18nc("@action:button", "Ok")
|
||||
enabled: roomNameField.text.length > 0
|
||||
onClicked: {
|
||||
Controller.createRoom(roomNameField.text, roomTopicField.text);
|
||||
root.connection.createRoom(roomNameField.text, roomTopicField.text);
|
||||
root.closeDialog()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
FormCard.FormCardPage {
|
||||
id: root
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
title: i18n("Create a Space")
|
||||
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
||||
@@ -30,7 +32,7 @@ FormCard.FormCardPage {
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18n("Create space")
|
||||
onClicked: {
|
||||
Controller.createSpace(nameDelegate.text, topicDelegate.text)
|
||||
root.connection.createSpace(nameDelegate.text, topicDelegate.text)
|
||||
root.close()
|
||||
root.destroy()
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ RowLayout {
|
||||
|
||||
property var desiredWidth
|
||||
property bool collapsed: false
|
||||
required property NeoChatConnection connection
|
||||
|
||||
property Kirigami.Action exploreAction: Kirigami.Action {
|
||||
text: i18n("Explore rooms")
|
||||
@@ -38,7 +39,7 @@ RowLayout {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/CreateRoomDialog.qml", {}, {title: i18nc("@title", "Create a Room")})
|
||||
pageStack.pushDialogLayer("qrc:/CreateRoomDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Create a Room")})
|
||||
}
|
||||
shortcut: StandardKey.New
|
||||
}
|
||||
@@ -46,7 +47,7 @@ RowLayout {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/CreateSpaceDialog.qml", {}, {title: i18nc("@title", "Create a Space")})
|
||||
pageStack.pushDialogLayer("qrc:/CreateSpaceDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Create a Space")})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ Kirigami.Page {
|
||||
Layout.fillWidth: true
|
||||
desiredWidth: root.width - Kirigami.Units.largeSpacing
|
||||
collapsed: root.collapsed
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
padding: 0
|
||||
|
||||
@@ -320,12 +320,16 @@ Kirigami.ApplicationWindow {
|
||||
Component {
|
||||
id: createRoomDialog
|
||||
|
||||
CreateRoomDialog {}
|
||||
CreateRoomDialog {
|
||||
connection: Controller.activeConnection
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: createSpaceDialog
|
||||
CreateSpaceDialog {}
|
||||
CreateSpaceDialog {
|
||||
connection: Controller.activeConnection
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
Reference in New Issue
Block a user