updated fonts, fixed edit profile errors
This commit is contained in:
parent
0fdbc78e24
commit
22245d7542
3 changed files with 147 additions and 117 deletions
256
gui/__main__.py
256
gui/__main__.py
|
@ -1,5 +1,5 @@
|
||||||
from PyQt6.QtWidgets import QComboBox,QButtonGroup, QLineEdit,QMainWindow, QLabel, QWidget, QVBoxLayout, QStackedWidget, QApplication, QPushButton, QTextEdit, QFrame, QHBoxLayout, QVBoxLayout, QScrollArea, QSystemTrayIcon, QMessageBox, QGridLayout, QCheckBox, QStackedLayout, QGroupBox, QDialog
|
from PyQt6.QtWidgets import QComboBox,QButtonGroup, QLineEdit,QMainWindow, QLabel, QWidget, QVBoxLayout, QStackedWidget, QApplication, QPushButton, QTextEdit, QFrame, QHBoxLayout, QVBoxLayout, QScrollArea, QSystemTrayIcon, QMessageBox, QGridLayout, QCheckBox, QStackedLayout, QGroupBox, QDialog
|
||||||
from PyQt6.QtGui import QIcon, QPixmap,QIcon, QPixmap, QTransform, QPainter, QColor, QFont, QPen
|
from PyQt6.QtGui import QIcon, QPixmap,QIcon, QPixmap, QTransform, QPainter, QColor, QFont, QFontDatabase
|
||||||
from PyQt6 import QtGui
|
from PyQt6 import QtGui
|
||||||
from PyQt6 import QtCore
|
from PyQt6 import QtCore
|
||||||
from PyQt6.QtCore import Qt,QSize,QThread,pyqtSignal, QTimer, QPointF, QRect, QMutex, QMutexLocker, QObject
|
from PyQt6.QtCore import Qt,QSize,QThread,pyqtSignal, QTimer, QPointF, QRect, QMutex, QMutexLocker, QObject
|
||||||
|
@ -232,6 +232,7 @@ class WorkerThread(QThread):
|
||||||
all_location_codes = [f"{location.country_code}_{location.code}" for location in locations]
|
all_location_codes = [f"{location.country_code}_{location.code}" for location in locations]
|
||||||
self.sync_output.emit(all_location_codes, True, False, locations, False)
|
self.sync_output.emit(all_location_codes, True, False, locations, False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
self.sync_output.emit([], False, False, [], False)
|
self.sync_output.emit([], False, False, [], False)
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,6 +297,20 @@ class CustomWindow(QMainWindow):
|
||||||
self.setWindowFlags(
|
self.setWindowFlags(
|
||||||
Qt.WindowType.Window
|
Qt.WindowType.Window
|
||||||
)
|
)
|
||||||
|
|
||||||
|
font_id = QFontDatabase.addApplicationFont('gui/resources/fonts/retro-gaming.ttf')
|
||||||
|
font_family = QFontDatabase.applicationFontFamilies(font_id)[0]
|
||||||
|
app_font = QFont(font_family)
|
||||||
|
app_font.setPointSize(10)
|
||||||
|
QApplication.setFont(app_font)
|
||||||
|
|
||||||
|
self.open_sans_family = None
|
||||||
|
open_sans_path = 'gui/resources/fonts/open-sans.ttf'
|
||||||
|
if os.path.exists(open_sans_path):
|
||||||
|
open_sans_id = QFontDatabase.addApplicationFont(open_sans_path)
|
||||||
|
if open_sans_id != -1:
|
||||||
|
self.open_sans_family = QFontDatabase.applicationFontFamilies(open_sans_id)[0]
|
||||||
|
|
||||||
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||||
self.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground)
|
self.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground)
|
||||||
self.setWindowTitle("HydraVeil VPN")
|
self.setWindowTitle("HydraVeil VPN")
|
||||||
|
@ -370,7 +385,7 @@ class CustomWindow(QMainWindow):
|
||||||
self.scroll_speed = 1
|
self.scroll_speed = 1
|
||||||
|
|
||||||
self.tor_text = QLabel("Billing & Browsers", self)
|
self.tor_text = QLabel("Billing & Browsers", self)
|
||||||
self.tor_text.setGeometry(522, 542, 150, 20)
|
self.tor_text.setGeometry(515, 542, 150, 20)
|
||||||
self.tor_text.setStyleSheet("""
|
self.tor_text.setStyleSheet("""
|
||||||
QLabel {
|
QLabel {
|
||||||
color: cyan;
|
color: cyan;
|
||||||
|
@ -1087,7 +1102,6 @@ class Worker(QObject):
|
||||||
except CommandNotFoundError as e :
|
except CommandNotFoundError as e :
|
||||||
self.update_signal.emit(str(e), False, -1, None, None)
|
self.update_signal.emit(str(e), False, -1, None, None)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('exception inside thread')
|
|
||||||
print(e)
|
print(e)
|
||||||
self.update_signal.emit("An unknown error occurred", False, None, None, None)
|
self.update_signal.emit("An unknown error occurred", False, None, None, None)
|
||||||
|
|
||||||
|
@ -1679,7 +1693,6 @@ class MenuPage(Page):
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(Settings)))
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(Settings)))
|
||||||
|
|
||||||
def eliminacion(self):
|
def eliminacion(self):
|
||||||
|
|
||||||
current_state = {
|
current_state = {
|
||||||
'is_tor_mode': self.is_tor_mode,
|
'is_tor_mode': self.is_tor_mode,
|
||||||
'is_animating': self.is_animating,
|
'is_animating': self.is_animating,
|
||||||
|
@ -2563,6 +2576,9 @@ class ProtocolPage(Page):
|
||||||
def go_selected(self):
|
def go_selected(self):
|
||||||
if self.selected_page_class:
|
if self.selected_page_class:
|
||||||
selected_page = self.selected_page_class
|
selected_page = self.selected_page_class
|
||||||
|
if selected_page == HidetorPage:
|
||||||
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(ResidentialPage)))
|
||||||
|
else:
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(selected_page)))
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(selected_page)))
|
||||||
|
|
||||||
self.display.clear()
|
self.display.clear()
|
||||||
|
@ -2760,7 +2776,6 @@ class HidetorPage(Page):
|
||||||
def update_swarp_json(self):
|
def update_swarp_json(self):
|
||||||
inserted_data = {
|
inserted_data = {
|
||||||
"location": self.selected_location_icon,
|
"location": self.selected_location_icon,
|
||||||
"connection": 'tor'
|
|
||||||
}
|
}
|
||||||
self.update_status.write_data(inserted_data)
|
self.update_status.write_data(inserted_data)
|
||||||
|
|
||||||
|
@ -2782,6 +2797,7 @@ class ResidentialPage(Page):
|
||||||
super().__init__("Wireguard", page_stack, main_window, parent)
|
super().__init__("Wireguard", page_stack, main_window, parent)
|
||||||
self.title.setGeometry(585, 40, 185, 40); self.title.setText("Pick a Protocol")
|
self.title.setGeometry(585, 40, 185, 40); self.title.setText("Pick a Protocol")
|
||||||
self.update_status = main_window
|
self.update_status = main_window
|
||||||
|
self.connection_choice = None
|
||||||
self.button_reverse.setVisible(True)
|
self.button_reverse.setVisible(True)
|
||||||
self.button_reverse.clicked.connect(self.reverse)
|
self.button_reverse.clicked.connect(self.reverse)
|
||||||
self.button_go.clicked.connect(self.go_selected)
|
self.button_go.clicked.connect(self.go_selected)
|
||||||
|
@ -2796,8 +2812,6 @@ class ResidentialPage(Page):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def showEvent(self, event):
|
def showEvent(self, event):
|
||||||
super().showEvent(event)
|
super().showEvent(event)
|
||||||
self.create_interface_elements()
|
self.create_interface_elements()
|
||||||
|
@ -2808,8 +2822,8 @@ class ResidentialPage(Page):
|
||||||
self.buttons = []
|
self.buttons = []
|
||||||
|
|
||||||
for j, (object_type, icon_name, page_class, geometry) in enumerate([
|
for j, (object_type, icon_name, page_class, geometry) in enumerate([
|
||||||
(QPushButton, "tor", TorPage, (585, 90, 185, 75)),
|
(QPushButton, "tor", self.set_connection_choice('tor'), (585, 90, 185, 75)),
|
||||||
(QPushButton, "just proxy", TorPage, (585, 90+30+75+30+75, 185, 75)),
|
(QPushButton, "just proxy", self.set_connection_choice('just proxy'), (585, 90+30+75+30+75, 185, 75)),
|
||||||
(QLabel, None, None, (570, 170, 210, 105)),
|
(QLabel, None, None, (570, 170, 210, 105)),
|
||||||
(QLabel, None, None, (570, 385, 210, 115))
|
(QLabel, None, None, (570, 385, 210, 115))
|
||||||
]):
|
]):
|
||||||
|
@ -2840,6 +2854,9 @@ class ResidentialPage(Page):
|
||||||
label.setText(text2)
|
label.setText(text2)
|
||||||
|
|
||||||
|
|
||||||
|
def set_connection_choice(self, connection_choice):
|
||||||
|
self.connection_choice = connection_choice
|
||||||
|
|
||||||
def show_residential(self, icon_name,page_class):
|
def show_residential(self, icon_name,page_class):
|
||||||
self.selected_page_class = page_class
|
self.selected_page_class = page_class
|
||||||
|
|
||||||
|
@ -2849,16 +2866,11 @@ class ResidentialPage(Page):
|
||||||
self.label.hide()
|
self.label.hide()
|
||||||
|
|
||||||
self.button_go.setVisible(True)
|
self.button_go.setVisible(True)
|
||||||
self.update_swarp_json(icon_name)
|
|
||||||
|
|
||||||
def go_selected(self):
|
def go_selected(self):
|
||||||
if self.selected_page_class:
|
self.update_swarp_json(self.connection_choice)
|
||||||
selected_page = self.selected_page_class
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(HidetorPage)))
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(selected_page)))
|
|
||||||
|
|
||||||
|
|
||||||
for boton in self.buttons:
|
|
||||||
boton.setChecked(False)
|
|
||||||
|
|
||||||
self.button_go.setVisible(False)
|
self.button_go.setVisible(False)
|
||||||
|
|
||||||
def update_swarp_json(self, icon_name):
|
def update_swarp_json(self, icon_name):
|
||||||
|
@ -2870,6 +2882,7 @@ class ResidentialPage(Page):
|
||||||
|
|
||||||
def reverse(self):
|
def reverse(self):
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(ProtocolPage)))
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(ProtocolPage)))
|
||||||
|
|
||||||
class TorPage(Page):
|
class TorPage(Page):
|
||||||
def __init__(self, page_stack, main_window, parent=None):
|
def __init__(self, page_stack, main_window, parent=None):
|
||||||
super().__init__("TorPage", page_stack, main_window, parent)
|
super().__init__("TorPage", page_stack, main_window, parent)
|
||||||
|
@ -2904,14 +2917,9 @@ class TorPage(Page):
|
||||||
self.data_profile = {}
|
self.data_profile = {}
|
||||||
profile = self.update_status.read_data()
|
profile = self.update_status.read_data()
|
||||||
profile_1 = profile.get('Profile_1')
|
profile_1 = profile.get('Profile_1')
|
||||||
self.data_profile['connection'] = profile_1.get('connection')
|
self.verificate()
|
||||||
for key, value in self.data_profile.items():
|
|
||||||
print(f"{key}: {value}")
|
|
||||||
|
|
||||||
|
def verificate(self, value= 'tor'):
|
||||||
self.verificate(value)
|
|
||||||
|
|
||||||
def verificate(self, value):
|
|
||||||
# Verificar el valor de key
|
# Verificar el valor de key
|
||||||
if value == "just proxy":
|
if value == "just proxy":
|
||||||
self.display0.show()
|
self.display0.show()
|
||||||
|
@ -2956,11 +2964,10 @@ class TorPage(Page):
|
||||||
self.update_status.write_data(inserted_data)
|
self.update_status.write_data(inserted_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def reverse_selected(self):
|
def reverse_selected(self):
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(ResidentialPage)))
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(ResidentialPage)))
|
||||||
def go_selected(self):
|
|
||||||
|
|
||||||
|
def go_selected(self):
|
||||||
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(BrowserPage)))
|
self.page_stack.setCurrentIndex(self.page_stack.indexOf(self.page_stack.findChild(BrowserPage)))
|
||||||
|
|
||||||
|
|
||||||
|
@ -3064,7 +3071,6 @@ class LocationPage(Page):
|
||||||
inserted_data = {
|
inserted_data = {
|
||||||
"location": self.selected_location_icon
|
"location": self.selected_location_icon
|
||||||
}
|
}
|
||||||
|
|
||||||
self.update_status.write_data(inserted_data)
|
self.update_status.write_data(inserted_data)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3583,19 +3589,16 @@ class ResumePage(Page):
|
||||||
else:
|
else:
|
||||||
application = ''
|
application = ''
|
||||||
|
|
||||||
print(profile.get('location'))
|
|
||||||
parts = profile.get('location').split('_')
|
parts = profile.get('location').split('_')
|
||||||
country_code = parts[0]
|
country_code = parts[0]
|
||||||
location_code = parts[1]
|
location_code = parts[1]
|
||||||
if profile.get('protocol') == 'wireguard':
|
if profile.get('protocol') == 'wireguard':
|
||||||
connection_type = 'wireguard'
|
connection_type = 'wireguard'
|
||||||
elif profile.get('protocol') == 'residential':
|
elif profile.get('protocol') == 'hidetor' or profile.get('protocol') == 'residential':
|
||||||
if profile.get('connection') == 'tor':
|
if profile.get('connection') == 'tor':
|
||||||
connection_type = 'tor'
|
connection_type = 'tor'
|
||||||
elif profile.get('connection') == 'just proxy':
|
elif profile.get('connection') == 'just proxy':
|
||||||
connection_type = 'system'
|
connection_type = 'system'
|
||||||
elif profile.get('protocol') == 'hidetor':
|
|
||||||
connection_type = 'tor'
|
|
||||||
else:
|
else:
|
||||||
self.update_status.update_status('Connection type not supported')
|
self.update_status.update_status('Connection type not supported')
|
||||||
return
|
return
|
||||||
|
@ -3609,7 +3612,6 @@ class ResumePage(Page):
|
||||||
'connection_type': connection_type,
|
'connection_type': connection_type,
|
||||||
'resolution': profile.get('dimentions', ''),
|
'resolution': profile.get('dimentions', ''),
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_type = 'system' if profile.get('connection') == 'system-wide' else 'session'
|
profile_type = 'system' if profile.get('connection') == 'system-wide' else 'session'
|
||||||
action = f'CREATE_{profile_type.upper()}_PROFILE'
|
action = f'CREATE_{profile_type.upper()}_PROFILE'
|
||||||
|
|
||||||
|
@ -3664,6 +3666,10 @@ class EditorPage(Page):
|
||||||
self.button_apply.clicked.connect(self.go_selected)
|
self.button_apply.clicked.connect(self.go_selected)
|
||||||
|
|
||||||
self.button_back.setVisible(True)
|
self.button_back.setVisible(True)
|
||||||
|
try:
|
||||||
|
self.button_back.clicked.disconnect()
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
self.button_back.clicked.connect(self.go_back)
|
self.button_back.clicked.connect(self.go_back)
|
||||||
|
|
||||||
self.name_handle = QLabel(self)
|
self.name_handle = QLabel(self)
|
||||||
|
@ -3671,7 +3677,7 @@ class EditorPage(Page):
|
||||||
self.name_handle.setText("Profile Name:")
|
self.name_handle.setText("Profile Name:")
|
||||||
|
|
||||||
self.name = QLineEdit(self)
|
self.name = QLineEdit(self)
|
||||||
self.name.setGeometry(250, 68, 400, 30)
|
self.name.setGeometry(275, 70, 400, 30)
|
||||||
|
|
||||||
self.name.setStyleSheet("border: transparent;")
|
self.name.setStyleSheet("border: transparent;")
|
||||||
|
|
||||||
|
@ -4111,6 +4117,8 @@ class EditorPage(Page):
|
||||||
class Settings(Page):
|
class Settings(Page):
|
||||||
def __init__(self, page_stack, main_window, parent=None):
|
def __init__(self, page_stack, main_window, parent=None):
|
||||||
super().__init__("Settings", page_stack, main_window, parent)
|
super().__init__("Settings", page_stack, main_window, parent)
|
||||||
|
self.font_style = f"font-family: '{self.custom_window.open_sans_family}';"
|
||||||
|
|
||||||
self.update_status = main_window
|
self.update_status = main_window
|
||||||
self.update_logging = main_window
|
self.update_logging = main_window
|
||||||
self.button_reverse.setVisible(True)
|
self.button_reverse.setVisible(True)
|
||||||
|
@ -4150,6 +4158,8 @@ class Settings(Page):
|
||||||
("Error Logs", self.show_logs_page)
|
("Error Logs", self.show_logs_page)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.menu_buttons = []
|
self.menu_buttons = []
|
||||||
for text, callback in menu_items:
|
for text, callback in menu_items:
|
||||||
btn = QPushButton(text)
|
btn = QPushButton(text)
|
||||||
|
@ -4158,22 +4168,24 @@ class Settings(Page):
|
||||||
btn.setCheckable(True)
|
btn.setCheckable(True)
|
||||||
btn.clicked.connect(callback)
|
btn.clicked.connect(callback)
|
||||||
|
|
||||||
btn.setStyleSheet("""
|
btn.setStyleSheet(f"""
|
||||||
QPushButton {
|
QPushButton {{
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: #808080;
|
color: #808080;
|
||||||
}
|
font-size: 15px;
|
||||||
QPushButton:checked {
|
{self.font_style}
|
||||||
|
}}
|
||||||
|
QPushButton:checked {{
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: rgba(255, 255, 255, 0.1);
|
||||||
color: white;
|
color: white;
|
||||||
border-left: 3px solid #007AFF;
|
border-left: 3px solid #007AFF;
|
||||||
}
|
}}
|
||||||
QPushButton:hover:!checked {
|
QPushButton:hover:!checked {{
|
||||||
background: rgba(255, 255, 255, 0.05);
|
background: rgba(255, 255, 255, 0.05);
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
|
|
||||||
self.left_layout.addWidget(btn)
|
self.left_layout.addWidget(btn)
|
||||||
|
@ -4202,7 +4214,7 @@ class Settings(Page):
|
||||||
layout.setSpacing(15)
|
layout.setSpacing(15)
|
||||||
|
|
||||||
title = QLabel("DELETE PROFILE")
|
title = QLabel("DELETE PROFILE")
|
||||||
title.setStyleSheet("color: #808080; font-size: 12px; font-weight: bold;")
|
title.setStyleSheet(f"color: #808080; font-size: 12px; font-weight: bold; {self.font_style}")
|
||||||
layout.addWidget(title)
|
layout.addWidget(title)
|
||||||
|
|
||||||
grid = QGridLayout()
|
grid = QGridLayout()
|
||||||
|
@ -4222,21 +4234,22 @@ class Settings(Page):
|
||||||
btn = QPushButton(f"Profile {profile_id}\n{profile.name}")
|
btn = QPushButton(f"Profile {profile_id}\n{profile.name}")
|
||||||
btn.setCheckable(True)
|
btn.setCheckable(True)
|
||||||
btn.setFixedSize(180, 60)
|
btn.setFixedSize(180, 60)
|
||||||
btn.setStyleSheet("""
|
btn.setStyleSheet(f"""
|
||||||
QPushButton {
|
QPushButton {{
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: rgba(255, 255, 255, 0.1);
|
||||||
border: none;
|
border: none;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
{self.font_style}
|
||||||
QPushButton:checked {
|
}}
|
||||||
|
QPushButton:checked {{
|
||||||
background: rgba(255, 255, 255, 0.3);
|
background: rgba(255, 255, 255, 0.3);
|
||||||
border: 2px solid #007AFF;
|
border: 2px solid #007AFF;
|
||||||
}
|
}}
|
||||||
QPushButton:hover:!checked {
|
QPushButton:hover:!checked {{
|
||||||
background: rgba(255, 255, 255, 0.2);
|
background: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
self.profile_buttons.addButton(btn, profile_id)
|
self.profile_buttons.addButton(btn, profile_id)
|
||||||
else:
|
else:
|
||||||
|
@ -4250,23 +4263,23 @@ class Settings(Page):
|
||||||
self.delete_button = QPushButton("Delete")
|
self.delete_button = QPushButton("Delete")
|
||||||
self.delete_button.setEnabled(False)
|
self.delete_button.setEnabled(False)
|
||||||
self.delete_button.setFixedSize(120, 40)
|
self.delete_button.setFixedSize(120, 40)
|
||||||
self.delete_button.setStyleSheet("""
|
self.delete_button.setStyleSheet(f"""
|
||||||
QPushButton {
|
QPushButton {{
|
||||||
background: #ff4d4d;
|
background: #ff4d4d;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
{self.font_style}
|
||||||
QPushButton:disabled {
|
}}
|
||||||
|
QPushButton:disabled {{
|
||||||
background: #666666;
|
background: #666666;
|
||||||
}
|
}}
|
||||||
QPushButton:hover:!disabled {
|
QPushButton:hover:!disabled {{
|
||||||
background: #ff3333;
|
background: #ff3333;
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
self.delete_button.clicked.connect(self.delete_selected_profile)
|
self.delete_button.clicked.connect(self.delete_selected_profile)
|
||||||
|
|
||||||
self.profile_buttons.buttonClicked.connect(self.on_profile_selected)
|
self.profile_buttons.buttonClicked.connect(self.on_profile_selected)
|
||||||
|
|
||||||
button_layout = QHBoxLayout()
|
button_layout = QHBoxLayout()
|
||||||
|
@ -4313,8 +4326,8 @@ class Settings(Page):
|
||||||
|
|
||||||
|
|
||||||
def get_combobox_style(self) -> str:
|
def get_combobox_style(self) -> str:
|
||||||
return """
|
return f"""
|
||||||
QComboBox {
|
QComboBox {{
|
||||||
color: black;
|
color: black;
|
||||||
background: #f0f0f0;
|
background: #f0f0f0;
|
||||||
padding: 5px 30px 5px 10px;
|
padding: 5px 30px 5px 10px;
|
||||||
|
@ -4322,41 +4335,44 @@ class Settings(Page):
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
min-width: 120px;
|
min-width: 120px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
{self.font_style}
|
||||||
QComboBox:disabled {
|
}}
|
||||||
|
QComboBox:disabled {{
|
||||||
color: #666;
|
color: #666;
|
||||||
background: #e0e0e0;
|
background: #e0e0e0;
|
||||||
}
|
}}
|
||||||
QComboBox::drop-down {
|
QComboBox::drop-down {{
|
||||||
border: none;
|
border: none;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}}
|
||||||
QComboBox::down-arrow {
|
QComboBox::down-arrow {{
|
||||||
image: url(assets/down_arrow.png);
|
image: url(assets/down_arrow.png);
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
}
|
}}
|
||||||
QComboBox QAbstractItemView {
|
QComboBox QAbstractItemView {{
|
||||||
color: black;
|
color: black;
|
||||||
background: white;
|
background: white;
|
||||||
selection-background-color: #007bff;
|
selection-background-color: #007bff;
|
||||||
selection-color: white;
|
selection-color: white;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
}
|
{self.font_style}
|
||||||
|
}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_checkbox_style(self) -> str:
|
def get_checkbox_style(self) -> str:
|
||||||
return """
|
return f"""
|
||||||
QCheckBox {
|
QCheckBox {{
|
||||||
color: white;
|
color: white;
|
||||||
spacing: 10px;
|
spacing: 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
{self.font_style}
|
||||||
QCheckBox::indicator {
|
}}
|
||||||
|
QCheckBox::indicator {{
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def populate_wireguard_profiles(self) -> None:
|
def populate_wireguard_profiles(self) -> None:
|
||||||
|
@ -4423,24 +4439,25 @@ class Settings(Page):
|
||||||
layout.setContentsMargins(20, 20, 20, 20)
|
layout.setContentsMargins(20, 20, 20, 20)
|
||||||
|
|
||||||
title = QLabel("Subscription Info")
|
title = QLabel("Subscription Info")
|
||||||
title.setStyleSheet("color: #808080; font-size: 12px; font-weight: bold;")
|
title.setStyleSheet(f"color: #808080; font-size: 12px; font-weight: bold; {self.font_style}")
|
||||||
layout.addWidget(title)
|
layout.addWidget(title)
|
||||||
|
|
||||||
profile_group = QGroupBox("Profile Selection")
|
profile_group = QGroupBox("Profile Selection")
|
||||||
profile_group.setStyleSheet("""
|
profile_group.setStyleSheet(f"""
|
||||||
QGroupBox {
|
QGroupBox {{
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
{self.font_style}
|
||||||
QGroupBox::title {
|
}}
|
||||||
|
QGroupBox::title {{
|
||||||
subcontrol-origin: margin;
|
subcontrol-origin: margin;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
profile_layout = QVBoxLayout(profile_group)
|
profile_layout = QVBoxLayout(profile_group)
|
||||||
|
|
||||||
|
@ -4454,20 +4471,21 @@ class Settings(Page):
|
||||||
layout.addWidget(profile_group)
|
layout.addWidget(profile_group)
|
||||||
|
|
||||||
subscription_group = QGroupBox("Subscription Details")
|
subscription_group = QGroupBox("Subscription Details")
|
||||||
subscription_group.setStyleSheet("""
|
subscription_group.setStyleSheet(f"""
|
||||||
QGroupBox {
|
QGroupBox {{
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
{self.font_style}
|
||||||
QGroupBox::title {
|
}}
|
||||||
|
QGroupBox::title {{
|
||||||
subcontrol-origin: margin;
|
subcontrol-origin: margin;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
subscription_layout = QGridLayout(subscription_group)
|
subscription_layout = QGridLayout(subscription_group)
|
||||||
subscription_layout.setSpacing(10)
|
subscription_layout.setSpacing(10)
|
||||||
|
@ -4490,7 +4508,7 @@ class Settings(Page):
|
||||||
|
|
||||||
value_label = ClickableValueLabel("N/A", stat_widget)
|
value_label = ClickableValueLabel("N/A", stat_widget)
|
||||||
value_label.setObjectName("value_label")
|
value_label.setObjectName("value_label")
|
||||||
value_label.setStyleSheet("color: #00ffff; font-size: 13px; font-weight: bold;")
|
value_label.setStyleSheet(f"color: #00ffff; font-size: 13px; font-weight: bold; {self.font_style}")
|
||||||
value_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
value_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
stat_widget.layout().insertWidget(0, value_label)
|
stat_widget.layout().insertWidget(0, value_label)
|
||||||
|
|
||||||
|
@ -4565,19 +4583,19 @@ class Settings(Page):
|
||||||
layout.setContentsMargins(20, 20, 20, 20)
|
layout.setContentsMargins(20, 20, 20, 20)
|
||||||
|
|
||||||
title = QLabel("Account Overview")
|
title = QLabel("Account Overview")
|
||||||
title.setStyleSheet("color: #808080; font-size: 12px; font-weight: bold;")
|
title.setStyleSheet(f"color: #808080; font-size: 12px; font-weight: bold; {self.font_style}")
|
||||||
layout.addWidget(title)
|
layout.addWidget(title)
|
||||||
|
|
||||||
scroll_area = QScrollArea()
|
scroll_area = QScrollArea()
|
||||||
scroll_area.setWidgetResizable(True)
|
scroll_area.setWidgetResizable(True)
|
||||||
scroll_area.setStyleSheet("""
|
scroll_area.setStyleSheet(f"""
|
||||||
QScrollArea {
|
QScrollArea {{
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}}
|
||||||
QScrollArea > QWidget > QWidget {
|
QScrollArea > QWidget > QWidget {{
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
|
|
||||||
scroll_content = QWidget()
|
scroll_content = QWidget()
|
||||||
|
@ -4591,20 +4609,21 @@ class Settings(Page):
|
||||||
|
|
||||||
for section_title, content_widget in info_sections:
|
for section_title, content_widget in info_sections:
|
||||||
group = QGroupBox(section_title)
|
group = QGroupBox(section_title)
|
||||||
group.setStyleSheet("""
|
group.setStyleSheet(f"""
|
||||||
QGroupBox {
|
QGroupBox {{
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
{self.font_style}
|
||||||
QGroupBox::title {
|
}}
|
||||||
|
QGroupBox::title {{
|
||||||
subcontrol-origin: margin;
|
subcontrol-origin: margin;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}}
|
||||||
""")
|
""")
|
||||||
group_layout = QVBoxLayout(group)
|
group_layout = QVBoxLayout(group)
|
||||||
group_layout.addWidget(content_widget)
|
group_layout.addWidget(content_widget)
|
||||||
|
@ -4659,7 +4678,7 @@ class Settings(Page):
|
||||||
|
|
||||||
for i, (label, value) in enumerate(stats):
|
for i, (label, value) in enumerate(stats):
|
||||||
info_widget = QLabel(f"{label}: {value}")
|
info_widget = QLabel(f"{label}: {value}")
|
||||||
info_widget.setStyleSheet("color: white; padding: 5px;")
|
info_widget.setStyleSheet(f"color: white; padding: 5px; {self.font_style}")
|
||||||
info_widget.setWordWrap(True)
|
info_widget.setWordWrap(True)
|
||||||
layout.addWidget(info_widget, i, 0)
|
layout.addWidget(info_widget, i, 0)
|
||||||
|
|
||||||
|
@ -4667,22 +4686,23 @@ class Settings(Page):
|
||||||
|
|
||||||
def create_stat_widget(self, label, value):
|
def create_stat_widget(self, label, value):
|
||||||
widget = QFrame()
|
widget = QFrame()
|
||||||
widget.setStyleSheet("""
|
widget.setStyleSheet(f"""
|
||||||
QFrame {
|
QFrame {{
|
||||||
background: rgba(255, 255, 255, 0.05);
|
background: rgba(255, 255, 255, 0.05);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
{self.font_style}
|
||||||
|
}}
|
||||||
""")
|
""")
|
||||||
layout = QVBoxLayout(widget)
|
layout = QVBoxLayout(widget)
|
||||||
|
|
||||||
value_label = QLabel(str(value))
|
value_label = QLabel(str(value))
|
||||||
value_label.setObjectName("value_label")
|
value_label.setObjectName("value_label")
|
||||||
value_label.setStyleSheet("color: #00ffff; font-size: 24px; font-weight: bold;")
|
value_label.setStyleSheet("color: #00ffff; font-size: 24px; font-weight: bold")
|
||||||
value_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
value_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
|
|
||||||
desc_label = QLabel(label)
|
desc_label = QLabel(label)
|
||||||
desc_label.setStyleSheet("color: white; font-size: 12px;")
|
desc_label.setStyleSheet(f"color: white; font-size: 12px; {self.font_style}")
|
||||||
desc_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
desc_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
|
|
||||||
layout.addWidget(value_label)
|
layout.addWidget(value_label)
|
||||||
|
@ -4695,7 +4715,7 @@ class Settings(Page):
|
||||||
layout.setContentsMargins(0, 5, 0, 5)
|
layout.setContentsMargins(0, 5, 0, 5)
|
||||||
|
|
||||||
text_label = QLabel(f"{label}")
|
text_label = QLabel(f"{label}")
|
||||||
text_label.setStyleSheet("color: white; font-size: 12px;")
|
text_label.setStyleSheet(f"color: white; font-size: 12px; {self.font_style}")
|
||||||
text_label.setFixedWidth(100)
|
text_label.setFixedWidth(100)
|
||||||
|
|
||||||
progress = QFrame()
|
progress = QFrame()
|
||||||
|
@ -4709,7 +4729,7 @@ class Settings(Page):
|
||||||
progress.setFixedSize(int(200 * (percentage / 100)), 20)
|
progress.setFixedSize(int(200 * (percentage / 100)), 20)
|
||||||
|
|
||||||
value_label = QLabel(f"{value} ({percentage:.1f}%)")
|
value_label = QLabel(f"{value} ({percentage:.1f}%)")
|
||||||
value_label.setStyleSheet("color: white; font-size: 12px;")
|
value_label.setStyleSheet(f"color: white; font-size: 12px; {self.font_style}")
|
||||||
value_label.setAlignment(Qt.AlignmentFlag.AlignRight)
|
value_label.setAlignment(Qt.AlignmentFlag.AlignRight)
|
||||||
|
|
||||||
progress_container = QFrame()
|
progress_container = QFrame()
|
||||||
|
@ -4752,15 +4772,15 @@ class Settings(Page):
|
||||||
layout.setContentsMargins(20, 20, 20, 20)
|
layout.setContentsMargins(20, 20, 20, 20)
|
||||||
|
|
||||||
title = QLabel("LOGGING SETTINGS")
|
title = QLabel("LOGGING SETTINGS")
|
||||||
title.setStyleSheet("color: #808080; font-size: 12px; font-weight: bold;")
|
title.setStyleSheet(f"color: #808080; font-size: 12px; font-weight: bold; {self.font_style}")
|
||||||
layout.addWidget(title)
|
layout.addWidget(title)
|
||||||
|
|
||||||
log_text = QLabel(f"If enabled, these Error Logs would be stored locally on your computer\nat {Constants.HV_DATA_HOME}/gui")
|
log_text = QLabel(f"If enabled, these Error Logs would be stored locally on your computer\nat {Constants.HV_DATA_HOME}/gui")
|
||||||
log_text.setStyleSheet("color: white; font-size: 14px;")
|
log_text.setStyleSheet(f"color: white; font-size: 14px; {self.font_style}")
|
||||||
layout.addWidget(log_text)
|
layout.addWidget(log_text)
|
||||||
|
|
||||||
logs_group = QGroupBox("Log Configuration")
|
logs_group = QGroupBox("Log Configuration")
|
||||||
logs_group.setStyleSheet("QGroupBox { color: white; padding: 15px; }")
|
logs_group.setStyleSheet(f"QGroupBox {{ color: white; padding: 15px; {self.font_style} }}")
|
||||||
logs_layout = QVBoxLayout(logs_group)
|
logs_layout = QVBoxLayout(logs_group)
|
||||||
|
|
||||||
self.enable_gui_logging = QCheckBox("Enable GUI logging")
|
self.enable_gui_logging = QCheckBox("Enable GUI logging")
|
||||||
|
@ -4975,7 +4995,6 @@ class PaymentPage(Page):
|
||||||
self.on_request_invoice()
|
self.on_request_invoice()
|
||||||
|
|
||||||
def on_request_invoice(self):
|
def on_request_invoice(self):
|
||||||
raise UnknownConnectionTypeError('The connection type is unknown')
|
|
||||||
total_hours = self.fetch_invoice_duration()
|
total_hours = self.fetch_invoice_duration()
|
||||||
selected_currency = self.get_selected_currency()
|
selected_currency = self.get_selected_currency()
|
||||||
if selected_currency is None:
|
if selected_currency is None:
|
||||||
|
@ -5612,16 +5631,26 @@ class SyncScreen(Page):
|
||||||
|
|
||||||
|
|
||||||
self.heading_label = QLabel("You're about to fetch data from\nSimplified Privacy.", self)
|
self.heading_label = QLabel("You're about to fetch data from\nSimplified Privacy.", self)
|
||||||
self.heading_label.setGeometry(15, 80, 750, 100)
|
self.heading_label.setGeometry(15, 80, 750, 120)
|
||||||
self.heading_label.setStyleSheet("font-size: 36px; font-weight: bold; color: white;")
|
font_style = "font-size: 34px; font-weight: bold; color: white;"
|
||||||
|
if self.custom_window.open_sans_family:
|
||||||
|
print('open sans found')
|
||||||
|
font_style += f" font-family: '{self.custom_window.open_sans_family}';"
|
||||||
|
self.heading_label.setStyleSheet(font_style)
|
||||||
|
|
||||||
self.data_description = QLabel("This data includes what plans, countries,\nbrowsers, and version upgrades are\navailable. As well as coordinating billing.", self)
|
self.data_description = QLabel("This data includes what plans, countries,\nbrowsers, and version upgrades are\navailable. As well as coordinating billing.", self)
|
||||||
self.data_description.setGeometry(22, 190, 750, 100)
|
self.data_description.setGeometry(22, 190, 750, 120)
|
||||||
self.data_description.setStyleSheet("font-size: 26px; font-weight: bold; color: #ffff00;")
|
font_style = "font-size: 24px; font-weight: bold; color: #ffff00;"
|
||||||
|
if self.custom_window.open_sans_family:
|
||||||
|
font_style += f" font-family: '{self.custom_window.open_sans_family}';"
|
||||||
|
self.data_description.setStyleSheet(font_style)
|
||||||
|
|
||||||
self.instructions = QLabel("Use the toggle in the bottom right to\ndecide if you want to use Tor or not.\nThen hit \"Next\"", self)
|
self.instructions = QLabel("Use the toggle in the bottom right to\ndecide if you want to use Tor or not.\nThen hit \"Next\"", self)
|
||||||
self.instructions.setGeometry(22, 345, 750, 120)
|
self.instructions.setGeometry(22, 345, 750, 120)
|
||||||
self.instructions.setStyleSheet("font-size: 30px; font-weight: bold; color: white;")
|
font_style = "font-size: 28px; font-weight: bold; color: white;"
|
||||||
|
if self.custom_window.open_sans_family:
|
||||||
|
font_style += f" font-family: '{self.custom_window.open_sans_family}';"
|
||||||
|
self.instructions.setStyleSheet(font_style)
|
||||||
|
|
||||||
self.arrow_label = QLabel(self)
|
self.arrow_label = QLabel(self)
|
||||||
self.arrow_label.setGeometry(520, 400, 180, 130)
|
self.arrow_label.setGeometry(520, 400, 180, 130)
|
||||||
|
@ -5852,3 +5881,4 @@ if __name__ == "__main__":
|
||||||
window.show()
|
window.show()
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
gui/resources/fonts/open-sans.ttf
Normal file
BIN
gui/resources/fonts/open-sans.ttf
Normal file
Binary file not shown.
BIN
gui/resources/fonts/retro-gaming.ttf
Normal file
BIN
gui/resources/fonts/retro-gaming.ttf
Normal file
Binary file not shown.
Loading…
Reference in a new issue