Compare commits
No commits in common. "98d0b0f473fcd45251abeb7381fa4ebf50fe9da5" and "0fac5a2d99f2702c2e0dfca0628ee7836c117f1e" have entirely different histories.
98d0b0f473
...
0fac5a2d99
4 changed files with 97 additions and 155 deletions
250
gui/__main__.py
250
gui/__main__.py
|
|
@ -2020,56 +2020,10 @@ class MenuPage(Page):
|
||||||
is_profile_enabled = self.connection_manager.is_profile_connected(
|
is_profile_enabled = self.connection_manager.is_profile_connected(
|
||||||
self.reverse_id)
|
self.reverse_id)
|
||||||
show_verification_widget = False
|
show_verification_widget = False
|
||||||
label_principal = None
|
|
||||||
label_tor = None
|
|
||||||
text_color = "white"
|
|
||||||
operator_name = profile_obj.location.operator.name if profile_obj.location and profile_obj.location.operator else ""
|
|
||||||
|
|
||||||
if operator_name != 'Simplified Privacy':
|
if protocol.lower() in ["wireguard", "open", "lokinet", "residential", "hidetor"]:
|
||||||
if profile_obj.is_session_profile():
|
|
||||||
text_color = "black"
|
|
||||||
label_background = QLabel(self)
|
|
||||||
label_background.setGeometry(0, 60, 410, 354)
|
|
||||||
pixmap_bg = QPixmap(os.path.join(
|
|
||||||
self.btn_path, "browser only.png"))
|
|
||||||
label_background.setPixmap(pixmap_bg)
|
|
||||||
label_background.setScaledContents(True)
|
|
||||||
label_background.show()
|
|
||||||
label_background.lower()
|
|
||||||
self.additional_labels.append(label_background)
|
|
||||||
|
|
||||||
l_img = QLabel(self)
|
|
||||||
l_img.setGeometry(20, 125, 100, 100)
|
|
||||||
pixmap_loc = QPixmap(os.path.join(
|
|
||||||
self.btn_path, f"icon_{location}.png"))
|
|
||||||
l_img.setPixmap(pixmap_loc)
|
|
||||||
l_img.setScaledContents(True)
|
|
||||||
l_img.show()
|
|
||||||
self.additional_labels.append(l_img)
|
|
||||||
l_name = f"{profile_obj.location.country_name}, {profile_obj.location.name}" if profile_obj.location else ""
|
|
||||||
o_name = profile_obj.location.operator.name if profile_obj.location and profile_obj.location.operator else ""
|
|
||||||
n_key = profile_obj.location.operator.nostr_public_key if profile_obj.location and profile_obj.location.operator else ""
|
|
||||||
|
|
||||||
info_txt = QTextEdit(self)
|
|
||||||
info_txt.setGeometry(130, 110, 260, 250)
|
|
||||||
info_txt.setReadOnly(True)
|
|
||||||
info_txt.setFrameStyle(QFrame.Shape.NoFrame)
|
|
||||||
info_txt.setStyleSheet(
|
|
||||||
f"background: transparent; border: none; color: {text_color}; font-size: 15px;")
|
|
||||||
info_txt.setVerticalScrollBarPolicy(
|
|
||||||
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
|
||||||
info_txt.setHorizontalScrollBarPolicy(
|
|
||||||
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
|
||||||
info_txt.setWordWrapMode(
|
|
||||||
QtGui.QTextOption.WrapMode.WrapAnywhere)
|
|
||||||
info_txt.setText(
|
|
||||||
f"Location: {l_name}\n\nOperator: {o_name}\n\nNostr: {n_key}")
|
|
||||||
info_txt.show()
|
|
||||||
|
|
||||||
self.additional_labels.append(info_txt)
|
|
||||||
|
|
||||||
elif protocol.lower() in ["wireguard", "open", "lokinet", "residential", "hidetor"]:
|
|
||||||
|
|
||||||
|
label_principal = None
|
||||||
if protocol.lower() == "wireguard" and is_profile_enabled and profile_obj and profile_obj.connection and profile_obj.connection.code == 'wireguard':
|
if protocol.lower() == "wireguard" and is_profile_enabled and profile_obj and profile_obj.connection and profile_obj.connection.code == 'wireguard':
|
||||||
verification_widget = self.create_verification_widget(
|
verification_widget = self.create_verification_widget(
|
||||||
profile_obj)
|
profile_obj)
|
||||||
|
|
@ -2086,7 +2040,7 @@ class MenuPage(Page):
|
||||||
label_principal.show()
|
label_principal.show()
|
||||||
self.additional_labels.append(label_principal)
|
self.additional_labels.append(label_principal)
|
||||||
|
|
||||||
if protocol.lower() == "wireguard" and ConfigurationController.get_endpoint_verification_enabled() and operator_name == 'Simplified Privacy':
|
if protocol.lower() == "wireguard" and ConfigurationController.get_endpoint_verification_enabled():
|
||||||
if is_profile_enabled and profile_obj and profile_obj.connection and profile_obj.connection.code == 'wireguard':
|
if is_profile_enabled and profile_obj and profile_obj.connection and profile_obj.connection.code == 'wireguard':
|
||||||
verified_icon = QLabel(self)
|
verified_icon = QLabel(self)
|
||||||
verified_icon.setGeometry(20, 50, 100, 80)
|
verified_icon.setGeometry(20, 50, 100, 80)
|
||||||
|
|
@ -2097,94 +2051,91 @@ class MenuPage(Page):
|
||||||
verified_icon.show()
|
verified_icon.show()
|
||||||
self.additional_labels.append(verified_icon)
|
self.additional_labels.append(verified_icon)
|
||||||
|
|
||||||
if operator_name == 'Simplified Privacy':
|
if protocol.lower() == "hidetor" and not show_verification_widget:
|
||||||
if protocol.lower() == "hidetor" and not show_verification_widget:
|
|
||||||
|
|
||||||
if label_principal:
|
if label_principal:
|
||||||
label_principal.setGeometry(0, 80, 400, 300)
|
label_principal.setGeometry(0, 80, 400, 300)
|
||||||
label_background = QLabel(self)
|
label_background = QLabel(self)
|
||||||
label_background.setGeometry(0, 60, 410, 354)
|
label_background.setGeometry(0, 60, 410, 354)
|
||||||
if connection == 'just proxy':
|
if connection == 'just proxy':
|
||||||
image_path = os.path.join(
|
image_path = os.path.join(
|
||||||
self.btn_path, f"icon_{location}.png")
|
self.btn_path, f"icon_{location}.png")
|
||||||
else:
|
else:
|
||||||
image_path = os.path.join(
|
image_path = os.path.join(
|
||||||
self.btn_path, f"hdtor_{location}.png")
|
self.btn_path, f"hdtor_{location}.png")
|
||||||
pixmap = QPixmap(image_path)
|
pixmap = QPixmap(image_path)
|
||||||
label_background.setPixmap(pixmap)
|
label_background.setPixmap(pixmap)
|
||||||
label_background.show()
|
label_background.show()
|
||||||
label_background.setScaledContents(True)
|
label_background.setScaledContents(True)
|
||||||
label_background.lower()
|
label_background.lower()
|
||||||
self.additional_labels.append(label_background)
|
self.additional_labels.append(label_background)
|
||||||
|
|
||||||
if protocol.lower() == "wireguard" and connection.lower() == "browser-only" and not show_verification_widget:
|
if protocol.lower() == "wireguard" and connection.lower() == "browser-only" and not show_verification_widget:
|
||||||
|
|
||||||
if label_principal:
|
if label_principal:
|
||||||
label_principal.setGeometry(0, 80, 400, 300)
|
label_principal.setGeometry(0, 80, 400, 300)
|
||||||
|
|
||||||
label_background = QLabel(self)
|
label_background = QLabel(self)
|
||||||
label_background.setGeometry(0, 60, 410, 354)
|
label_background.setGeometry(0, 60, 410, 354)
|
||||||
is_supported = profile.get('browser_supported', False)
|
is_supported = profile.get('browser_supported', False)
|
||||||
image_name = "browser only.png" if is_supported else "unsupported_browser_only.png"
|
image_name = "browser only.png" if is_supported else "unsupported_browser_only.png"
|
||||||
pixmap = QPixmap(os.path.join(self.btn_path, image_name))
|
pixmap = QPixmap(os.path.join(self.btn_path, image_name))
|
||||||
label_background.setPixmap(pixmap)
|
label_background.setPixmap(pixmap)
|
||||||
label_background.show()
|
label_background.show()
|
||||||
label_background.setScaledContents(True)
|
label_background.setScaledContents(True)
|
||||||
label_background.lower()
|
label_background.lower()
|
||||||
self.additional_labels.append(label_background)
|
self.additional_labels.append(label_background)
|
||||||
|
|
||||||
if protocol.lower() == "residential" and connection.lower() == "tor":
|
if protocol.lower() == "residential" and connection.lower() == "tor":
|
||||||
|
|
||||||
label_background = QLabel(self)
|
label_background = QLabel(self)
|
||||||
label_background.setGeometry(0, 60, 410, 354)
|
label_background.setGeometry(0, 60, 410, 354)
|
||||||
pixmap = QPixmap(os.path.join(
|
pixmap = QPixmap(os.path.join(
|
||||||
self.btn_path, "browser_tor.png"))
|
self.btn_path, "browser_tor.png"))
|
||||||
label_background.setPixmap(pixmap)
|
label_background.setPixmap(pixmap)
|
||||||
label_background.show()
|
label_background.show()
|
||||||
label_background.setScaledContents(True)
|
label_background.setScaledContents(True)
|
||||||
# label_background.setStyleSheet("background-color: blue;")
|
# label_background.setStyleSheet("background-color: blue;")
|
||||||
self.additional_labels.append(label_background)
|
self.additional_labels.append(label_background)
|
||||||
|
|
||||||
label_garaje = QLabel(self)
|
label_garaje = QLabel(self)
|
||||||
label_garaje.setGeometry(5, 110, 400, 300)
|
label_garaje.setGeometry(5, 110, 400, 300)
|
||||||
pixmap = QPixmap(os.path.join(
|
pixmap = QPixmap(os.path.join(
|
||||||
self.btn_path, f"{country_garaje} garaje.png"))
|
self.btn_path, f"{country_garaje} garaje.png"))
|
||||||
label_garaje.setPixmap(pixmap)
|
label_garaje.setPixmap(pixmap)
|
||||||
label_garaje.show()
|
label_garaje.show()
|
||||||
label_garaje.setScaledContents(True)
|
label_garaje.setScaledContents(True)
|
||||||
# label_garaje.setStyleSheet("background-color: red;")
|
# label_garaje.setStyleSheet("background-color: red;")
|
||||||
self.additional_labels.append(label_garaje)
|
self.additional_labels.append(label_garaje)
|
||||||
|
|
||||||
label_tor = QLabel(self)
|
|
||||||
label_tor.setGeometry(330, 300, 75, 113)
|
|
||||||
|
|
||||||
|
label_tor = QLabel(self)
|
||||||
|
label_tor.setGeometry(330, 300, 75, 113)
|
||||||
pixmap = QPixmap(os.path.join(self.btn_path, "tor 86x130.png"))
|
pixmap = QPixmap(os.path.join(self.btn_path, "tor 86x130.png"))
|
||||||
if label_tor:
|
label_tor.setPixmap(pixmap)
|
||||||
label_tor.setPixmap(pixmap)
|
label_tor.show()
|
||||||
label_tor.show()
|
label_tor.setScaledContents(True)
|
||||||
label_tor.setScaledContents(True)
|
self.additional_labels.append(label_tor)
|
||||||
self.additional_labels.append(label_tor)
|
if protocol.lower() == "residential" and connection.lower() == "just proxy":
|
||||||
if protocol.lower() == "residential" and connection.lower() == "just proxy":
|
|
||||||
|
|
||||||
label_background = QLabel(self)
|
label_background = QLabel(self)
|
||||||
label_background.setGeometry(0, 60, 410, 354)
|
label_background.setGeometry(0, 60, 410, 354)
|
||||||
pixmap = QPixmap(os.path.join(
|
pixmap = QPixmap(os.path.join(
|
||||||
self.btn_path, "browser_just_proxy.png"))
|
self.btn_path, "browser_just_proxy.png"))
|
||||||
label_background.setPixmap(pixmap)
|
label_background.setPixmap(pixmap)
|
||||||
label_background.show()
|
label_background.show()
|
||||||
label_background.setScaledContents(True)
|
label_background.setScaledContents(True)
|
||||||
# label_background.setStyleSheet("background-color: blue;")
|
# label_background.setStyleSheet("background-color: blue;")
|
||||||
self.additional_labels.append(label_background)
|
self.additional_labels.append(label_background)
|
||||||
|
|
||||||
label_garaje = QLabel(self)
|
label_garaje = QLabel(self)
|
||||||
label_garaje.setGeometry(5, 110, 400, 300)
|
label_garaje.setGeometry(5, 110, 400, 300)
|
||||||
pixmap = QPixmap(os.path.join(
|
pixmap = QPixmap(os.path.join(
|
||||||
self.btn_path, f"{country_garaje} garaje.png"))
|
self.btn_path, f"{country_garaje} garaje.png"))
|
||||||
label_garaje.setPixmap(pixmap)
|
label_garaje.setPixmap(pixmap)
|
||||||
label_garaje.show()
|
label_garaje.show()
|
||||||
label_garaje.setScaledContents(True)
|
label_garaje.setScaledContents(True)
|
||||||
# label_garaje.setStyleSheet("background-color: red;")
|
# label_garaje.setStyleSheet("background-color: red;")
|
||||||
self.additional_labels.append(label_garaje)
|
self.additional_labels.append(label_garaje)
|
||||||
|
|
||||||
# Actualizar perfil para editar
|
# Actualizar perfil para editar
|
||||||
editar_profile = {"profile_number": profile_number,
|
editar_profile = {"profile_number": profile_number,
|
||||||
|
|
@ -3375,6 +3326,21 @@ class WireGuardPage(Page):
|
||||||
self.page_stack.findChild(ProtocolPage)))
|
self.page_stack.findChild(ProtocolPage)))
|
||||||
|
|
||||||
|
|
||||||
|
class lokinetPage(Page):
|
||||||
|
def __init__(self, page_stack, parent=None):
|
||||||
|
super().__init__("Lokinet", page_stack, parent)
|
||||||
|
self.create_interface_elements()
|
||||||
|
|
||||||
|
def create_interface_elements(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class OpenPage(Page):
|
||||||
|
def __init__(self, page_stack, parent=None):
|
||||||
|
super().__init__("Opne", page_stack, parent)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class HidetorPage(Page):
|
class HidetorPage(Page):
|
||||||
def __init__(self, page_stack, main_window, parent=None):
|
def __init__(self, page_stack, main_window, parent=None):
|
||||||
super().__init__("HideTor", page_stack, main_window, parent)
|
super().__init__("HideTor", page_stack, main_window, parent)
|
||||||
|
|
@ -3822,19 +3788,8 @@ class LocationPage(Page):
|
||||||
|
|
||||||
def show_location(self, location):
|
def show_location(self, location):
|
||||||
self.initial_display.hide()
|
self.initial_display.hide()
|
||||||
|
|
||||||
locations = self.connection_manager.get_location_info(location)
|
|
||||||
operator_name = locations.operator.name if locations and hasattr(
|
|
||||||
locations, 'operator') else ""
|
|
||||||
|
|
||||||
if operator_name != 'Simplified Privacy':
|
|
||||||
max_size = QtCore.QSize(300, 300)
|
|
||||||
target_size = self.display.size().boundedTo(max_size)
|
|
||||||
else:
|
|
||||||
target_size = self.display.size()
|
|
||||||
|
|
||||||
self.display.setPixmap(QPixmap(os.path.join(self.btn_path, f"icon_{location}.png")).scaled(
|
self.display.setPixmap(QPixmap(os.path.join(self.btn_path, f"icon_{location}.png")).scaled(
|
||||||
target_size, Qt.AspectRatioMode.KeepAspectRatio))
|
self.display.size(), Qt.AspectRatioMode.KeepAspectRatio))
|
||||||
self.selected_location_icon = location
|
self.selected_location_icon = location
|
||||||
self.button_next.setVisible(True)
|
self.button_next.setVisible(True)
|
||||||
self.button_next.clicked.connect(self.go_selected)
|
self.button_next.clicked.connect(self.go_selected)
|
||||||
|
|
@ -4631,9 +4586,8 @@ class ResumePage(Page):
|
||||||
self.btn_path, "default_location_button.png")
|
self.btn_path, "default_location_button.png")
|
||||||
if location_pixmap.isNull():
|
if location_pixmap.isNull():
|
||||||
if locations and hasattr(locations, 'country_name'):
|
if locations and hasattr(locations, 'country_name'):
|
||||||
location_name = locations.country_name
|
|
||||||
base_image = LocationPage.create_location_button_image(
|
base_image = LocationPage.create_location_button_image(
|
||||||
location_name, fallback_path, provider)
|
f'{locations.country_code}_{locations.code}', fallback_path, provider)
|
||||||
parent_label.setIcon(QIcon(base_image))
|
parent_label.setIcon(QIcon(base_image))
|
||||||
else:
|
else:
|
||||||
base_image = LocationPage.create_location_button_image(
|
base_image = LocationPage.create_location_button_image(
|
||||||
|
|
@ -5119,9 +5073,8 @@ class EditorPage(Page):
|
||||||
self.btn_path, "default_location_button.png")
|
self.btn_path, "default_location_button.png")
|
||||||
if base_image.isNull():
|
if base_image.isNull():
|
||||||
if locations and hasattr(locations, 'country_name'):
|
if locations and hasattr(locations, 'country_name'):
|
||||||
location_name = locations.country_name
|
|
||||||
base_image = LocationPage.create_location_button_image(
|
base_image = LocationPage.create_location_button_image(
|
||||||
location_name, fallback_path, provider)
|
f'{locations.country_code}_{locations.code}', fallback_path, provider)
|
||||||
else:
|
else:
|
||||||
base_image = LocationPage.create_location_button_image(
|
base_image = LocationPage.create_location_button_image(
|
||||||
current_value, fallback_path, provider)
|
current_value, fallback_path, provider)
|
||||||
|
|
@ -5533,19 +5486,8 @@ class LocationVerificationPage(Page):
|
||||||
if location_pixmap.isNull():
|
if location_pixmap.isNull():
|
||||||
location_pixmap = QPixmap(fallback_path)
|
location_pixmap = QPixmap(fallback_path)
|
||||||
|
|
||||||
locations = self.connection_manager.get_location_info(
|
|
||||||
self.location_icon_name)
|
|
||||||
operator_name = locations.operator.name if locations and hasattr(
|
|
||||||
locations, 'operator') else ""
|
|
||||||
|
|
||||||
if operator_name != 'Simplified Privacy':
|
|
||||||
max_size = QtCore.QSize(250, 300)
|
|
||||||
target_size = location_display.size().boundedTo(max_size)
|
|
||||||
else:
|
|
||||||
target_size = location_display.size()
|
|
||||||
|
|
||||||
location_display.setPixmap(location_pixmap.scaled(
|
location_display.setPixmap(location_pixmap.scaled(
|
||||||
target_size, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
|
390, 520, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
|
||||||
location_display.show()
|
location_display.show()
|
||||||
|
|
||||||
title = QLabel("Operator Information", self)
|
title = QLabel("Operator Information", self)
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "sp-hydra-veil-gui"
|
name = "sp-hydra-veil-gui"
|
||||||
version = "2.0.2"
|
version = "2.0.1"
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Simplified Privacy" },
|
{ name = "Simplified Privacy" },
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue