def dehydrate(self):
        DeviceConfigDialog.dehydrate(self)
        sharedtcpip.dhcp_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.hardware_dehydrate(self.sharedtcpip_xml, self.device)

        wl = self.device.Wireless
        if wl:
            if self.xml.get_widget("essidAutoButton").get_active():
                wl.EssId = ""
            else:
                wl.EssId = self.xml.get_widget("essidEntry").get_text()

            row = self.xml.get_widget("modeCombo").get_active()
            wl.Mode = self.modestore[row][1]

            if wl.Mode == "Managed":
                wl.Channel = ""
                wl.Rate = "auto"
            else:
                channel = self.xml.get_widget("channelEntry").get_text()
                if channel == "Auto":
                    wl.Channel = ""
                else:
                    wl.Channel = channel

                rate = self.xml.get_widget("rateEntry").get_text()
                if rate == _("Auto"):
                    wl.Rate = "auto"
                else:
                    wl.Rate = rate
            # FIXME: [168036] check the key!
            wl.Key = self.xml.get_widget("keyEntry").get_text()
    def __init__(self, device):
        glade_file = "ethernetconfig.glade"
        DeviceConfigDialog.__init__(self, glade_file, device)

        xml_signal_autoconnect(self.xml, { \
            "on_aliasSupportCB_toggled" : self.on_aliasSupportCB_toggled,
            "on_hwAddressCB_toggled" : self.on_hwAddressCB_toggled,
            "on_hwProbeButton_clicked" : self.on_hwProbeButton_clicked,
            })

        window = self.sharedtcpip_xml.get_widget('dhcpWindow')
        frame = self.sharedtcpip_xml.get_widget('dhcpFrame')
        vbox = self.xml.get_widget('generalVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.dhcp_init(self.sharedtcpip_xml, self.device)

        window = self.sharedtcpip_xml.get_widget('routeWindow')
        frame = self.sharedtcpip_xml.get_widget('routeFrame')
        vbox = self.xml.get_widget('routeVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.route_init(self.sharedtcpip_xml, self.device, self.dialog)

        window = self.sharedtcpip_xml.get_widget('hardwareWindow')
        frame = self.sharedtcpip_xml.get_widget('hardwareFrame')
        vbox = self.xml.get_widget('hardwareVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.hardware_init(self.sharedtcpip_xml, self.device)
        self.hydrate()
Ejemplo n.º 3
0
    def __init__(self, device):
        glade_file = "ADSLInterfaceDialog.glade"
        DeviceConfigDialog.__init__(self, glade_file, device)

        xml_signal_autoconnect(
            self.xml, {
                "on_tonlineButton_clicked": self.on_tonlineButton_clicked,
                "on_dialonDemandCB_clicked": self.on_dialonDemandCB_clicked,
            })
        window = self.sharedtcpip_xml.get_widget('dhcpWindow')
        frame = self.sharedtcpip_xml.get_widget('dhcpFrame')
        vbox = self.xml.get_widget('generalVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.dhcp_init(self.sharedtcpip_xml, self.device)

        window = self.sharedtcpip_xml.get_widget('routeWindow')
        frame = self.sharedtcpip_xml.get_widget('routeFrame')
        vbox = self.xml.get_widget('routeVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.route_init(self.sharedtcpip_xml, self.device, self.dialog)

        window = self.sharedtcpip_xml.get_widget('hardwareWindow')
        frame = self.sharedtcpip_xml.get_widget('hardwareFrame')
        vbox = self.xml.get_widget('hardwareVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.dsl_hardware_init(self.sharedtcpip_xml, self.device)
        self.hydrate()
    def __init__(self, device):
        glade_file = "wirelessconfig.glade"

        self.initialized = False

        DeviceConfigDialog.__init__(self, glade_file, device)

        if not self.initialized:
            self.do_init()
    def dehydrate(self):
        DeviceConfigDialog.dehydrate(self)
        sharedtcpip.dhcp_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_dehydrate(self.sharedtcpip_xml, self.device)

        hw = self.xml.get_widget("tokenringDeviceEntry").get_text()
        fields = hw.split()
        hw = fields[0]
        self.device.Device = hw
        if self.xml.get_widget("aliasSupportCB").get_active():
            self.device.Alias = self.xml.get_widget(
                "aliasSpinBox").get_value_as_int()
        else:
            self.device.Alias = None
Ejemplo n.º 6
0
    def hydrate(self):
        DeviceConfigDialog.hydrate(self)
        dialup = self.device.Dialup
        widget = self.xml.get_widget("providerNameEntry")
        if dialup.ProviderName:
            widget.set_text(dialup.ProviderName)
        #widget.set_position(0)

        widget = self.xml.get_widget("loginNameEntry")
        if dialup.Login:
            widget.set_text(dialup.Login)
        #widget.set_position(0)

        widget = self.xml.get_widget("passwordEntry")
        if dialup.Password:
            widget.set_text(dialup.Password)
        #widget.set_position(0)

        widget = self.xml.get_widget("serviceNameEntry")
        if dialup.ServiceName:
            widget.set_text(dialup.ServiceName)
        #widget.set_position(0)

        widget = self.xml.get_widget("acNameEntry")
        if dialup.AcName:
            widget.set_text(dialup.AcName)
        #widget.set_position(0)

        if dialup.Persist:
            self.xml.get_widget("persistCB").set_active(dialup.Persist)

        if dialup.DialMode:
            self.xml.get_widget("dialonDemandCB").set_active(\
                dialup.DialMode == DM_AUTO)
            self.xml.get_widget("idleTimeSB").set_text(\
                str(dialup.HangupTimeout))
            self.on_dialonDemandCB_clicked()
        self.xml.get_widget("useSyncpppCB").set_active(dialup.SyncPPP == True)

        self.xml.get_widget("defrouteCB").set_active(dialup.DefRoute == True)

        sharedtcpip.dhcp_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.dsl_hardware_hydrate(self.sharedtcpip_xml, self.device)
    def hydrate(self):
        DeviceConfigDialog.hydrate(self)

        sharedtcpip.dhcp_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_hydrate(self.sharedtcpip_xml, self.device)

        dialup = self.device.Dialup

        if dialup.ProviderName != None:
            self.xml.get_widget("providerName").set_text(dialup.ProviderName)
        if dialup.Login != None:
            self.xml.get_widget("loginNameEntry").set_text(dialup.Login)
        if dialup.Password != None:
            self.xml.get_widget("passwordEntry").set_text(
                re.sub(r"\\([^\\]|\\)", r"\1", dialup.Password))

        if dialup.Areacode != None:
            self.xml.get_widget("areaCodeEntry").set_text(dialup.Areacode)
        if dialup.PhoneNumber != None:
            self.xml.get_widget("phoneEntry").set_text(dialup.PhoneNumber)
        if dialup.Prefix != None:
            self.xml.get_widget("prefixEntry").set_text(dialup.Prefix)

        if dialup.Compression:
            self.xml.get_widget("headerCompressionCB").set_active(
                dialup.Compression.VJTcpIp == True)
            self.xml.get_widget("connectionCompressionCB").set_active(
                dialup.Compression.VJID == True)
            self.xml.get_widget("acCompressionCB").set_active(
                dialup.Compression.AdressControl == True)
            self.xml.get_widget("pfCompressionCB").set_active(
                dialup.Compression.ProtoField == True)
            self.xml.get_widget("bsdCompressionCB").set_active(
                dialup.Compression.BSD == True)
            self.xml.get_widget("cppCompressionCB").set_active(
                dialup.Compression.CCP == True)

        if dialup.PPPOptions:
            widget = self.xml.get_widget("pppOptionList")
            widget.clear()
            widget.set_sensitive(len(dialup.PPPOptions) > 0)
            for plist in dialup.PPPOptions:
                widget.append([plist])
    def dehydrate(self):
        DeviceConfigDialog.dehydrate(self)
        sharedtcpip.dhcp_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_dehydrate(self.sharedtcpip_xml, self.device)
        dialup = self.device.createDialup()

        for attr, widget in {
                'ProviderName': 'providerName',
                'Login': '******',
                'Password': '******',
                'Areacode': 'areaCodeEntry',
                'Prefix': 'prefixEntry',
                'PhoneNumber': 'phoneEntry',
        }.items():
            val = self.xml.get_widget(widget).get_text().strip()
            if val:
                setattr(dialup, attr, val)
            else:
                if attr != "Password":
                    delattr(dialup, attr)

        if not dialup.Compression:
            dialup.createCompression()

        for attr, widget in {
                'VJTcpIp': 'headerCompressionCB',
                'VJID': 'connectionCompressionCB',
                'AdressControl': 'acCompressionCB',
                'ProtoField': 'pfCompressionCB',
                'BSD': 'bsdCompressionCB',
                'CCP': 'cppCompressionCB',
        }.items():
            val = self.xml.get_widget(widget).get_active()
            setattr(dialup.Compression, attr, val)

        del dialup.PPPOptions
        clist = self.xml.get_widget("pppOptionList")
        if clist.rows:
            dialup.createPPPOptions()
            for i in xrange(clist.rows):
                dialup.PPPOptions.append(clist.get_text(i, 0).strip())
    def __init__(self, device):
        glade_file = "DialupInterfaceDialog.glade"
        DeviceConfigDialog.__init__(self, glade_file, device)
        self.edit = False

        xml_signal_autoconnect(self.xml,
            {
            "on_chooseButton_clicked" : self.on_chooseButton_clicked,
            "on_helpButton_clicked" : self.on_helpButton_clicked,
            "on_callbackCB_toggled" : self.on_callbackCB_toggled,
            "on_pppOptionEntry_changed" : self.on_pppOptionEntry_changed,
            "on_pppOptionAddButton_clicked" : \
            self.on_pppOptionAddButton_clicked,
            "on_pppOptionList_select_row" : self.on_pppOptionList_select_row,
            "on_ipppOptionList_unselect_row" : \
            self.on_ipppOptionList_unselect_row,
            "on_pppOptionDeleteButton_clicked" : \
            self.on_pppOptionDeleteButton_clicked,
            "on_tonlineButton_clicked" : self.on_tonlineButton_clicked,
            "on_showPassword_clicked" : self.on_showPassword_clicked,
            })

        self.noteBook = self.xml.get_widget("dialupNotebook")
        self.xml.get_widget("pppOptionList").column_titles_passive()

        window = self.sharedtcpip_xml.get_widget('dhcpWindow')
        frame = self.sharedtcpip_xml.get_widget('dhcpFrame')
        vbox = self.xml.get_widget('generalVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.dhcp_init(self.sharedtcpip_xml, self.device)

        window = self.sharedtcpip_xml.get_widget('routeWindow')
        frame = self.sharedtcpip_xml.get_widget('routeFrame')
        vbox = self.xml.get_widget('routeVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.route_init(self.sharedtcpip_xml, self.device, self.dialog)
        self.hydrate()
    def hydrate(self):
        if not self.initialized:
            self.do_init()

        DeviceConfigDialog.hydrate(self)

        sharedtcpip.dhcp_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.hardware_hydrate(self.sharedtcpip_xml, self.device)

        wl = self.device.Wireless
        if wl:
            if wl.Mode and self.modestore:
                values = [r[1].lower() for r in self.modestore]
                match_row = values.index(wl.Mode.lower())
                self.xml.get_widget("modeCombo").set_active(match_row)

            if wl.EssId == "":
                self.xml.get_widget("essidAutoButton").set_active(True)
                self.xml.get_widget("essidEntry").set_sensitive(False)
            else:
                self.xml.get_widget("essidSpecButton").set_active(True)
                self.xml.get_widget("essidAutoButton").set_active(False)
                self.xml.get_widget("essidEntry").set_sensitive(True)
            if wl.EssId:
                self.xml.get_widget("essidEntry").set_text(wl.EssId)

            if wl.Channel and wl.Channel != "":
                self.xml.get_widget("channelEntry").set_text(wl.Channel)

            if wl.Rate:
                self.xml.get_widget("rateEntry").set_text(_(wl.Rate))

            if wl.Key:
                self.xml.get_widget("keyEntry").set_text(wl.Key)

        self.on_modeChanged(self.xml.get_widget("modeEntry"))
        self.on_essidAutoButton_toggled(self.xml.get_widget("essidAutoButton"))
Ejemplo n.º 11
0
    def __init__(self, device):
        glade_file = "QethConfig.glade"
        DeviceConfigDialog.__init__(self, glade_file, device)

        xml_signal_autoconnect(self.xml, { \
            "on_aliasSupportCB_toggled" : self.on_aliasSupportCB_toggled,
            })

        window = self.sharedtcpip_xml.get_widget('dhcpWindow')
        frame = self.sharedtcpip_xml.get_widget('dhcpFrame')
        vbox = self.xml.get_widget('generalVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.dhcp_init(self.sharedtcpip_xml, self.device)

        window = self.sharedtcpip_xml.get_widget('routeWindow')
        frame = self.sharedtcpip_xml.get_widget('routeFrame')
        vbox = self.xml.get_widget('routeVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.route_init(self.sharedtcpip_xml, self.device, self.dialog)

        window = self.sharedtcpip_xml.get_widget('hardwareWindow')
        frame = self.sharedtcpip_xml.get_widget('hardwareFrame')
        vbox = self.xml.get_widget('hardwareVbox')
        window.remove(frame)
        vbox.pack_start(frame)
        sharedtcpip.hardware_init(self.sharedtcpip_xml, self.device)

        self.sharedtcpip_xml.get_widget("hardwareMACToggle").set_sensitive(
            false)
        self.sharedtcpip_xml.get_widget("hardwareMACEntry").set_sensitive(
            false)
        self.sharedtcpip_xml.get_widget("hardwareProbeButton").set_sensitive(
            false)

        self.hydrate()
    def hydrate(self):
        DeviceConfigDialog.hydrate(self)
        sharedtcpip.dhcp_hydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_hydrate(self.sharedtcpip_xml, self.device)

        ecombo = self.xml.get_widget("tokenringDeviceComboBox")
        hwlist = NCHardwareList.getHardwareList()
        (hwcurr,
         hwdesc) = NC_functions.create_tokenring_combo(hwlist,
                                                       self.device.Device)

        if len(hwdesc):
            ecombo.set_popdown_strings(hwdesc)

        widget = self.xml.get_widget("tokenringDeviceEntry")
        if self.device.Device:
            widget.set_text(hwcurr)
        #widget.set_position(0)

        if self.device.Alias != None:
            self.xml.get_widget("aliasSupportCB").set_active(True)
            self.xml.get_widget("aliasSpinBox").set_value(self.device.Alias)
        else:
            self.xml.get_widget("aliasSupportCB").set_active(False)
Ejemplo n.º 13
0
    def dehydrate(self):
        DeviceConfigDialog.dehydrate(self)
        dialup = self.device.Dialup
        dialup.ProviderName = self.xml.get_widget(
            "providerNameEntry").get_text()
        dialup.Login = self.xml.get_widget("loginNameEntry").get_text()
        dialup.Password = self.xml.get_widget("passwordEntry").get_text()
        dialup.ServiceName = self.xml.get_widget("serviceNameEntry").get_text()
        dialup.AcName = self.xml.get_widget("acNameEntry").get_text()
        dialup.SyncPPP = self.xml.get_widget("useSyncpppCB").get_active()
        dialup.DefRoute = self.xml.get_widget("defrouteCB").get_active()
        dialup.Persist = self.xml.get_widget("persistCB").get_active()
        if self.xml.get_widget("dialonDemandCB").get_active():
            dialup.DialMode = DM_AUTO
            dialup.HangupTimeout = int(
                self.xml.get_widget("idleTimeSB").get_text())
        else:
            dialup.DialMode = DM_MANUAL

        if not self.device.Device:
            self.device.Device = "dsl"
        sharedtcpip.dhcp_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.route_dehydrate(self.sharedtcpip_xml, self.device)
        sharedtcpip.dsl_hardware_dehydrate(self.sharedtcpip_xml, self.device)
 def dehydrate(self):
     DeviceConfigDialog.dehydrate(self)
     sharedtcpip.dhcp_dehydrate(self.sharedtcpip_xml, self.device)
     sharedtcpip.route_dehydrate(self.sharedtcpip_xml, self.device)
     sharedtcpip.hardware_dehydrate(self.sharedtcpip_xml, self.device)