コード例 #1
0
class Proxy(gtk.VBox):
    def __init__(self):
        gtk.VBox.__init__(self)
        self.proxy = Contain(app_theme.get_pixbuf("network/proxy.png"),
                             _("Proxy"), self.toggle_cb)
        self.proxysetting = ProxySettings()
        self.add(self.proxy)
        #self.init_state()

    def init_state(self):
        if self.proxysetting.get_proxy_mode() != "none":
            self.proxy.set_active(True)

    @classmethod
    def show_or_hide(self):
        return True

    def toggle_cb(self, widget):
        active = widget.get_active()
        if active:
            if self.proxysetting.get_proxy_mode() == "none":
                self.proxysetting.set_proxy_mode("manual")
            self.align = gtk.Alignment(0, 0, 0, 0)
            self.align.set_padding(0, 0, PADDING, 11)
            label = Label(_("Proxy Configuration"),
                          LABEL_COLOR,
                          underline=True,
                          enable_select=False,
                          enable_double_click=False)
            label.connect("button-release-event", self.slide_to_event)

            self.align.add(label)
            self.add(self.align)
            self.show_all()
        else:
            self.align.destroy()
            self.proxysetting.set_proxy_mode("none")

    def slide_to_event(self, widget, event):
        settings = ProxyConfig()
        settings.init()
        slider.slide_to_page(settings, "none")
        Dispatcher.send_submodule_crumb(2, _("Proxy"))

    #def add_setting_page(self, setting_page):
    #self.settings = setting_page

    def section_show(self):
        self.set_no_show_all(False)
        self.show_all()

    def section_hide(self):
        self.set_no_show_all(True)
        self.hide()

    def set_active(self, state):
        self.proxy.set_active(state)
コード例 #2
0
class Proxy(gtk.VBox):
    def __init__(self):
        gtk.VBox.__init__(self)
        self.proxy = Contain(app_theme.get_pixbuf("network/proxy.png"), _("Proxy"), self.toggle_cb)
        self.proxysetting = ProxySettings()
        self.add(self.proxy)
        #self.init_state()

    def init_state(self):
        if self.proxysetting.get_proxy_mode() != "none":
            self.proxy.set_active(True)

    @classmethod
    def show_or_hide(self):
        return True

    def toggle_cb(self, widget):
        active = widget.get_active()
        if active:
            if self.proxysetting.get_proxy_mode() == "none":
                self.proxysetting.set_proxy_mode("manual")
            self.align = gtk.Alignment(0,0,0,0)
            self.align.set_padding(0,0,PADDING,11)
            label = Label(_("Proxy Configuration"),
                          LABEL_COLOR,
                          underline=True,
                          enable_select=False,
                          enable_double_click=False)
            label.connect("button-release-event", self.slide_to_event)

            self.align.add(label)
            self.add(self.align)
            self.show_all()
        else:
            self.align.destroy()
            self.proxysetting.set_proxy_mode("none")

    def slide_to_event(self, widget, event):
        settings = ProxyConfig()
        settings.init()
        slider.slide_to_page(settings, "none")
        Dispatcher.send_submodule_crumb(2, _("Proxy"))

    #def add_setting_page(self, setting_page):
        #self.settings = setting_page

    def section_show(self):
        self.set_no_show_all(False)
        self.show_all()

    def section_hide(self):
        self.set_no_show_all(True)
        self.hide()

    def set_active(self, state):
        self.proxy.set_active(state)
コード例 #3
0
 def __init__(self):
     gtk.VBox.__init__(self)
     self.proxy = Contain(app_theme.get_pixbuf("network/proxy.png"),
                          _("Proxy"), self.toggle_cb)
     self.proxysetting = ProxySettings()
     self.add(self.proxy)
コード例 #4
0
 def __init__(self):
     gtk.VBox.__init__(self)
     self.proxy = Contain(app_theme.get_pixbuf("network/proxy.png"), _("Proxy"), self.toggle_cb)
     self.proxysetting = ProxySettings()
     self.add(self.proxy)