Do not use the stored config_location value because it should only be used if the --config option is

set.
This commit is contained in:
Andrew Resch 2008-12-27 21:24:50 +00:00
parent e1c5f69d54
commit 6359c5d4af
7 changed files with 16 additions and 11 deletions

View File

@ -40,6 +40,7 @@ import deluge.ui.gtkui.common as common
from deluge.ui.common import get_localhost_auth_uri from deluge.ui.common import get_localhost_auth_uri
from deluge.ui.client import aclient as client from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
from deluge.log import LOG as log from deluge.log import LOG as log
DEFAULT_URI = "http://127.0.0.1:58846" DEFAULT_URI = "http://127.0.0.1:58846"
@ -480,7 +481,7 @@ class ConnectionManager(component.Component):
win32api.WinExec("deluged -p %s" % port) win32api.WinExec("deluged -p %s" % port)
else: else:
subprocess.call(["deluged", "--port=%s" % port, subprocess.call(["deluged", "--port=%s" % port,
"--config=%s" % self.gtkui_config["config_location"]]) "--config=%s" % deluge.configmanager.get_config_dir()])
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")

View File

@ -32,6 +32,7 @@ import cPickle
from deluge.ui.gtkui.torrentdetails import Tab from deluge.ui.gtkui.torrentdetails import Tab
from deluge.ui.client import aclient as client from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
@ -221,7 +222,7 @@ class FilesTab(Tab):
} }
# Get the config location for saving the state file # Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
try: try:
log.debug("Saving FilesTab state file: %s", filename) log.debug("Saving FilesTab state file: %s", filename)
@ -234,7 +235,7 @@ class FilesTab(Tab):
def load_state(self): def load_state(self):
filename = "files_tab.state" filename = "files_tab.state"
# Get the config location for loading the state file # Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
state = None state = None
try: try:

View File

@ -60,7 +60,6 @@ import deluge.configmanager
import deluge.common import deluge.common
DEFAULT_PREFS = { DEFAULT_PREFS = {
"config_location": deluge.configmanager.get_config_dir(),
"classic_mode": True, "classic_mode": True,
"interactive_add": True, "interactive_add": True,
"focus_add_dialog": True, "focus_add_dialog": True,

View File

@ -33,6 +33,7 @@ import gtk
import gettext import gettext
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.common import deluge.common
from deluge.log import LOG as log from deluge.log import LOG as log
@ -204,7 +205,7 @@ class ListView:
counter += 1 counter += 1
# Get the config location for saving the state file # Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
try: try:
log.debug("Saving ListView state file: %s", filename) log.debug("Saving ListView state file: %s", filename)
@ -217,7 +218,7 @@ class ListView:
def load_state(self, filename): def load_state(self, filename):
"""Load the listview state from filename.""" """Load the listview state from filename."""
# Get the config location for loading the state file # Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
state = None state = None
try: try:

View File

@ -32,6 +32,7 @@ from itertools import izip
from deluge.ui.client import aclient as client from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
import deluge.ui.gtkui.common as common import deluge.ui.gtkui.common as common
@ -175,7 +176,7 @@ class PeersTab(Tab):
} }
# Get the config location for saving the state file # Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
try: try:
log.debug("Saving FilesTab state file: %s", filename) log.debug("Saving FilesTab state file: %s", filename)
@ -188,7 +189,7 @@ class PeersTab(Tab):
def load_state(self): def load_state(self):
filename = "peers_tab.state" filename = "peers_tab.state"
# Get the config location for loading the state file # Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
state = None state = None
try: try:

View File

@ -35,6 +35,7 @@ import deluge.common
import deluge.error import deluge.error
import deluge.ui.gtkui.common as common import deluge.ui.gtkui.common as common
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
class Preferences(component.Component): class Preferences(component.Component):
def __init__(self): def __init__(self):
@ -855,7 +856,7 @@ class Preferences(component.Component):
filename = os.path.split(filepath)[1] filename = os.path.split(filepath)[1]
shutil.copyfile( shutil.copyfile(
filepath, filepath,
os.path.join(self.gtkui_config["config_location"], "plugins", filename)) os.path.join(deluge.configmanager.get_config_dir(), "plugins", filename))
component.get("PluginManager").scan_for_plugins() component.get("PluginManager").scan_for_plugins()

View File

@ -33,6 +33,7 @@ import cPickle
import deluge.component as component import deluge.component as component
from deluge.ui.client import aclient as client from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import deluge.configmanager
from deluge.log import LOG as log from deluge.log import LOG as log
@ -371,7 +372,7 @@ class TorrentDetails(component.Component):
state = [(n, v) for w, n, v in state] state = [(n, v) for w, n, v in state]
# Get the config location for saving the state file # Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
try: try:
log.debug("Saving TorrentDetails state file: %s", filename) log.debug("Saving TorrentDetails state file: %s", filename)
@ -384,7 +385,7 @@ class TorrentDetails(component.Component):
def load_state(self): def load_state(self):
filename = "tabs.state" filename = "tabs.state"
# Get the config location for loading the state file # Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"] config_location = deluge.configmanager.get_config_dir()
state = None state = None
try: try: