diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2013-02-13 01:29:07 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2013-02-13 01:30:48 +0000 |
commit | 7ef7cc41b6f001220e83bcb34454e8804d2b1101 (patch) | |
tree | 8a6429c201a33f72899a0f4447973caf8feb7728 | |
parent | 7c6d1f30fff607549c0126093a693c7de99a5cd7 (diff) | |
download | deluge-7ef7cc41b6f001220e83bcb34454e8804d2b1101.tar.gz deluge-7ef7cc41b6f001220e83bcb34454e8804d2b1101.tar.bz2 deluge-7ef7cc41b6f001220e83bcb34454e8804d2b1101.zip |
GTK: Fix showing exception error to user with no libtorrent installed
-rw-r--r-- | deluge/ui/gtkui/gtkui.py | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index ba859d6b6..894e81903 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -304,17 +304,29 @@ class GtkUI(object): # Turning off classic_mode self.config["classic_mode"] = False self.__start_non_classic() - try: - client.start_classic_mode() - except deluge.error.DaemonRunningError: - d = dialogs.YesNoDialog( - _("Turn off Classic Mode?"), - _("It appears that a Deluge daemon process (deluged) is already running.\n\n\ + try: + client.start_classic_mode() + except deluge.error.DaemonRunningError: + d = dialogs.YesNoDialog( + _("Turn off Classic Mode?"), + _("It appears that a Deluge daemon process (deluged) is already running.\n\n\ You will either need to stop the daemon or turn off Classic Mode to continue.")).run() - - self.started_in_classic = False - d.addCallback(on_dialog_response) + self.started_in_classic = False + d.addCallback(on_dialog_response) + except ImportError, e: + if "No module named libtorrent" in e.message: + d = dialogs.YesNoDialog( + _("Enable Thin Client Mode?"), + _("Thin client mode is only available because libtorrent is not installed.\n\n\ +To use Deluge standalone (Classic mode) please install libtorrent.")).run() + self.started_in_classic = False + d.addCallback(on_dialog_response) + else: + raise + else: + component.start() + return except Exception, e: import traceback tb = sys.exc_info() @@ -329,10 +341,6 @@ Please see the details below for more information."), details=traceback.format_e self.started_in_classic = False d.addCallback(on_dialog_response) ed.addCallback(on_ed_response) - else: - component.start() - return - else: self.__start_non_classic() |