diff --git a/ui/opensnitch/config.py b/ui/opensnitch/config.py index 11f6fdbb38..3528c25113 100644 --- a/ui/opensnitch/config.py +++ b/ui/opensnitch/config.py @@ -4,6 +4,8 @@ class Config: __instance = None + HELP_URL = "https://github.com/gustavo-iniguez-goya/opensnitch/wiki/Configurations" + @staticmethod def init(): Config.__instance = Config() diff --git a/ui/opensnitch/dialogs/ruleseditor.py b/ui/opensnitch/dialogs/ruleseditor.py index e39450140f..432aa3e1ea 100644 --- a/ui/opensnitch/dialogs/ruleseditor.py +++ b/ui/opensnitch/dialogs/ruleseditor.py @@ -9,6 +9,7 @@ import ui_pb2 import time +from config import Config from nodes import Nodes from database import Database @@ -33,6 +34,7 @@ def __init__(self, parent=None, _rule=None): self.buttonBox.button(QtWidgets.QDialogButtonBox.Reset).clicked.connect(self._cb_reset_clicked) self.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self._cb_close_clicked) self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._cb_apply_clicked) + self.buttonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self._cb_help_clicked) self.procCheck.toggled.connect(self._cb_proc_check_toggled) self.cmdlineCheck.toggled.connect(self._cb_cmdline_check_toggled) self.dstPortCheck.toggled.connect(self._cb_dstport_check_toggled) @@ -52,6 +54,9 @@ def _cb_close_clicked(self): def _cb_reset_clicked(self): self._reset_state() + def _cb_help_clicked(self): + QtGui.QDesktopServices.openUrl(QtCore.QUrl(Config.HELP_URL)) + def _cb_proc_check_toggled(self, state): self.procLine.setEnabled(state) diff --git a/ui/opensnitch/res/ruleseditor.ui b/ui/opensnitch/res/ruleseditor.ui index 4b5818b884..e6e825acaa 100644 --- a/ui/opensnitch/res/ruleseditor.ui +++ b/ui/opensnitch/res/ruleseditor.ui @@ -14,13 +14,43 @@ Rule - + Qt::Horizontal + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset + + + + + @@ -48,7 +78,7 @@ - + true @@ -84,14 +114,7 @@ - - - - Enable - - - - + false @@ -146,6 +169,50 @@ + + + + + + + 0 + 0 + + + + Deny + + + + ../../../../../../../../.designer/backup../../../../../../../../.designer/backup + + + true + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Allow + + + + ../../../../../../../../.designer/backup../../../../../../../../.designer/backup + + + + + @@ -288,8 +355,8 @@ - - + + Qt::Horizontal @@ -301,59 +368,8 @@ - - - - Duration - - - - - - - - - - 0 - 0 - - - - Deny - - - - ../../../../../../../../.designer/backup../../../../../../../../.designer/backup - - - true - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Allow - - - - ../../../../../../../../.designer/backup../../../../../../../../.designer/backup - - - - - - - + + Qt::Horizontal @@ -365,13 +381,27 @@ + + + + Duration + + + - - + + - + + + Enable + + + + + Qt::Horizontal @@ -383,19 +413,6 @@ - - - - - 0 - 0 - - - - QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Reset - - - diff --git a/ui/opensnitch/service.py b/ui/opensnitch/service.py index 19f396a023..1d31ee47cf 100644 --- a/ui/opensnitch/service.py +++ b/ui/opensnitch/service.py @@ -33,8 +33,6 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject): _version_warning_trigger = QtCore.pyqtSignal(str, str) _status_change_trigger = QtCore.pyqtSignal() - HELP_URL = "https://github.com/gustavo-iniguez-goya/opensnitch/wiki/Configurations" - def __init__(self, app, on_exit): super(UIService, self).__init__() @@ -127,7 +125,7 @@ def _setup_tray(self): self._tray.setContextMenu(self._menu) self._menu.addAction("Help").triggered.connect( - lambda: QtGui.QDesktopServices.openUrl(QtCore.QUrl(self.HELP_URL)) + lambda: QtGui.QDesktopServices.openUrl(QtCore.QUrl(Config.HELP_URL)) ) self._stats_action.triggered.connect(self._show_stats_dialog)