MCPcopy
hub / github.com/evilsocket/opensnitch / __init__

Method __init__

ui/opensnitch/dialogs/stats.py:382–843  ·  view source on GitHub ↗
(self, parent=None, address=None, db=None, dbname="db", appicon=None)

Source from the content-addressed store, hash-verified

380 }
381
382 def __init__(self, parent=None, address=None, db=None, dbname="db", appicon=None):
383 super(StatsDialog, self).__init__(parent)
384
385 self.setWindowFlags(QtCore.Qt.WindowType.Window)
386 self.setupUi(self)
387 self.setWindowIcon(appicon)
388
389 # columns names. Must be added here in order to names be translated.
390 self.COL_STR_NAME = QC.translate("stats", "Name", "This is a word, without spaces and symbols.").replace(" ", "")
391 self.COL_STR_ADDR = QC.translate("stats", "Address", "This is a word, without spaces and symbols.").replace(" ", "")
392 self.COL_STR_STATUS = QC.translate("stats", "Status", "This is a word, without spaces and symbols.").replace(" ", "")
393 self.COL_STR_HOSTNAME = QC.translate("stats", "Hostname", "This is a word, without spaces and symbols.").replace(" ", "")
394 self.COL_STR_UPTIME = QC.translate("stats", "Uptime", "This is a word, without spaces and symbols.").replace(" ", "")
395 self.COL_STR_VERSION = QC.translate("stats", "Version", "This is a word, without spaces and symbols.").replace(" ", "")
396 self.COL_STR_RULES_NUM = QC.translate("stats", "Rules", "This is a word, without spaces and symbols.").replace(" ", "")
397 self.COL_STR_TIME = QC.translate("stats", "Time", "This is a word, without spaces and symbols.").replace(" ", "")
398 self.COL_STR_CREATED = QC.translate("stats", "Created", "This is a word, without spaces and symbols.").replace(" ", "")
399 self.COL_STR_ACTION = QC.translate("stats", "Action", "This is a word, without spaces and symbols.").replace(" ", "")
400 self.COL_STR_DURATION = QC.translate("stats", "Duration", "This is a word, without spaces and symbols.").replace(" ", "")
401 self.COL_STR_DESCRIPTION = QC.translate("stats", "Description", "This is a word, without spaces and symbols.").replace(" ", "")
402 self.COL_STR_NODE = QC.translate("stats", "Node", "This is a word, without spaces and symbols.").replace(" ", "")
403 self.COL_STR_ENABLED = QC.translate("stats", "Enabled", "This is a word, without spaces and symbols.").replace(" ", "")
404 self.COL_STR_PRECEDENCE = QC.translate("stats", "Precedence", "This is a word, without spaces and symbols.").replace(" ", "")
405 self.COL_STR_HITS = QC.translate("stats", "Hits", "This is a word, without spaces and symbols.").replace(" ", "")
406 self.COL_STR_PROTOCOL = QC.translate("stats", "Protocol", "This is a word, without spaces and symbols.").replace(" ", "")
407 self.COL_STR_PROCESS = QC.translate("stats", "Process", "This is a word, without spaces and symbols.").replace(" ", "")
408 self.COL_STR_PROC_CMDLINE = QC.translate("stats", "Cmdline", "This is a word, without spaces and symbols.").replace(" ", "")
409 self.COL_STR_DESTINATION = QC.translate("stats", "Destination", "This is a word, without spaces and symbols.").replace(" ", "")
410 self.COL_STR_SRC_PORT = QC.translate("stats", "SrcPort", "This is a word, without spaces and symbols.").replace(" ", "")
411 self.COL_STR_SRC_IP = QC.translate("stats", "SrcIP", "This is a word, without spaces and symbols.").replace(" ", "")
412 self.COL_STR_DST_IP = QC.translate("stats", "DstIP", "This is a word, without spaces and symbols.").replace(" ", "")
413 self.COL_STR_DST_HOST = QC.translate("stats", "DstHost", "This is a word, without spaces and symbols.").replace(" ", "")
414 self.COL_STR_DST_PORT = QC.translate("stats", "DstPort", "This is a word, without spaces and symbols.").replace(" ", "")
415 self.COL_STR_RULE = QC.translate("stats", "Rule", "This is a word, without spaces and symbols.").replace(" ", "")
416 self.COL_STR_UID = QC.translate("stats", "UserID", "This is a word, without spaces and symbols.").replace(" ", "")
417 self.COL_STR_PID = QC.translate("stats", "PID", "This is a word, without spaces and symbols.").replace(" ", "")
418 self.COL_STR_LAST_CONNECTION = QC.translate("stats", "LastConnection", "This is a word, without spaces and symbols.").replace(" ", "")
419
420 self.FIREWALL_STOPPED = QC.translate("stats", "Not running")
421 self.FIREWALL_DISABLED = QC.translate("stats", "Disabled")
422 self.FIREWALL_RUNNING = QC.translate("stats", "Running")
423
424 # restore scrollbar position when going back from a detail view
425 self.LAST_SCROLL_VALUE = None
426 # try to restore last selection
427 self.LAST_SELECTED_ITEM = ""
428 self.LAST_TAB = 0
429
430 self._db = db
431 self._db_sqlite = self._db.get_db()
432 self._db_name = dbname
433
434 self.asndb = AsnDB.instance()
435
436 self._cfg = Config.get()
437 self._nodes = Nodes.instance()
438 self._fw = Firewall().instance()
439 self._rules = Rules.instance()

Callers

nothing calls this directly

Calls 15

_cb_splitter_movedMethod · 0.95
_setup_tableMethod · 0.95
_get_limitMethod · 0.95
_cb_clean_sql_clickedMethod · 0.95
_cb_cmd_back_clickedMethod · 0.95
_load_settingsMethod · 0.95
_configure_pluginsMethod · 0.95
FirewallClass · 0.90
ActionsClass · 0.90

Tested by

no test coverage detected