Skip to content

Commit

Permalink
Fix pyqtsignal handling on low storage
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Jan 4, 2021
1 parent 0ffc22b commit 56d8aaf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/tribler-gui/tribler_gui/tribler_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,20 @@ def delete_tray_icon(self):
logging.debug("Tray icon already removed, no further deletion necessary.")
self.tray_icon = None

def on_low_storage(self):
def on_low_storage(self, _):
"""
Dealing with low storage space available. First stop the downloads and the core manager and ask user to user to
make free space.
:return:
"""
def close_tribler_gui():
self.close_tribler()
# Since the core has already stopped at this point, it will not terminate the GUI.
# So, we quit the GUI separately here.
if not QApplication.closingDown():
QApplication.quit()

self.downloads_page.stop_loading_downloads()
self.core_manager.shutting_down = True
self.core_manager.stop(False)
close_dialog = ConfirmationDialog(
self.window(),
Expand All @@ -412,7 +418,7 @@ def on_low_storage(self):
"sufficient free space available and restart Tribler again.",
[("Close Tribler", BUTTON_TYPE_NORMAL)],
)
connect(close_dialog.button_clicked, lambda _: self.close_tribler())
connect(close_dialog.button_clicked, lambda _: close_tribler_gui())
close_dialog.show()

def on_torrent_finished(self, torrent_info):
Expand Down

0 comments on commit 56d8aaf

Please sign in to comment.