update: new display for non SP locations

This commit is contained in:
Your Name 2025-12-29 17:48:04 +01:00
parent 0fac5a2d99
commit a8c88363d8
4 changed files with 127 additions and 93 deletions

View file

@ -2020,10 +2020,56 @@ 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
if protocol.lower() in ["wireguard", "open", "lokinet", "residential", "hidetor"]:
label_principal = None 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 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"]:
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)
@ -2040,7 +2086,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(): if protocol.lower() == "wireguard" and ConfigurationController.get_endpoint_verification_enabled() and operator_name == 'Simplified Privacy':
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)
@ -2051,6 +2097,7 @@ 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:
@ -2110,7 +2157,9 @@ class MenuPage(Page):
label_tor = QLabel(self) label_tor = QLabel(self)
label_tor.setGeometry(330, 300, 75, 113) 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)
@ -3326,21 +3375,6 @@ 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -1,6 +1,6 @@
[project] [project]
name = "sp-hydra-veil-gui" name = "sp-hydra-veil-gui"
version = "2.0.1" version = "2.0.2"
authors = [ authors = [
{ name = "Simplified Privacy" }, { name = "Simplified Privacy" },
] ]