Always use resolveResource instead of enterRoom or EnterSpaceHome
This commit is contained in:
@@ -42,10 +42,10 @@ QQC2.ItemDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: RoomManager.enterRoom(root.currentRoom)
|
||||
onClicked: RoomManager.resolveResource(currentRoom.id)
|
||||
|
||||
Keys.onEnterPressed: RoomManager.enterRoom(root.currentRoom)
|
||||
Keys.onReturnPressed: RoomManager.enterRoom(root.currentRoom)
|
||||
Keys.onEnterPressed: RoomManager.resolveResource(currentRoom.id)
|
||||
Keys.onReturnPressed: RoomManager.resolveResource(currentRoom.id)
|
||||
|
||||
QQC2.ToolTip.visible: text.length > 0 && hovered
|
||||
QQC2.ToolTip.text: root.displayName ?? ""
|
||||
|
||||
@@ -23,11 +23,7 @@ RowLayout {
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, "join")
|
||||
}
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,11 +54,7 @@ ColumnLayout {
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId));
|
||||
} else {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, "join");
|
||||
}
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
exploreTabBar.currentIndex = -1;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ FormCard.FormCardPage {
|
||||
actions: Kirigami.Action {
|
||||
text: i18n("See older messages…")
|
||||
onTriggered: {
|
||||
RoomManager.enterRoom(root.connection.room(room.predecessorId));
|
||||
RoomManager.resolveResource(room.predecessorId);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
@@ -387,7 +387,7 @@ FormCard.FormCardPage {
|
||||
actions: Kirigami.Action {
|
||||
text: i18n("See new room…")
|
||||
onTriggered: {
|
||||
RoomManager.enterRoom(root.connection.room(room.successorId));
|
||||
RoomManager.resolveResource(room.successorId);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +63,7 @@ Labs.MenuBar {
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.resolveResource(roomId, "join")
|
||||
}
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ QQC2.Dialog {
|
||||
}
|
||||
}
|
||||
Keys.onEnterPressed: {
|
||||
RoomManager.enterRoom(roomList.currentItem.currentRoom);
|
||||
RoomManager.resolveResource(roomList.currentItem.currentRoom.id);
|
||||
root.close();
|
||||
}
|
||||
Keys.onReturnPressed: {
|
||||
RoomManager.enterRoom(roomList.currentItem.currentRoom);
|
||||
RoomManager.resolveResource(roomList.currentItem.currentRoom.id);
|
||||
root.close();
|
||||
}
|
||||
focusSequence: ""
|
||||
@@ -92,23 +92,8 @@ QQC2.Dialog {
|
||||
|
||||
delegate: RoomDelegate {
|
||||
filterText: searchField.text
|
||||
|
||||
connection: root.connection
|
||||
|
||||
onSelected: {
|
||||
RoomManager.enterRoom(currentRoom);
|
||||
root.close()
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: {
|
||||
RoomManager.enterRoom(currentRoom);
|
||||
root.close();
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
RoomManager.enterRoom(currentRoom);
|
||||
root.close();
|
||||
}
|
||||
onSelected: root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,19 +34,21 @@ Delegates.RoundedItemDelegate {
|
||||
signal selected()
|
||||
|
||||
Accessible.name: root.displayName
|
||||
Accessible.onPressAction: selected()
|
||||
Keys.onSpacePressed: selected()
|
||||
Keys.onEnterPressed: selected()
|
||||
Accessible.onPressAction: select()
|
||||
|
||||
onPressAndHold: createRoomListContextMenu()
|
||||
|
||||
Keys.onSpacePressed: select()
|
||||
Keys.onEnterPressed: select()
|
||||
Keys.onReturnPressed: select()
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||
onTapped: (eventPoint, button) => {
|
||||
if (button === Qt.RightButton) {
|
||||
root.createRoomListContextMenu();
|
||||
} else {
|
||||
root.selected();
|
||||
select()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,6 +147,11 @@ Delegates.RoundedItemDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
function select() {
|
||||
RoomManager.resolveResource(currentRoom.id);
|
||||
root.selected()
|
||||
}
|
||||
|
||||
function createRoomListContextMenu() {
|
||||
const component = Qt.createComponent("qrc:/org/kde/neochat/qml/ContextMenu.qml")
|
||||
if (component.status === Component.Error) {
|
||||
|
||||
@@ -179,11 +179,7 @@ Kirigami.Page {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
})
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.resolveResource(roomId, "join")
|
||||
}
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -294,11 +290,6 @@ Kirigami.Page {
|
||||
height: visible ? implicitHeight : 0
|
||||
|
||||
visible: categoryVisible || filterText.length > 0
|
||||
|
||||
onSelected: RoomManager.enterRoom(currentRoom)
|
||||
|
||||
Keys.onEnterPressed: RoomManager.enterRoom(currentRoom)
|
||||
Keys.onReturnPressed: RoomManager.enterRoom(currentRoom)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ Kirigami.Page {
|
||||
target: root.connection
|
||||
function onJoinedRoom(room, invited) {
|
||||
if(root.currentRoom.id === invited.id) {
|
||||
RoomManager.enterRoom(room);
|
||||
RoomManager.resolveResource(room.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ Item {
|
||||
required property NeoChatRoom parentRoom
|
||||
|
||||
signal createRoom()
|
||||
signal enterRoom()
|
||||
|
||||
Delegates.RoundedItemDelegate {
|
||||
anchors.centerIn: root
|
||||
@@ -146,11 +145,7 @@ Item {
|
||||
if (root.isSpace) {
|
||||
root.treeView.toggleExpanded(row)
|
||||
} else {
|
||||
if (root.isJoined) {
|
||||
root.enterRoom()
|
||||
} else {
|
||||
RoomManager.resolveResource(root.roomId, "join")
|
||||
}
|
||||
RoomManager.resolveResource(root.roomId, root.isJoined ? "" : "join")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,6 @@ Kirigami.Page {
|
||||
|
||||
delegate: SpaceHierarchyDelegate {
|
||||
onCreateRoom: _private.createRoom(roomId)
|
||||
onEnterRoom: _private.enterRoom(roomId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,12 +166,5 @@ Kirigami.Page {
|
||||
})
|
||||
dialog.newChild.connect(childName => {spaceChildrenModel.addPendingChild(childName)})
|
||||
}
|
||||
|
||||
function enterRoom(roomId) {
|
||||
let room = root.currentRoom.connection.room(roomId)
|
||||
if (room) {
|
||||
RoomManager.enterRoom(room)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ Loader {
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("'Space' is a matrix space", "View Space")
|
||||
icon.name: "view-list-details"
|
||||
onTriggered: RoomManager.enterSpaceHome(room);
|
||||
onTriggered: RoomManager.resolveResource(room.id);
|
||||
}
|
||||
|
||||
QQC2.MenuItem {
|
||||
@@ -109,7 +109,7 @@ Loader {
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("'Space' is a matrix space", "View Space")
|
||||
icon.name: "view-list-details"
|
||||
onClicked: RoomManager.enterRoom(room);
|
||||
onClicked: RoomManager.resolveResource(root.room.id);
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
|
||||
@@ -326,7 +326,7 @@ Kirigami.ApplicationWindow {
|
||||
target: root.connection
|
||||
|
||||
function onDirectChatAvailable(directChat) {
|
||||
RoomManager.enterRoom(root.connection.room(directChat.id));
|
||||
RoomManager.resolveResource(directChat.id);
|
||||
}
|
||||
function onNewKeyVerificationSession(session) {
|
||||
applicationWindow().pageStack.pushDialogLayer(keyVerificationDialogComponent, {
|
||||
|
||||
Reference in New Issue
Block a user