Ticket #636: config_chg.diff

File config_chg.diff, 3.0 KB (added by dasnyderx@…, 15 years ago)

deluged config concordance with gtkui in classic_mode

  • deluge/ui/gtkui/connectionmanager.py

     
    118118 
    119119        # If classic mode is set, we just start up a localhost daemon and connect to it 
    120120        if self.gtkui_config["classic_mode"]: 
    121             uri = "http://localhost:58846" 
    122             self.start_localhost(58846) 
     121            uri = "http://" + DEFAULT_CONFIG["hosts"][0] 
     122            port = uri[7:].split(":")[1] 
     123            self.start_localhost(port) 
    123124            # We need to wait for the host to start before connecting 
    124125            while not self.test_online_status(uri): 
    125126                time.sleep(0.01) 
     
    393394        log.debug("on_button_startdaemon_clicked") 
    394395        if self.liststore.iter_n_children(None) < 1: 
    395396            # There is nothing in the list, so lets create a localhost entry 
    396             self.add_host("localhost", 58846) 
     397            port = DEFAULT_CONFIG["hosts"][0].split(":")[1] 
     398            self.add_host(DEFAULT_CONFIG["hosts"][0].split(":")[0],  
     399                port) 
    397400            # ..and start the daemon. 
    398             self.start_localhost(58846) 
     401            self.start_localhost(port) 
    399402            return 
    400403 
    401404        paths = self.hostlist.get_selection().get_selected_rows()[1] 
     
    425428        if deluge.common.windows_check(): 
    426429            win32api.WinExec("deluged -p %s" % port) 
    427430        else: 
    428             subprocess.call(["deluged", "-p %s" % port]) 
     431            subprocess.call(["deluged", "--port=%s" % port, 
     432                "--config=%s" % self.gtkui_config["config_location"]]) 
    429433 
    430434    def on_button_close_clicked(self, widget): 
    431435        log.debug("on_button_close_clicked") 
  • deluge/ui/gtkui/filtertreeview.py

     
    7171        self.scrolled = glade.get_widget("scrolledwindow_sidebar") 
    7272        self.sidebar = component.get("SideBar") 
    7373        self.config = ConfigManager("gtkui.conf") 
    74         self.tracker_icons = TrackerIcons() 
     74        self.tracker_icons = TrackerIcons(self.config["config_location"]) 
    7575 
    7676        self.label_view = gtk.TreeView() 
    7777        self.sidebar.add_tab(self.label_view, "filters", _("Filters")) 
  • deluge/ui/tracker_icons.py

     
    6060    return data 
    6161 
    6262class TrackerIcons(object): 
    63     def __init__(self): 
     63    def __init__(self, config_dir=None): 
    6464        #set image cache dir 
    65         self.image_dir = get_default_config_dir("icons") 
     65        if config_dir == None: 
     66            self.image_dir = get_default_config_dir("icons") 
     67        else: 
     68            self.image_dir = os.path.join(config_dir, "icons") 
    6669        if not os.path.exists(self.image_dir): 
    6770            os.mkdir(self.image_dir) 
    6871