Skip to content

Commit 5bdd48e

Browse files
committed
✨ Spinner will be shown, if search results are expanded.
1 parent db5c5ea commit 5bdd48e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tidal_dl_ng/gui.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,9 @@ def on_preferences(self) -> None:
11701170
DialogPreferences(settings=self.settings, settings_save=self.s_settings_save, parent=self)
11711171

11721172
def on_tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
1173+
self.thread_it(self.tr_results_expanded, index)
1174+
1175+
def tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
11731176
# If the child is a dummy the list_item has not been expanded before
11741177
item: QtGui.QStandardItem = self.model_tr_results.itemFromIndex(self.proxy_tr_results.mapToSource(index))
11751178
load_children: bool = not item.child(0, 0).isEnabled()
@@ -1180,7 +1183,12 @@ def on_tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
11801183
index, self.proxy_tr_results, self.model_tr_results
11811184
)
11821185

1183-
self.list_items_show_result(media_list=media_list, parent=item)
1186+
# Show spinner while loading children
1187+
self.s_spinner_start.emit(self.tr_results)
1188+
try:
1189+
self.list_items_show_result(media_list=media_list, parent=item)
1190+
finally:
1191+
self.s_spinner_stop.emit()
11841192

11851193
def button_reload_status(self, status: bool):
11861194
button_text: str = "Reloading..."

0 commit comments

Comments
 (0)