summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Garland <johnnybg+deluge@gmail.com>2010-10-23 00:46:50 +1100
committerJohn Garland <johnnybg+deluge@gmail.com>2010-10-23 01:14:48 +1100
commit02ad0b93ab313f7f50c3f7b42ee68418308fab92 (patch)
treec2b8f90f7edb77382c21dc8ca3cac3fb12c6494b
parent6d2a001635e384fedef3f5ebd9a1f3ad4cb1b7bb (diff)
downloaddeluge-02ad0b93ab313f7f50c3f7b42ee68418308fab92.tar.gz
deluge-02ad0b93ab313f7f50c3f7b42ee68418308fab92.tar.bz2
deluge-02ad0b93ab313f7f50c3f7b42ee68418308fab92.zip
Fix hang on quit
-rw-r--r--ChangeLog1
-rw-r--r--deluge/ui/gtkui/mainwindow.py15
-rw-r--r--deluge/ui/gtkui/menubar.py5
-rw-r--r--deluge/ui/gtkui/systemtray.py6
4 files changed, 13 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d7fda9de..13f476f87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
=== Deluge 1.3.1 (In Development) ===
==== Core ====
* #1369: Fix non-ascii config folders not working in windows
+ * Fix hang on quit
==== GtkUI ====
* #1365: Fix sidebar not updating show/hide trackers
diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py
index 47887c155..344359f5b 100644
--- a/deluge/ui/gtkui/mainwindow.py
+++ b/deluge/ui/gtkui/mainwindow.py
@@ -152,11 +152,16 @@ class MainWindow(component.Component):
"""Returns a reference to the main window glade object."""
return self.main_glade
- def quit(self):
- if client.is_classicmode():
- gtk.main_quit()
- else:
- reactor.stop()
+ def quit(self, shutdown=False):
+ """
+ Quits the GtkUI
+
+ :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):
x = self.config["window_x_pos"]
diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py
index 7f16b1132..1a9026965 100644
--- a/deluge/ui/gtkui/menubar.py
+++ b/deluge/ui/gtkui/menubar.py
@@ -253,10 +253,7 @@ class MenuBar(component.Component):
def on_menuitem_quitdaemon_activate(self, data=None):
log.debug("on_menuitem_quitdaemon_activate")
- # Tell the core to shutdown
- def on_shutdown(result):
- self.window.quit()
- client.daemon.shutdown().addCallback(on_shutdown)
+ self.window.quit(shutdown=True)
def on_menuitem_quit_activate(self, data=None):
log.debug("on_menuitem_quit_activate")
diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py
index 2ed896782..807852399 100644
--- a/deluge/ui/gtkui/systemtray.py
+++ b/deluge/ui/gtkui/systemtray.py
@@ -323,9 +323,6 @@ class SystemTray(component.Component):
if self.config["lock_tray"] and not self.window.visible():
self.unlock_tray()
- if self.config["classic_mode"]:
- client.daemon.shutdown()
-
self.window.quit()
def on_menuitem_quitdaemon_activate(self, menuitem):
@@ -333,8 +330,7 @@ class SystemTray(component.Component):
if self.config["lock_tray"] and not self.window.visible():
self.unlock_tray()
- client.daemon.shutdown()
- self.window.quit()
+ self.window.quit(shutdown=True)
def tray_setbwdown(self, widget, data=None):
self.setbwlimit(widget, _("Set Maximum Download Speed"), "max_download_speed",