Ejemplo n.º 1
0
    def __init__(self, interface, net=None, parent=None):
        CentralDialog.__init__(self, parent)

        self.net=net
        self.interface = interface

        self.editor = NetFrame(interface, net=net)
        #easy accessors
        self.net_label = self.editor.net_label
        self.ip_addrs = self.editor.ip_addrs
        self.net_ip = self.editor.net_ip

        button_box = QDialogButtonBox()
        button_box.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok |QDialogButtonBox.Help)
        self.ok_button = button_box.Ok
        self.connectButtons(button_box)

        #layout
        box = QVBoxLayout(self)
        box.addWidget(self.editor)
        box.addWidget(button_box)

        self.connect(self.editor, SIGNAL("change title"), self.changeTitle)
        self.editor.changeTitle()

        self.acceptableInput()
Ejemplo n.º 2
0
    def __init__(self, window, config):
        CentralDialog.__init__(self, window)
        self.window = window
        self.compatibility = window.compatibility
        self.setupDialog()
        self.config = config
        self.getCurrentConfig()

        self.execLoop()
Ejemplo n.º 3
0
    def __init__(self, parent=None, options=None):
        CentralDialog.__init__(self, parent)
        self.setupUi(self)
        self.options = options
        self.ssl_options = QtSSLConfig()
        self.load_settings()
        self.host_edit.lineEdit().setText(self.host)
        self.streaming_spinbox.setValue(self.streaming_port)
        self.login_edit.setText(self.login)
        self.setProtocol(self.protocol)
        if (self.protocol == u'http' and self.port == DEFAULT_HTTP_PORT) \
        or (self.protocol == u'https' and self.port == DEFAULT_HTTPS_PORT):
            self.defaultPort(True)
        else:
            self.customPort(True)
        self.port_spinbox.setValue(self.port)

        self.connect(self.custom_radio, SIGNAL("toggled(bool)"), self.customPort)
        self.connect(self.default_radio, SIGNAL("toggled(bool)"), self.defaultPort)
        self.connect(self.protocol_combo, SIGNAL("currentIndexChanged(int)"), self.protocolChanged)
        self.connect(self.configure_ssl, SIGNAL("clicked()"), self.configureSSL)
        self.connect(self.bt_advanced, SIGNAL("toggled(bool)"), self.toggle_advanced)

        if not EDENWALL:
            self.setWindowTitle( self.tr("NuFirewall Authentication"))

        if options:
            if options.host:
                self.host_edit.lineEdit().setText(options.host)
            if options.username:
                self.login_edit.setText(options.username)
            if options.password:
                self.password_edit.setText(options.password)
            if options.cleartext:
                self.setProtocol("http")
            if options.secure:
                self.setProtocol("https")
            if options.port:
                self.port_spinbox.setValue(options.port)
                self.custom_radio.setChecked(True)
            if options.streaming_port:
                self.streaming_spinbox.setValue(options.streaming_port)

        self.connectButtons(self.buttonBox)
        hostname_regex = QRegExp(
            ur"^[a-z0-9_-]+(\.[a-z0-9_-]*)*$",
            Qt.CaseInsensitive)
        self.setRegExpValidator(self.host_edit.lineEdit(), hostname_regex)
        notempty = QRegExp(ur"^.+$")
        self.setRegExpValidator(self.login_edit, notempty)

        self.toggle_advanced(False)

        self.center()
Ejemplo n.º 4
0
    def __init__(self, client, edw_list, parent=None):
        CentralDialog.__init__(self, parent)

        self.ui = Ui_RegisterFirewall()
        self.ui.setupUi(self)
        self.connectButtons(self.ui.buttonBox)
        self.setRegExpValidator(self.ui.name, HOSTNAME_OR_FQDN_REGEXP)
        self.setRegExpValidator(self.ui.hostname, IP_OR_FQDN_REGEXP)
        self.setNonEmptyValidator(self.ui.password)
        self.setNonEmptyValidator(self.ui.login)
        self.connect(self.ui.protocol, SIGNAL('currentIndexChanged(int)'), self.protocolChanged)
        self.setWindowTitle(APP_TITLE)

        self.client = client
        self.edw_list = edw_list
Ejemplo n.º 5
0
    def __init__(self, client, parent):

        CentralDialog.__init__(self, parent)
        self.main_window = parent
        self.ui = Ui_ConfigDialog()
        self.ui.setupUi(self)

        self.client = client
        self.firewall = ''

        if self.client.call('CORE', 'hasComponent', 'multisite_master'):
            firewalls = self.client.call('multisite_master', 'listFirewalls')
            self.ui.firewall.addItem(self.tr('EMF appliance'), QVariant(''))
            firewalls.sort()
            for fw, state, error, lastseen, ip in firewalls:
                self.ui.firewall.addItem(unicode(self.tr('Remote: %s')) % fw, QVariant(fw))
            self.connect(self.ui.firewall, SIGNAL('currentIndexChanged(int)'), self.firewallChanged)
        else:
            self.ui.firewall.hide()
            self.ui.firewall_label.hide()

        self.connectButtons(self.ui.buttonBox)
        self.setRegExpValidator(self.ui.hostnameEdit, IP_OR_HOSTNAME_OR_FQDN_REGEXP)
        self.setRegExpValidator(self.ui.databaseEdit, ASCII7_REGEXP)
        self.setRegExpValidator(self.ui.usernameEdit, ASCII7_REGEXP)
        self.setRegExpValidator(self.ui.passwordEdit, ASCII7_REGEXP)
        self.setRegExpValidator(self.ui.tableEdit, ASCII7_REGEXP)

        # To determine if there are changes, change the variable state when any
        # field is changed.
        self.changed = False
        for name in dir(self.ui):
            if name == 'firewall':
                continue
            widget = getattr(self.ui, name)
            if isinstance(widget, QLineEdit):
                self.connect(widget, SIGNAL('textChanged(const QString&)'), self.settingsChanged)
            elif isinstance(widget, QComboBox):
                self.connect(widget, SIGNAL('currentIndexChanged(int)'), self.settingsChanged)
            elif isinstance(widget, QSpinBox):
                self.connect(widget, SIGNAL('valueChanged(int)'), self.settingsChanged)
            elif isinstance(widget, QCheckBox):
                self.connect(widget, SIGNAL('toggled(bool)'), self.settingsChanged)

        # Prevent the user from changing database settings on an Edenwall
        if self.main_window.use_edenwall:
            self.ui.databaseGroupBox.hide()
Ejemplo n.º 6
0
    def __init__(self, parent=None, options=None):
        CentralDialog.__init__(self, parent)
        self.setupUi(self)
        self.ssl_options = QtSSLConfig()
        self.fill()
        self.connect(self.use_ca_checkbox, SIGNAL("stateChanged(int)"), self.useCa)
        self.connect(self.use_cert_checkbox, SIGNAL("stateChanged(int)"), self.useCert)
        self.connect(self.use_crl_checkbox, SIGNAL("stateChanged(int)"), self.useCrl)
        self.connect(
            self.cert_button, SIGNAL("clicked()"), partial(self.selectFile, "cert", tr("Select a certificate"))
        )
        self.connect(self.key_button, SIGNAL("clicked()"), partial(self.selectFile, "key", tr("Select a private key")))
        self.connect(self.ca_button, SIGNAL("clicked()"), partial(self.selectFile, "ca", tr("Select a CA certificate")))
        self.connect(self.crl_button, SIGNAL("clicked()"), partial(self.selectFile, "crl", tr("Select a CRL")))
        self.showCertificate("cert")
        self.showCertificate("ca")

        version_warning = QtSSLConfig.getM2CryptoVersionWarning()
        if version_warning:
            QMessageBox.warning(None, tr("SSL warning"), "\n".join(version_warning))

        if QtSSLConfig.m2crypto_version < QtSSLConfig.M2CRYPTO_0_20_0_EW2:
            self.crl_groupbox.setEnabled(False)
Ejemplo n.º 7
0
 def __init__(self, window, accept=None):
     self.window = window
     CentralDialog.__init__(self, window, accept)