예제 #1
0
    def __init__(self, window):
        EditRule.__init__(self, window, None, "acl")
        self.setupEdit(
            window.acl_enabled,
            window.acl_mandatory,
            window.acl_comment)

        self.decision = window.acl_decision
        self.applications = EditList(self, window.acl_applications, False, self.object_list, True,
            window.object_libraries['applications'], window.object_libraries['operating_systems'])
        self.highlight_list['applications'] = self.applications
        self.highlight_list['operating_systems'] = self.applications
        self.use_log = window.acl_use_log
        self.log_prefix = window.acl_log_prefix
        self.log_prefix.setAcceptDrops(False)
        self.setRegExpValidator(self.log_prefix, ASCII_REGEXP)
        self.auth_quality = self.getWidget('auth_quality')

        window.connect(self.use_log, SIGNAL("stateChanged(int)"), self.toggleLog)

        editor = self.object_list['user_groups']
        window.connect(editor.widget, SIGNAL('objectDrop()'), self.switchNuFW)
        window.connect(editor.menu.delete_action, SIGNAL('triggered()'), self.switchNuFW)

        self.connectOkButton(self.getWidget('save_button'))

        self.time_period = EditLine(self,
            (window.object_libraries["periodicities"], window.object_libraries["durations"]),
            self.getWidget("time_period"), self.getWidget("clear_time_period"))
        self.highlight_list['periodicities'] = self.time_period
        self.highlight_list['durations'] = self.time_period

        self.object_list['protocols'].setEmptyAllowed(window.compatibility.platform)

        fillDecisionCombo(self.decision)
예제 #2
0
    def __init__(self, window, controler, chain):
        RulesetDialog.__init__(self, window)
        self.setupUi(self)
        self.controler = controler
        self.default_decisions = chain.default_decisions
        self.chain_key = chain.key

        decision, use_log = self.default_decisions.get(self.chain_key)
        fillDecisionCombo(self.decision_combo)
        self.header_label.setText(tr("Change the default decision of the %s chain:") % unicode(chain))
        QComboBox_setCurrentText(self.decision_combo, decision)
        self.log_checkbox.setChecked(use_log)