mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 01:48:40 +00:00
Show an Error dialog if starting the core in classic mode is unsuccessful
This commit is contained in:
parent
d0fb657ada
commit
f42e8c4316
1 changed files with 25 additions and 9 deletions
|
@ -45,6 +45,7 @@ import gettext
|
||||||
import locale
|
import locale
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import gtk, gtk.glade
|
import gtk, gtk.glade
|
||||||
|
import sys
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
|
@ -229,15 +230,7 @@ class GtkUI:
|
||||||
self.mainwindow.first_show()
|
self.mainwindow.first_show()
|
||||||
|
|
||||||
if self.config["classic_mode"]:
|
if self.config["classic_mode"]:
|
||||||
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
|
|
||||||
def on_dialog_response(response):
|
def on_dialog_response(response):
|
||||||
if response != gtk.RESPONSE_YES:
|
if response != gtk.RESPONSE_YES:
|
||||||
# The user does not want to turn Classic Mode off, so just quit
|
# The user does not want to turn Classic Mode off, so just quit
|
||||||
|
@ -247,7 +240,30 @@ You will either need to stop the daemon or turn off Classic Mode to continue."))
|
||||||
self.config["classic_mode"] = False
|
self.config["classic_mode"] = False
|
||||||
self.__start_non_classic()
|
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\
|
||||||
|
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)
|
d.addCallback(on_dialog_response)
|
||||||
|
except Exception, e:
|
||||||
|
import traceback
|
||||||
|
tb = sys.exc_info()
|
||||||
|
ed = dialogs.ErrorDialog(
|
||||||
|
_("Error Starting Core"),
|
||||||
|
_("There was an error starting the core component which is required to run Deluge in Classic Mode.\n\n\
|
||||||
|
Please see the details below for more information."), details=traceback.format_exc(tb[2])).run()
|
||||||
|
def on_ed_response(response):
|
||||||
|
d = dialogs.YesNoDialog(
|
||||||
|
_("Turn off Classic Mode?"),
|
||||||
|
_("Since there was an error starting in Classic Mode would you like to continue by turning it off?")).run()
|
||||||
|
self.started_in_classic = False
|
||||||
|
d.addCallback(on_dialog_response)
|
||||||
|
ed.addCallback(on_ed_response)
|
||||||
else:
|
else:
|
||||||
component.start()
|
component.start()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue