Cross protocol firewall kill in options menu for debug purpose

This commit is contained in:
SimplifiedPrivacy 2026-11-05 18:18:08 -05:00
parent 9d636681b1
commit 12e108b22a
2 changed files with 48 additions and 4 deletions

View file

@ -8,12 +8,13 @@ from datetime import datetime, timezone
from PyQt6.QtWidgets import ( from PyQt6.QtWidgets import (
QApplication, QButtonGroup, QCheckBox, QComboBox, QFrame, QGridLayout, QApplication, QButtonGroup, QCheckBox, QComboBox, QFrame, QGridLayout,
QGroupBox, QHBoxLayout, QLabel, QLineEdit, QMessageBox, QPushButton, QGroupBox, QHBoxLayout, QLabel, QLineEdit, QMessageBox, QPushButton,
QScrollArea, QStackedLayout, QVBoxLayout, QWidget, QScrollArea, QStackedLayout, QVBoxLayout, QWidget, QSizePolicy
) )
from PyQt6.QtGui import QIcon from PyQt6.QtGui import QIcon
from PyQt6.QtCore import Qt, QSize from PyQt6.QtCore import Qt, QSize
from core.Constants import Constants from core.Constants import Constants
from core.services.networking.general_connection_tools.disconnect import kill_everything
from core.controllers.ConfigurationController import ConfigurationController from core.controllers.ConfigurationController import ConfigurationController
from core.controllers.PolicyController import PolicyController from core.controllers.PolicyController import PolicyController
from core.controllers.ProfileController import ProfileController from core.controllers.ProfileController import ProfileController
@ -46,7 +47,7 @@ from gui.v2.ui.styles.styles import (
checkbox_style, checkbox_style,
combobox_style, combobox_style,
) )
from gui.v2.ui.styles.css.settings_styles import TICKET_SETTING_STYLE_A, setting_style_b, setting_evaluate_style_c, setting_evaluate_style_d from gui.v2.ui.styles.css.settings_styles import TICKET_SETTING_STYLE_A, setting_style_b, setting_evaluate_style_c, setting_evaluate_style_d, STOP_SIGN_STYLE
from gui.v2.ui.widgets.clickable_label import ClickableValueLabel from gui.v2.ui.widgets.clickable_label import ClickableValueLabel
from gui.v2.ui.widgets.terminal_widget import TerminalWidget from gui.v2.ui.widgets.terminal_widget import TerminalWidget
@ -2310,6 +2311,20 @@ class Settings(Page):
"Error saving registration settings") "Error saving registration settings")
def kill_connection_now(self):
reply = QMessageBox.question(
self,
"Confirm Action",
"Are you sure you want to kill your systemwide connection & firewall?",
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
QMessageBox.StandardButton.No
)
# If the user clicked Yes, run the stop function
if reply == QMessageBox.StandardButton.Yes:
print("stopping everything")
kill_everything()
def create_connection_page(self): def create_connection_page(self):
page = QWidget() page = QWidget()
@ -2397,8 +2412,17 @@ class Settings(Page):
self.connection_save_button.setIconSize(QSize(75, 46)) self.connection_save_button.setIconSize(QSize(75, 46))
self.connection_save_button.clicked.connect(self.save_connection_settings) self.connection_save_button.clicked.connect(self.save_connection_settings)
button_layout = QHBoxLayout() self.kill_connections_button = QPushButton()
self.kill_connections_button.setText("KILL CONNECITON/FIREWALL")
self.kill_connections_button.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
self.kill_connections_button.clicked.connect(self.kill_connection_now)
# Apply the "Stop Sign" styling
self.kill_connections_button.setStyleSheet(STOP_SIGN_STYLE)
button_layout = QVBoxLayout()
button_layout.addWidget(self.connection_save_button) button_layout.addWidget(self.connection_save_button)
button_layout.addWidget(self.kill_connections_button)
button_layout.addStretch() button_layout.addStretch()
layout.addLayout(button_layout) layout.addLayout(button_layout)

View file

@ -41,3 +41,23 @@ def setting_evaluate_style_d(font_style: str) -> str:
QPushButton:hover:!disabled {{ background: #a93226; }} QPushButton:hover:!disabled {{ background: #a93226; }}
QPushButton:disabled {{ background: #666666; color: #bbbbbb; }} QPushButton:disabled {{ background: #666666; color: #bbbbbb; }}
""" """
STOP_SIGN_STYLE = """
QPushButton {
background-color: #cc0000;
color: white;
font-weight: bold;
border: 2px solid #8b0000;
border-radius: 10px;
padding: 5px;
}
QPushButton:hover {
background-color: #ff0000;
border: 2px solid #cc0000;
}
QPushButton:pressed {
background-color: #8b0000;
}
"""