Add action to search in room directory when search is empty in roomlist
This commit is contained in:
@@ -20,7 +20,7 @@ Kirigami.ScrollablePage {
|
|||||||
id: root
|
id: root
|
||||||
property var connection
|
property var connection
|
||||||
|
|
||||||
property string keyword
|
property alias keyword: identifierField.text
|
||||||
property string server
|
property string server
|
||||||
|
|
||||||
signal joinRoom(string room)
|
signal joinRoom(string room)
|
||||||
@@ -40,10 +40,6 @@ Kirigami.ScrollablePage {
|
|||||||
id: identifierField
|
id: identifierField
|
||||||
|
|
||||||
placeholderText: i18n("Find a room...")
|
placeholderText: i18n("Find a room...")
|
||||||
|
|
||||||
onEditingFinished: {
|
|
||||||
keyword = text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ Kirigami.ScrollablePage {
|
|||||||
visible: listView.count == 0
|
visible: listView.count == 0
|
||||||
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("No room found.") : i18n("You didn't join any room yet.")
|
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("No room found.") : i18n("You didn't join any room yet.")
|
||||||
helpfulAction: Kirigami.Action {
|
helpfulAction: Kirigami.Action {
|
||||||
icon.name: "list-add"
|
icon.name: sortFilterRoomListModel.filterText.length > 0 ? "search" : "list-add"
|
||||||
text: 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})
|
onTriggered: pageStack.layers.push("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": activeConnection, "keyword": sortFilterRoomListModel.filterText})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model: SortFilterRoomListModel {
|
model: SortFilterRoomListModel {
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ if(ANDROID)
|
|||||||
"configure"
|
"configure"
|
||||||
"rating"
|
"rating"
|
||||||
"rating-unrated"
|
"rating-unrated"
|
||||||
|
"search"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(neochat PRIVATE Qt5::Widgets ${QTKEYCHAIN_LIBRARIES})
|
target_link_libraries(neochat PRIVATE Qt5::Widgets ${QTKEYCHAIN_LIBRARIES})
|
||||||
|
|||||||
@@ -111,9 +111,6 @@ void PublicRoomListModel::next(int count)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasMore())
|
|
||||||
return;
|
|
||||||
|
|
||||||
job = m_connection->callApi<QueryPublicRoomsJob>(m_server, count, nextBatch, QueryPublicRoomsJob::Filter {m_keyword});
|
job = m_connection->callApi<QueryPublicRoomsJob>(m_server, count, nextBatch, QueryPublicRoomsJob::Filter {m_keyword});
|
||||||
|
|
||||||
connect(job, &BaseJob::finished, this, [=] {
|
connect(job, &BaseJob::finished, this, [=] {
|
||||||
|
|||||||
Reference in New Issue
Block a user