summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2025-06-29 21:50:12 +0200
committerRobert Honz <exislow+github@gmail.com>2025-06-29 21:50:12 +0200
commit5bdd48e471cb6c84406abcba204813d8dac35c1e (patch)
tree738086bf24e2f7b78974f70f7393cbd4c2b83368
parentdb5c5eac9706eb5ab8d11c05f4346d64653ba83c (diff)
downloadtidal-dl-ng-5bdd48e471cb6c84406abcba204813d8dac35c1e.tar.gz
✨ Spinner will be shown, if search results are expanded.
-rw-r--r--tidal_dl_ng/gui.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py
index 8f165d2..e59101d 100644
--- a/tidal_dl_ng/gui.py
+++ b/tidal_dl_ng/gui.py
@@ -1170,6 +1170,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
DialogPreferences(settings=self.settings, settings_save=self.s_settings_save, parent=self)
def on_tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
+ self.thread_it(self.tr_results_expanded, index)
+
+ def tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
# If the child is a dummy the list_item has not been expanded before
item: QtGui.QStandardItem = self.model_tr_results.itemFromIndex(self.proxy_tr_results.mapToSource(index))
load_children: bool = not item.child(0, 0).isEnabled()
@@ -1180,7 +1183,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
index, self.proxy_tr_results, self.model_tr_results
)
- self.list_items_show_result(media_list=media_list, parent=item)
+ # Show spinner while loading children
+ self.s_spinner_start.emit(self.tr_results)
+ try:
+ self.list_items_show_result(media_list=media_list, parent=item)
+ finally:
+ self.s_spinner_stop.emit()
def button_reload_status(self, status: bool):
button_text: str = "Reloading..."