From 5bdd48e471cb6c84406abcba204813d8dac35c1e Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sun, 29 Jun 2025 21:50:12 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Spinner=20will=20be=20shown,=20if?= =?UTF-8?q?=20search=20results=20are=20expanded.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/gui.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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..."