Fix bugs in multi account setups
This commit is contained in:
@@ -18,7 +18,6 @@ Kirigami.ScrollablePage {
|
|||||||
id: page
|
id: page
|
||||||
|
|
||||||
property var enteredRoom
|
property var enteredRoom
|
||||||
required property var activeConnection
|
|
||||||
|
|
||||||
function goToNextRoom() {
|
function goToNextRoom() {
|
||||||
do {
|
do {
|
||||||
@@ -58,7 +57,10 @@ Kirigami.ScrollablePage {
|
|||||||
helpfulAction: Kirigami.Action {
|
helpfulAction: Kirigami.Action {
|
||||||
icon.name: sortFilterRoomListModel.filterText.length > 0 ? "search" : "list-add"
|
icon.name: sortFilterRoomListModel.filterText.length > 0 ? "search" : "list-add"
|
||||||
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("Search in room directory") : i18n("Explore rooms")
|
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("Search in room directory") : i18n("Explore rooms")
|
||||||
onTriggered: pageStack.layers.push("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": activeConnection, "keyword": sortFilterRoomListModel.filterText})
|
onTriggered: pageStack.layers.push("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {
|
||||||
|
connection: Controller.activeConnection,
|
||||||
|
keyword: sortFilterRoomListModel.filterText
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +76,7 @@ Kirigami.ScrollablePage {
|
|||||||
id: sortFilterRoomListModel
|
id: sortFilterRoomListModel
|
||||||
sourceModel: RoomListModel {
|
sourceModel: RoomListModel {
|
||||||
id: roomListModel
|
id: roomListModel
|
||||||
connection: page.activeConnection
|
connection: Controller.activeConnection
|
||||||
}
|
}
|
||||||
roomSortOrder: Config.mergeRoomList ? SortFilterRoomListModel.LastActivity : SortFilterRoomListModel.Categories
|
roomSortOrder: Config.mergeRoomList ? SortFilterRoomListModel.LastActivity : SortFilterRoomListModel.Categories
|
||||||
onLayoutChanged: {
|
onLayoutChanged: {
|
||||||
@@ -184,18 +186,28 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: RowLayout {
|
footer: QQC2.ToolBar {
|
||||||
visible: accountListTab.count > 1
|
visible: accountList.count > 1
|
||||||
height: visible ? accountListTab.implicitHeight : 0
|
height: visible ? implicitHeight : 0
|
||||||
Repeater {
|
leftPadding: 0
|
||||||
id: accountListTab
|
rightPadding: 0
|
||||||
model: AccountListModel { }
|
topPadding: 0
|
||||||
delegate: QQC2.TabButton {
|
bottomPadding: 0
|
||||||
checkable: true
|
contentItem: RowLayout {
|
||||||
checked: Controller.activeConnection.user.id === model.connection.user.id
|
spacing: 0
|
||||||
onClicked: Controller.activeConnection = model.connection
|
Repeater {
|
||||||
Layout.fillWidth: true
|
id: accountList
|
||||||
text: model.user.id
|
model: AccountListModel {
|
||||||
|
id: accountListModel
|
||||||
|
}
|
||||||
|
delegate: Kirigami.BasicListItem {
|
||||||
|
checkable: true
|
||||||
|
checked: Controller.activeConnection.localUser.id === model.user.id
|
||||||
|
onClicked: Controller.activeConnection = model.connection
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: model.user.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,7 +234,6 @@ Kirigami.ApplicationWindow {
|
|||||||
id: roomListComponent
|
id: roomListComponent
|
||||||
RoomListPage {
|
RoomListPage {
|
||||||
id: roomList
|
id: roomList
|
||||||
activeConnection: Controller.activeConnection
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
|
|||||||
Reference in New Issue
Block a user