示例#1
0
    def switchHost(self, event):
        hosts_id = event.GetId()
        title = self.hosts[hosts_id]

        oh = self.frame.getOHostsFromTitle(title)
        if oh:
            co.switchHost(self, oh.path)
            self.frame.updateListCtrl()
示例#2
0
    def switchHost(self, event):
        hosts_id = event.GetId()
        title = self.hosts[hosts_id]

        oh = self.frame.getOHostsFromTitle(title)
        if oh:
            co.switchHost(self, oh.path)
            self.frame.updateListCtrl()
示例#3
0
    def switchHost(self, event):
        hosts_id = event.GetId()
        title = self.hosts[hosts_id]

        oh = self.frame.getOHostsFromTitle(title)
        if oh:
            co.switchHost(self, oh.path, oh.getContent(
                replace_import=True, with_config=True
            ))
            self.frame.updateListCtrl()
示例#4
0
    def applyHost(self, event=None, ohosts=None):
        u"""应用某个 hosts"""

        # 保存当前 hosts 的内容
        self.saveCurrentHost()

        # 切换 hosts
        co.switchHost(self.taskbar_icon, self.current_selected_hosts_fn)
        self.updateListCtrl()

        self.m_btn_apply.Disable()
示例#5
0
    def applyHost(self, event=None, ohosts=None):
        u"""应用某个 hosts"""

        # 保存当前 hosts 的内容
        self.saveCurrentHost()

        # 切换 hosts
        co.switchHost(self.taskbar_icon, self.current_selected_hosts_fn)
        self.updateListCtrl()

        self.m_btn_apply.Disable()
示例#6
0
    def applyHost(self, event=None, ohosts=None):
        u"""应用某个 hosts"""

        ohosts = self.getOHostsFromFn() # 当前 hosts

        # 保存当前 hosts 的内容
        self.saveCurrentHost(ohosts)

        # 切换 hosts
        ohosts.frame = self
        co.switchHost(self.taskbar_icon, self.current_selected_hosts_fn, ohosts.getContent(
            replace_import=True, with_config=True, frame=self,
        ))
        self.updateListCtrl()

        self.m_btn_apply.Disable()