Adapt to QTP0001
This commit is contained in:
@@ -58,6 +58,9 @@ set_package_properties(Qt6 PROPERTIES
|
||||
TYPE REQUIRED
|
||||
PURPOSE "Basic application components"
|
||||
)
|
||||
|
||||
qt_policy(SET QTP0001 NEW)
|
||||
|
||||
find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme)
|
||||
set_package_properties(KF6 PROPERTIES
|
||||
TYPE REQUIRED
|
||||
|
||||
@@ -250,7 +250,7 @@ int main(int argc, char *argv[])
|
||||
engine.addImageProvider(QLatin1String("mxc"), MatrixImageProvider::create(&engine, &engine));
|
||||
engine.addImageProvider(QLatin1String("blurhash"), new BlurhashImageProvider);
|
||||
|
||||
engine.load(QUrl(QStringLiteral("qrc:/org/kde/neochat/qml/main.qml")));
|
||||
engine.load(QUrl(QStringLiteral("qrc:/qt/qml/org/kde/neochat/qml/main.qml")));
|
||||
if (engine.rootObjects().isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ FormCard.FormCardPage {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: deactivateAccountButton
|
||||
text: i18n("Deactivate Account")
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ConfirmDeactivateAccountDialog.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ConfirmDeactivateAccountDialog.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Confirm Deactivating Account")
|
||||
|
||||
@@ -20,7 +20,7 @@ QQC2.Menu {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Edit this account")
|
||||
icon.name: "document-edit"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/AccountEditorPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'AccountEditorPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -29,7 +29,7 @@ QQC2.Menu {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Notification settings")
|
||||
icon.name: "notifications"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'SettingsPage.qml'), {
|
||||
defaultPage: "notifications",
|
||||
connection: root.connection
|
||||
}, {
|
||||
@@ -41,7 +41,7 @@ QQC2.Menu {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Devices")
|
||||
icon.name: "computer-symbolic"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'SettingsPage.qml'), {
|
||||
defaultPage: "devices",
|
||||
connection: root.connection
|
||||
}, {
|
||||
|
||||
@@ -29,7 +29,7 @@ FormCard.FormCardPage {
|
||||
id: accountDelegate
|
||||
required property NeoChatConnection connection
|
||||
Layout.fillWidth: true
|
||||
onClicked: pageStack.layers.push("qrc:/org/kde/neochat/qml/AccountEditorPage.qml", {
|
||||
onClicked: applicationWindow().pageStack.layers.push(Qt.createComponent('org.kde.neochat', 'AccountEditorPage.qml'), {
|
||||
connection: accountDelegate.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -101,7 +101,7 @@ FormCard.FormCardPage {
|
||||
id: addAccountDelegate
|
||||
text: i18n("Add Account")
|
||||
icon.name: "list-add"
|
||||
onClicked: pageStack.layers.push("qrc:/org/kde/neochat/qml/WelcomePage.qml")
|
||||
onClicked: applicationWindow().pageStack.layers.push(Qt.createComponent('org.kde.neochat', 'WelcomePage.qml'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ FormCard.FormCardPage {
|
||||
Loader {
|
||||
id: colorSchemeDelegate
|
||||
visible: item !== null
|
||||
source: "qrc:/org/kde/neochat/qml/ColorScheme.qml"
|
||||
sourceComponent: Qt.createComponent('org.kde.neochat', 'ColorScheme.qml')
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,6 @@ LoginStep {
|
||||
}
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
onTriggered: root.processed("Username.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ Loader {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Room Settings")
|
||||
icon.name: "configure"
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
@@ -195,7 +195,7 @@ Loader {
|
||||
QQC2.ToolButton {
|
||||
icon.name: 'settings-configure'
|
||||
onClicked: {
|
||||
QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
|
||||
@@ -111,7 +111,7 @@ FormCard.FormCardPage {
|
||||
visible: !chosenRoomDelegate.visible
|
||||
text: i18nc("@action:button", "Pick room")
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
@@ -194,7 +194,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
|
||||
@@ -94,7 +94,7 @@ Loader {
|
||||
text: i18n("Remove")
|
||||
icon.name: "edit-delete-remove"
|
||||
icon.color: "red"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RemoveSheet.qml'), {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
@@ -117,7 +117,7 @@ Loader {
|
||||
text: i18nc("@action:button 'Report' as in 'Report this event to the administrators'", "Report")
|
||||
icon.name: "dialog-warning-symbolic"
|
||||
visible: !author.isLocalUser
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ReportSheet.qml", {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReportSheet.qml'), {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
|
||||
@@ -55,6 +55,6 @@ LoginStep {
|
||||
}
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
onTriggered: root.processed("Username.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ RowLayout {
|
||||
text: i18n("Explore rooms")
|
||||
icon.name: "compass"
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
@@ -36,7 +36,7 @@ RowLayout {
|
||||
property Kirigami.Action chatAction: Kirigami.Action {
|
||||
text: i18n("Find your friends")
|
||||
icon.name: "list-add-user"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
@@ -46,7 +46,7 @@ RowLayout {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
@@ -58,7 +58,7 @@ RowLayout {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog.qml'), {
|
||||
connection: root.connection,
|
||||
isSpace: true,
|
||||
title: i18nc("@title", "Create a Space")
|
||||
|
||||
@@ -52,7 +52,7 @@ ColumnLayout {
|
||||
text: i18n("Explore rooms")
|
||||
icon.name: "compass"
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
@@ -67,7 +67,7 @@ ColumnLayout {
|
||||
text: i18n("Find your friends")
|
||||
icon.name: "list-add-user"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
@@ -140,7 +140,7 @@ ColumnLayout {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
@@ -156,7 +156,7 @@ ColumnLayout {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog.qml'), {
|
||||
connection: root.connection,
|
||||
isSpace: true,
|
||||
title: i18nc("@title", "Create a Space")
|
||||
|
||||
@@ -63,7 +63,7 @@ Item {
|
||||
}
|
||||
|
||||
ImageParticle {
|
||||
source: "qrc:/org/kde/neochat/qml/confetti.png"
|
||||
source: "qrc:/qt/qml/org/kde/neochat/qml/confetti.png"
|
||||
entryEffect: ImageParticle.Scale
|
||||
rotationVariation: 360
|
||||
rotationVelocity: 90
|
||||
@@ -211,7 +211,7 @@ Item {
|
||||
ImageParticle {
|
||||
id: fireworksParticleA
|
||||
system: fireworksSystem
|
||||
source: "qrc:/org/kde/neochat/qml/glowdot.png"
|
||||
source: "qrc:/qt/qml/org/kde/neochat/qml/glowdot.png"
|
||||
alphaVariation: root.isThemeDark ? 0.1 : 0.1
|
||||
alpha: root.isThemeDark ? 0.5 : 1
|
||||
groups: ["a"]
|
||||
@@ -222,7 +222,7 @@ Item {
|
||||
|
||||
ImageParticle {
|
||||
system: fireworksSystem
|
||||
source: "qrc:/org/kde/neochat/qml/glowdot.png"
|
||||
source: "qrc:/qt/qml/org/kde/neochat/qml/glowdot.png"
|
||||
color: root.isThemeDark ? "white" : "gold"
|
||||
alphaVariation: root.isThemeDark ? 0.1 : 0.1
|
||||
alpha: root.isThemeDark ? 0.5 : 1
|
||||
@@ -235,7 +235,7 @@ Item {
|
||||
ImageParticle {
|
||||
id: fireworksParticleB
|
||||
system: fireworksSystem
|
||||
source: "qrc:/org/kde/neochat/qml/glowdot.png"
|
||||
source: "qrc:/qt/qml/org/kde/neochat/qml/glowdot.png"
|
||||
alphaVariation: root.isThemeDark ? 0.1 : 0.1
|
||||
alpha: root.isThemeDark ? 0.5 : 1
|
||||
groups: ["b"]
|
||||
|
||||
@@ -68,7 +68,7 @@ DelegateContextMenu {
|
||||
text: i18n("Remove")
|
||||
icon.name: "edit-delete-remove"
|
||||
icon.color: "red"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RemoveSheet.qml'), {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
|
||||
@@ -28,7 +28,7 @@ Labs.MenuBar {
|
||||
text: i18nc("menu", "Configure NeoChat...")
|
||||
|
||||
shortcut: StandardKey.Preferences
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'SettingsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
@@ -49,7 +49,7 @@ Labs.MenuBar {
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "Find your friends")
|
||||
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
||||
onTriggered: pushReplaceLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
onTriggered: pushReplaceLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
@@ -67,7 +67,7 @@ Labs.MenuBar {
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "Browse Chats…")
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
|
||||
@@ -40,9 +40,9 @@ LoginStep {
|
||||
nextAction: Kirigami.Action {
|
||||
text: Registration.testing ? i18n("Loading") : null
|
||||
enabled: Registration.status > Registration.ServerNoRegistration
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
onTriggered: root.processed("Username.qml")
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml")
|
||||
onTriggered: root.processed("LoginRegister.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@ LoginStep {
|
||||
text: LoginHelper.isLoggedIn ? i18n("Already logged in") : (LoginHelper.testing && matrixIdField.acceptableInput) ? i18n("Loading…") : i18nc("@action:button", "Continue")
|
||||
onTriggered: {
|
||||
if (LoginHelper.supportsSso && LoginHelper.supportsPassword) {
|
||||
processed("qrc:/org/kde/neochat/qml/LoginMethod.qml");
|
||||
processed("LoginMethod.qml");
|
||||
} else if (LoginHelper.supportsSso) {
|
||||
processed("qrc:/org/kde/neochat/qml/Sso.qml");
|
||||
processed("Sso.qml");
|
||||
} else {
|
||||
processed("qrc:/org/kde/neochat/qml/Password.qml");
|
||||
processed("Password.qml");
|
||||
}
|
||||
}
|
||||
enabled: LoginHelper.homeserverReachable
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: {
|
||||
root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml");
|
||||
root.processed("LoginRegister.qml");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ LoginStep {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: loginPasswordButton
|
||||
text: i18nc("@action:button", "Login with password")
|
||||
onClicked: processed("qrc:/org/kde/neochat/qml/Password.qml")
|
||||
onClicked: processed("Password.qml")
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: loginSsoButton
|
||||
text: i18nc("@action:button", "Login with single sign-on")
|
||||
onClicked: processed("qrc:/org/kde/neochat/qml/Sso.qml")
|
||||
onClicked: processed("Sso.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ LoginStep {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: loginButton
|
||||
text: i18nc("@action:button", "Login")
|
||||
onClicked: root.processed("qrc:/org/kde/neochat/qml/Login.qml")
|
||||
onClicked: root.processed("Login.qml")
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("@action:button", "Register")
|
||||
onClicked: root.processed("qrc:/org/kde/neochat/qml/Homeserver.qml")
|
||||
onClicked: root.processed("Homeserver.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ ColumnLayout {
|
||||
property QQC2.Action previousAction: null
|
||||
|
||||
/// Called when switching to the next step.
|
||||
signal processed(url nextUrl)
|
||||
signal processed(string nextComponent)
|
||||
|
||||
/// Show a message in a banner at the top of the page.
|
||||
signal showMessage(string message)
|
||||
|
||||
@@ -48,7 +48,7 @@ DelegateContextMenu {
|
||||
text: i18nc("@action:inmenu As in 'Forward this message'", "Forward")
|
||||
icon.name: "mail-forward-symbolic"
|
||||
onTriggered: {
|
||||
let page = applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ChooseRoomDialog.qml", {
|
||||
let page = applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ChooseRoomDialog.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Forward Message"),
|
||||
|
||||
@@ -15,7 +15,7 @@ LoginStep {
|
||||
Connections {
|
||||
target: LoginHelper
|
||||
function onConnected() {
|
||||
processed("qrc:/org/kde/neochat/qml/Loading.qml");
|
||||
processed("Loading.qml");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,6 @@ LoginStep {
|
||||
}
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: processed("qrc:/org/kde/neochat/qml/Login.qml")
|
||||
onTriggered: processed("Login.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,6 @@ LoginStep {
|
||||
}
|
||||
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
onTriggered: root.processed("Username.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ ColumnLayout {
|
||||
model: root.room.accountDataEventTypes
|
||||
delegate: FormCard.FormButtonDelegate {
|
||||
text: modelData
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/MessageSourceSheet.qml", {
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet.qml'), {
|
||||
"sourceText": root.room.roomAcountDataJson(text)
|
||||
}, {
|
||||
"title": i18n("Event Source"),
|
||||
@@ -89,7 +89,7 @@ ColumnLayout {
|
||||
delegate: FormCard.FormButtonDelegate {
|
||||
text: model.type
|
||||
description: model.stateKey
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/MessageSourceSheet.qml', {
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet.qml'), {
|
||||
sourceText: stateModel.stateEventJson(stateEventFilterModel.mapToSource(stateEventFilterModel.index(model.index, 0)))
|
||||
}, {
|
||||
title: i18n("Event Source"),
|
||||
|
||||
@@ -141,7 +141,7 @@ Delegates.RoundedItemDelegate {
|
||||
}
|
||||
|
||||
function createRoomListContextMenu() {
|
||||
const component = Qt.createComponent("qrc:/org/kde/neochat/qml/ContextMenu.qml");
|
||||
const component = Qt.createComponent(Qt.createComponent('org.kde.neochat', 'ContextMenu.qml'));
|
||||
if (component.status === Component.Error) {
|
||||
console.error(component.errorString());
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ Kirigami.OverlayDrawer {
|
||||
text: i18n("Room settings")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
|
||||
@@ -44,7 +44,7 @@ Kirigami.Page {
|
||||
displayHint: Kirigami.DisplayHint.IconOnly
|
||||
text: i18n("Settings")
|
||||
icon.name: "settings-configure"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
|
||||
@@ -82,7 +82,7 @@ QQC2.ScrollView {
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/DevtoolsPage.qml", {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'DevtoolsPage.qml'), {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
@@ -100,7 +100,7 @@ QQC2.ScrollView {
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RoomSearchPage.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RoomSearchPage.qml'), {
|
||||
room: root.room
|
||||
}, {
|
||||
title: i18nc("@action:title", "Search")
|
||||
@@ -125,7 +125,7 @@ QQC2.ScrollView {
|
||||
icon.name: "map-flat"
|
||||
text: i18n("Show locations for this room")
|
||||
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/LocationsPage.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'LocationsPage.qml'), {
|
||||
room: root.room
|
||||
}, {
|
||||
title: i18nc("Locations on a map", "Locations")
|
||||
@@ -147,7 +147,7 @@ QQC2.ScrollView {
|
||||
icon.name: "list-add-user"
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/InviteUserPage.qml", {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'InviteUserPage.qml'), {
|
||||
room: root.room
|
||||
}, {
|
||||
title: i18nc("@title", "Invite a User")
|
||||
|
||||
@@ -207,7 +207,7 @@ Kirigami.Page {
|
||||
icon.width: Kirigami.Units.gridUnit * 2
|
||||
icon.height: Kirigami.Units.gridUnit * 2
|
||||
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
@@ -236,7 +236,7 @@ Kirigami.Page {
|
||||
icon.name: sortFilterRoomTreeModel.filterText.length > 0 ? "search" : "list-add"
|
||||
text: sortFilterRoomTreeModel.filterText.length > 0 ? i18n("Search in room directory") : i18n("Explore rooms")
|
||||
onTriggered: {
|
||||
let dialog = pageStack.layers.push("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.layers.push(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.connection,
|
||||
keyword: sortFilterRoomTreeModel.filterText
|
||||
}, {
|
||||
@@ -252,7 +252,7 @@ Kirigami.Page {
|
||||
id: userSearchAction
|
||||
icon.name: sortFilterRoomTreeModel.filterText.length > 0 ? "search" : "list-add"
|
||||
text: sortFilterRoomTreeModel.filterText.length > 0 ? i18n("Search in friend directory") : i18n("Find your friends")
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
|
||||
@@ -243,7 +243,7 @@ Kirigami.Page {
|
||||
}
|
||||
|
||||
function onShowEventSource(eventId) {
|
||||
applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/MessageSourceSheet.qml', {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet.qml'), {
|
||||
sourceText: root.currentRoom.getEventJsonSource(eventId)
|
||||
}, {
|
||||
title: i18n("Message Source"),
|
||||
|
||||
@@ -49,7 +49,7 @@ Kirigami.Dialog {
|
||||
visible: !chosenRoomDelegate.visible
|
||||
text: i18nc("@action:button", "Pick room")
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.room.connection,
|
||||
showOnlySpaces: true
|
||||
}, {
|
||||
@@ -133,7 +133,7 @@ Kirigami.Dialog {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage.qml'), {
|
||||
connection: root.room.connection,
|
||||
showOnlySpaces: true
|
||||
}, {
|
||||
|
||||
@@ -60,7 +60,7 @@ Kirigami.Action {
|
||||
if (id != root.eventId) {
|
||||
return;
|
||||
}
|
||||
applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/ShareDialog.qml', {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent("org.kde.neochat", "ShareDialog.qml"), {
|
||||
title: root.text,
|
||||
index: index,
|
||||
model: root._instantiator.model
|
||||
|
||||
@@ -74,7 +74,7 @@ QQC2.Control {
|
||||
source: "notifications"
|
||||
}
|
||||
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/NotificationsView.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'NotificationsView.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Notifications")
|
||||
@@ -308,7 +308,7 @@ QQC2.Control {
|
||||
contentItem: Kirigami.Icon {
|
||||
source: "list-add"
|
||||
}
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog.qml'), {
|
||||
connection: root.connection,
|
||||
isSpace: true,
|
||||
title: i18nc("@title", "Create a Space")
|
||||
|
||||
@@ -46,7 +46,7 @@ Kirigami.Page {
|
||||
visible: root.currentRoom.canSendState("invite")
|
||||
text: i18nc("@button", "Invite user to space")
|
||||
icon.name: "list-add-user"
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/InviteUserPage.qml", {
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'InviteUserPage.qml'), {
|
||||
room: root.currentRoom
|
||||
}, {
|
||||
title: i18nc("@title", "Invite a User")
|
||||
@@ -70,7 +70,7 @@ Kirigami.Page {
|
||||
text: i18nc("@button", "Space settings")
|
||||
icon.name: "settings-configure"
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: root.currentRoom,
|
||||
connection: root.currentRoom.connection
|
||||
}, {
|
||||
@@ -158,7 +158,7 @@ Kirigami.Page {
|
||||
QtObject {
|
||||
id: _private
|
||||
function createRoom(parentId) {
|
||||
let dialog = applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
let dialog = applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog.qml'), {
|
||||
title: i18nc("@title", "Create a Child"),
|
||||
connection: root.currentRoom.connection,
|
||||
parentId: parentId,
|
||||
|
||||
@@ -45,7 +45,7 @@ Loader {
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||
icon.name: 'settings-configure'
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
@@ -130,7 +130,7 @@ Loader {
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||
icon.name: 'settings-configure'
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'Categories.qml'), {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
|
||||
@@ -22,7 +22,7 @@ LoginStep {
|
||||
UrlHelper.openUrl(LoginHelper.ssoUrl);
|
||||
}
|
||||
function onConnected() {
|
||||
processed("qrc:/org/kde/neochat/qml/Loading.qml");
|
||||
processed("Loading.qml");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ LoginStep {
|
||||
}
|
||||
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: processed("qrc:/org/kde/neochat/qml/Login.qml")
|
||||
onTriggered: processed("Login.qml")
|
||||
}
|
||||
|
||||
nextAction: Kirigami.Action {
|
||||
|
||||
@@ -33,6 +33,6 @@ LoginStep {
|
||||
}
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
onTriggered: root.processed("Username.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ Kirigami.Dialog {
|
||||
icon.name: "im-ban-user"
|
||||
icon.color: Kirigami.Theme.negativeTextColor
|
||||
onTriggered: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/BanSheet.qml", {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'BanSheet.qml'), {
|
||||
room: root.room,
|
||||
userId: root.user.id
|
||||
}, {
|
||||
@@ -206,7 +206,7 @@ Kirigami.Dialog {
|
||||
icon.name: "delete"
|
||||
icon.color: Kirigami.Theme.negativeTextColor
|
||||
onTriggered: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {
|
||||
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RemoveSheet.qml'), {
|
||||
room: root.room,
|
||||
userId: root.user.id
|
||||
}, {
|
||||
|
||||
@@ -51,7 +51,7 @@ RowLayout {
|
||||
if (button == Qt.RightButton) {
|
||||
accountMenu.open();
|
||||
} else {
|
||||
pageStack.pushDialogLayer(Qt.resolvedUrl('qrc:/org/kde/neochat/qml/AccountEditorPage.qml'), {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'AccountEditorPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -120,7 +120,7 @@ RowLayout {
|
||||
}
|
||||
QQC2.ToolButton {
|
||||
icon.name: "settings-configure"
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
onClicked: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'SettingsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
@@ -187,7 +187,7 @@ RowLayout {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/WelcomePage.qml", {}, {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'WelcomePage.qml'), {}, {
|
||||
title: i18nc("@title:window", "Login")
|
||||
});
|
||||
if (switchUserButton.checked) {
|
||||
|
||||
@@ -37,11 +37,11 @@ LoginStep {
|
||||
nextAction: Kirigami.Action {
|
||||
text: Registration.status === Registration.TestingUsername ? i18n("Loading") : null
|
||||
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/RegisterPassword.qml")
|
||||
onTriggered: root.processed("RegisterPassword.qml")
|
||||
enabled: Registration.status === Registration.Ready
|
||||
}
|
||||
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Homeserver.qml")
|
||||
onTriggered: root.processed("Homeserver.qml")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,10 @@ FormCard.FormCardPage {
|
||||
id: root
|
||||
|
||||
property bool showExisting: false
|
||||
property bool _showExisting: showExisting && module.source == root.initialStep
|
||||
property bool _showExisting: showExisting && root.currentStepString === root.initialStep
|
||||
property alias currentStep: module.item
|
||||
property string initialStep: "qrc:/org/kde/neochat/qml/LoginRegister.qml"
|
||||
property string currentStepString: initialStep
|
||||
property string initialStep: "LoginRegister.qml"
|
||||
|
||||
signal connectionChosen
|
||||
|
||||
@@ -127,14 +128,15 @@ FormCard.FormCardPage {
|
||||
Loader {
|
||||
id: module
|
||||
Layout.fillWidth: true
|
||||
source: root.initialStep
|
||||
sourceComponent: Qt.createComponent('org.kde.neochat', root.initialStep)
|
||||
|
||||
Connections {
|
||||
id: stepConnections
|
||||
target: currentStep
|
||||
|
||||
function onProcessed(nextUrl: string): void {
|
||||
module.source = nextUrl;
|
||||
function onProcessed(nextStep: string): void {
|
||||
module.source = nextStep;
|
||||
root.currentStepString = nextStep;
|
||||
headerMessage.text = "";
|
||||
headerMessage.visible = false;
|
||||
if (!module.item.noControls) {
|
||||
@@ -164,16 +166,16 @@ FormCard.FormCardPage {
|
||||
target: Registration
|
||||
function onNextStepChanged() {
|
||||
if (Registration.nextStep === "m.login.recaptcha") {
|
||||
stepConnections.onProcessed("qrc:/org/kde/neochat/qml/Captcha.qml");
|
||||
stepConnections.onProcessed("Captcha.qml");
|
||||
}
|
||||
if (Registration.nextStep === "m.login.terms") {
|
||||
stepConnections.onProcessed("qrc:/org/kde/neochat/qml/Terms.qml");
|
||||
stepConnections.onProcessed("Terms.qml");
|
||||
}
|
||||
if (Registration.nextStep === "m.login.email.identity") {
|
||||
stepConnections.onProcessed("qrc:/org/kde/neochat/qml/Email.qml");
|
||||
stepConnections.onProcessed("Email.qml");
|
||||
}
|
||||
if (Registration.nextStep === "loading") {
|
||||
stepConnections.onProcessed("qrc:/org/kde/neochat/qml/Loading.qml");
|
||||
stepConnections.onProcessed("Loading.qml");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ Kirigami.ApplicationWindow {
|
||||
target: RoomManager
|
||||
|
||||
function onPushRoom(room, event) {
|
||||
root.roomPage = pageStack.push("qrc:/org/kde/neochat/qml/RoomPage.qml", {
|
||||
root.roomPage = pageStack.push(Qt.createComponent('org.kde.neochat', 'RoomPage.qml'), {
|
||||
connection: root.connection
|
||||
});
|
||||
root.roomPage.forceActiveFocus();
|
||||
@@ -133,7 +133,7 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
|
||||
function onPushSpaceHome(room) {
|
||||
root.spaceHomePage = pageStack.push("qrc:/org/kde/neochat/qml/SpaceHomePage.qml");
|
||||
root.spaceHomePage = pageStack.push(Qt.createComponent('org.kde.neochat', 'SpaceHomePage.qml'));
|
||||
root.spaceHomePage.forceActiveFocus();
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ Kirigami.ApplicationWindow {
|
||||
pageStack.currentIndex = pageStack.depth - 1;
|
||||
} else {
|
||||
pageStack.pop();
|
||||
root.roomPage = pageStack.push("qrc:/org/kde/neochat/qml/RoomPage.qml", {
|
||||
root.roomPage = pageStack.push(Qt.createComponent('org.kde.neochat', 'RoomPage.qml'), {
|
||||
connection: root.connection
|
||||
});
|
||||
root.spaceHomePage = null;
|
||||
@@ -158,7 +158,7 @@ Kirigami.ApplicationWindow {
|
||||
pageStack.currentIndex = pageStack.depth - 1;
|
||||
} else {
|
||||
pageStack.pop();
|
||||
root.spaceHomePage = pageStack.push("qrc:/org/kde/neochat/qml/SpaceHomePage.qml");
|
||||
root.spaceHomePage = pageStack.push(Qt.createComponent('org.kde.neochat', 'SpaceHomePage.qml'));
|
||||
root.roomPage = null;
|
||||
}
|
||||
root.spaceHomePage.forceActiveFocus();
|
||||
@@ -196,7 +196,7 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
|
||||
function openRoomDrawer() {
|
||||
pageStack.push("qrc:/org/kde/neochat/qml/RoomDrawerPage.qml", {
|
||||
pageStack.push(Qt.createComponent('org.kde.neochat', 'RoomDrawerPage.qml'), {
|
||||
connection: root.connection
|
||||
});
|
||||
}
|
||||
@@ -305,7 +305,7 @@ Kirigami.ApplicationWindow {
|
||||
RoomManager.reset();
|
||||
pageStack.clear();
|
||||
roomListLoaded = false;
|
||||
pageStack.push("qrc:/org/kde/neochat/qml/WelcomePage.qml");
|
||||
pageStack.push(Qt.createComponent('org.kde.neochat', '.qml'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,7 +439,7 @@ Kirigami.ApplicationWindow {
|
||||
Shortcut {
|
||||
sequence: "Ctrl+Shift+,"
|
||||
onActivated: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'SettingsPage.qml'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure"),
|
||||
|
||||
Reference in New Issue
Block a user