mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix hang on quit
This commit is contained in:
parent
568321a8ed
commit
8c36830456
4 changed files with 13 additions and 14 deletions
|
@ -4,6 +4,7 @@
|
||||||
of string. This fixes a problem where using lt 0.14.10 wouldn't allow
|
of string. This fixes a problem where using lt 0.14.10 wouldn't allow
|
||||||
Deluge to start.
|
Deluge to start.
|
||||||
* Fix libtorrent 0.15 compatibility
|
* Fix libtorrent 0.15 compatibility
|
||||||
|
* Fix hang on quit
|
||||||
|
|
||||||
=== Deluge 1.2.2 (19 March 2010) ===
|
=== Deluge 1.2.2 (19 March 2010) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -152,11 +152,16 @@ class MainWindow(component.Component):
|
||||||
"""Returns a reference to the main window glade object."""
|
"""Returns a reference to the main window glade object."""
|
||||||
return self.main_glade
|
return self.main_glade
|
||||||
|
|
||||||
def quit(self):
|
def quit(self, shutdown=False):
|
||||||
if client.is_classicmode():
|
"""
|
||||||
gtk.main_quit()
|
Quits the GtkUI
|
||||||
else:
|
|
||||||
reactor.stop()
|
:param shutdown: whether or not to shutdown the daemon as well
|
||||||
|
:type shutdown: boolean
|
||||||
|
"""
|
||||||
|
if shutdown:
|
||||||
|
client.daemon.shutdown()
|
||||||
|
reactor.stop()
|
||||||
|
|
||||||
def load_window_state(self):
|
def load_window_state(self):
|
||||||
x = self.config["window_x_pos"]
|
x = self.config["window_x_pos"]
|
||||||
|
|
|
@ -253,10 +253,7 @@ class MenuBar(component.Component):
|
||||||
|
|
||||||
def on_menuitem_quitdaemon_activate(self, data=None):
|
def on_menuitem_quitdaemon_activate(self, data=None):
|
||||||
log.debug("on_menuitem_quitdaemon_activate")
|
log.debug("on_menuitem_quitdaemon_activate")
|
||||||
# Tell the core to shutdown
|
self.window.quit(shutdown=True)
|
||||||
def on_shutdown(result):
|
|
||||||
self.window.quit()
|
|
||||||
client.daemon.shutdown().addCallback(on_shutdown)
|
|
||||||
|
|
||||||
def on_menuitem_quit_activate(self, data=None):
|
def on_menuitem_quit_activate(self, data=None):
|
||||||
log.debug("on_menuitem_quit_activate")
|
log.debug("on_menuitem_quit_activate")
|
||||||
|
|
|
@ -324,9 +324,6 @@ class SystemTray(component.Component):
|
||||||
if self.config["lock_tray"] and not self.window.visible():
|
if self.config["lock_tray"] and not self.window.visible():
|
||||||
self.unlock_tray()
|
self.unlock_tray()
|
||||||
|
|
||||||
if self.config["classic_mode"]:
|
|
||||||
client.daemon.shutdown()
|
|
||||||
|
|
||||||
self.window.quit()
|
self.window.quit()
|
||||||
|
|
||||||
def on_menuitem_quitdaemon_activate(self, menuitem):
|
def on_menuitem_quitdaemon_activate(self, menuitem):
|
||||||
|
@ -334,8 +331,7 @@ class SystemTray(component.Component):
|
||||||
if self.config["lock_tray"] and not self.window.visible():
|
if self.config["lock_tray"] and not self.window.visible():
|
||||||
self.unlock_tray()
|
self.unlock_tray()
|
||||||
|
|
||||||
client.daemon.shutdown()
|
self.window.quit(shutdown=True)
|
||||||
self.window.quit()
|
|
||||||
|
|
||||||
def tray_setbwdown(self, widget, data=None):
|
def tray_setbwdown(self, widget, data=None):
|
||||||
self.setbwlimit(widget, _("Set Maximum Download Speed"), "max_download_speed",
|
self.setbwlimit(widget, _("Set Maximum Download Speed"), "max_download_speed",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue