mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: change show/hide busy functions
The old code was ill named - this way the busy spinner itself becomes reusable with a reasonable set of function names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bf6a644fc6
commit
84920fd657
2 changed files with 10 additions and 2 deletions
|
@ -68,11 +68,19 @@ Kirigami.ApplicationWindow {
|
||||||
|
|
||||||
function showBusy() {
|
function showBusy() {
|
||||||
busy.running = true
|
busy.running = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function showBusyAndDisconnectModel() { // this is used by QMLManager when operating the filter
|
||||||
|
busy.running = true
|
||||||
diveList.diveListModel = null
|
diveList.diveListModel = null
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideBusy() {
|
function hideBusy() {
|
||||||
busy.running = false
|
busy.running = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideBusyAndConnectModel() { // this is used by QMLManager when done filtering
|
||||||
|
busy.running = false
|
||||||
diveList.diveListModel = diveModel
|
diveList.diveListModel = diveModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2077,11 +2077,11 @@ void QMLManager::showDownloadPage(QString deviceString)
|
||||||
void QMLManager::setFilter(const QString filterText)
|
void QMLManager::setFilter(const QString filterText)
|
||||||
{
|
{
|
||||||
// show that we are doing something, then do something in another thread in order not to block the UI
|
// show that we are doing something, then do something in another thread in order not to block the UI
|
||||||
QMetaObject::invokeMethod(qmlWindow, "showBusy");
|
QMetaObject::invokeMethod(qmlWindow, "showBusyAndDisconnectModel");
|
||||||
QtConcurrent::run(QThreadPool::globalInstance(),
|
QtConcurrent::run(QThreadPool::globalInstance(),
|
||||||
[=]{
|
[=]{
|
||||||
DiveListSortModel::instance()->setFilter(filterText);
|
DiveListSortModel::instance()->setFilter(filterText);
|
||||||
QMetaObject::invokeMethod(qmlWindow, "hideBusy");
|
QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue