mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
parent
4570491523
commit
c6decf1bad
2 changed files with 10 additions and 2 deletions
|
@ -18,7 +18,7 @@ from opensnitch.database import Database
|
|||
from opensnitch.database.enums import RuleFields, ConnFields
|
||||
from opensnitch.version import version
|
||||
from opensnitch.utils import Message, FileDialog, Icons, NetworkInterfaces
|
||||
from opensnitch.rules import Rule
|
||||
from opensnitch.rules import Rule, Rules
|
||||
|
||||
DIALOG_UI_PATH = "%s/../res/ruleseditor.ui" % os.path.dirname(sys.modules[__name__].__file__)
|
||||
class RulesEditorDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
||||
|
@ -46,6 +46,7 @@ class RulesEditorDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
self._notifications_sent = {}
|
||||
self._nodes = Nodes.instance()
|
||||
self._db = Database.instance()
|
||||
self._rules = Rules.instance()
|
||||
self._notification_callback.connect(self._cb_notification_callback)
|
||||
self._old_rule_name = None
|
||||
|
||||
|
@ -261,6 +262,8 @@ class RulesEditorDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
if self.WORK_MODE == self.ADD_RULE:
|
||||
self.WORK_MODE = self.EDIT_RULE
|
||||
|
||||
self._rules.updated.emit(0)
|
||||
|
||||
@QtCore.pyqtSlot(ui_pb2.NotificationReply)
|
||||
def _cb_notification_callback(self, reply):
|
||||
#print(self.LOG_TAG, "Rule notification received: ", reply.id, reply.code)
|
||||
|
|
|
@ -23,7 +23,7 @@ from opensnitch.customwidgets.generictableview import GenericTableModel
|
|||
from opensnitch.customwidgets.addresstablemodel import AddressTableModel
|
||||
from opensnitch.utils import Message, QuickHelp, AsnDB, Icons
|
||||
from opensnitch.actions import Actions
|
||||
from opensnitch.rules import Rule
|
||||
from opensnitch.rules import Rule, Rules
|
||||
|
||||
DIALOG_UI_PATH = "%s/../res/stats.ui" % os.path.dirname(sys.modules[__name__].__file__)
|
||||
class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
||||
|
@ -322,7 +322,9 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
self._cfg = Config.get()
|
||||
self._nodes = Nodes.instance()
|
||||
self._fw = Firewall().instance()
|
||||
self._rules = Rules.instance()
|
||||
self._fw.rules.rulesUpdated.connect(self._cb_fw_rules_updated)
|
||||
self._rules.updated.connect(self._cb_app_rules_updated)
|
||||
self._actions = Actions().instance()
|
||||
self._actions.loadAll()
|
||||
|
||||
|
@ -1177,6 +1179,9 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
|||
def _cb_fw_rules_updated(self):
|
||||
self._add_rulesTree_fw_chains()
|
||||
|
||||
def _cb_app_rules_updated(self, what):
|
||||
self._refresh_active_table()
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def _cb_fw_table_rows_reordered(self, node_addr):
|
||||
node = self._nodes.get_node(node_addr)
|
||||
|
|
Loading…
Add table
Reference in a new issue