コード例 #1
0
ファイル: edit_nat.py プロジェクト: maximerobin/Ufwi
    def __init__(self, window, rules):
        EditRule.__init__(self, window, rules, "nat")
        ui = self.ui
        self.setupEdit(
            ui.nat_enabled,
            ui.nat_mandatory,
            ui.nat_comment)

        for widget in ['nated_sources', 'nated_destinations', 'nated_filters']:
            editor = self.object_list[widget]
            editor.accept_groups = False
            window.connect(editor.widget, SIGNAL('objectDrop()'), self.switchNatEnabled)
            window.connect(editor.menu.delete_action, SIGNAL('triggered()'), self.switchNatEnabled)

        if self.window.compatibility.nat_support_accept:
            self.type = self.ui.nat_type
            self.type.clear()
            labels = [NAT_TYPE_LABELS[type] for type in TYPES]
            self.type.addItems(labels)
            window.connect(
                ui.nat_type,
                SIGNAL("currentIndexChanged(int)"),
                self.changeDecision)
        else:
            self.ui.nat_type.hide()
            self.type = None

        self.connectOkButton(self.getWidget('save_button'))
コード例 #2
0
ファイル: edit_acl.py プロジェクト: maximerobin/Ufwi
    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)
コード例 #3
0
ファイル: edit_nat.py プロジェクト: maximerobin/Ufwi
 def startEdit(self):
     self.switchNatEnabled()
     EditRule.startEdit(self)