mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix #636 not setting the daemon's config directory when using --config=
with the UI in classic mode.
This commit is contained in:
parent
8fac7ed86e
commit
52e1c0d8cd
1 changed files with 12 additions and 8 deletions
|
@ -39,8 +39,12 @@ from deluge.ui.client import aclient as client
|
||||||
from deluge.configmanager import ConfigManager
|
from deluge.configmanager import ConfigManager
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
|
DEFAULT_URI = "http://127.0.0.1:58846"
|
||||||
|
DEFAULT_HOST = DEFAULT_URI.split(":")[1][2:]
|
||||||
|
DEFAULT_PORT = DEFAULT_URI.split(":")[-1]
|
||||||
|
|
||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
"hosts": ["localhost:58846"]
|
"hosts": [DEFAULT_HOST + ":" + DEFAULT_PORT]
|
||||||
}
|
}
|
||||||
|
|
||||||
HOSTLIST_COL_PIXBUF = 0
|
HOSTLIST_COL_PIXBUF = 0
|
||||||
|
@ -118,12 +122,11 @@ class ConnectionManager(component.Component):
|
||||||
|
|
||||||
# If classic mode is set, we just start up a localhost daemon and connect to it
|
# If classic mode is set, we just start up a localhost daemon and connect to it
|
||||||
if self.gtkui_config["classic_mode"]:
|
if self.gtkui_config["classic_mode"]:
|
||||||
uri = "http://localhost:58846"
|
self.start_localhost(DEFAULT_PORT)
|
||||||
self.start_localhost(58846)
|
|
||||||
# We need to wait for the host to start before connecting
|
# We need to wait for the host to start before connecting
|
||||||
while not self.test_online_status(uri):
|
while not self.test_online_status(DEFAULT_URI):
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
client.set_core_uri(uri)
|
client.set_core_uri(DEFAULT_URI)
|
||||||
self.hide()
|
self.hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -393,9 +396,9 @@ class ConnectionManager(component.Component):
|
||||||
log.debug("on_button_startdaemon_clicked")
|
log.debug("on_button_startdaemon_clicked")
|
||||||
if self.liststore.iter_n_children(None) < 1:
|
if self.liststore.iter_n_children(None) < 1:
|
||||||
# There is nothing in the list, so lets create a localhost entry
|
# There is nothing in the list, so lets create a localhost entry
|
||||||
self.add_host("localhost", 58846)
|
self.add_host(DEFAULT_HOST, DEFAULT_PORT)
|
||||||
# ..and start the daemon.
|
# ..and start the daemon.
|
||||||
self.start_localhost(58846)
|
self.start_localhost(DEFAULT_PORT)
|
||||||
return
|
return
|
||||||
|
|
||||||
paths = self.hostlist.get_selection().get_selected_rows()[1]
|
paths = self.hostlist.get_selection().get_selected_rows()[1]
|
||||||
|
@ -425,7 +428,8 @@ class ConnectionManager(component.Component):
|
||||||
if deluge.common.windows_check():
|
if deluge.common.windows_check():
|
||||||
win32api.WinExec("deluged -p %s" % port)
|
win32api.WinExec("deluged -p %s" % port)
|
||||||
else:
|
else:
|
||||||
subprocess.call(["deluged", "-p %s" % port])
|
subprocess.call(["deluged", "--port=%s" % port,
|
||||||
|
"--config=%s" % self.gtkui_config["config_location"]])
|
||||||
|
|
||||||
def on_button_close_clicked(self, widget):
|
def on_button_close_clicked(self, widget):
|
||||||
log.debug("on_button_close_clicked")
|
log.debug("on_button_close_clicked")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue