update: added info on edit profile window

This commit is contained in:
Your Name 2026-01-02 19:43:56 +01:00
parent 6de633ab9c
commit 8dc8056705

View file

@ -5059,6 +5059,7 @@ class EditorPage(Page):
country_garaje = location
name = data_profile.get('name', "")
self.name.setText(name)
if protocol == "hidetor":
if connection == "just proxy":
self.display.setPixmap(QPixmap(os.path.join(
@ -5100,6 +5101,80 @@ class EditorPage(Page):
self.garaje.setPixmap(QPixmap(os.path.join(
self.btn_path, f"{country_garaje} garaje.png")))
profile_id = data_profile.get('id')
profile_obj = ProfileController.get(profile_id)
location_info = None
if location:
try:
if '_' in location:
country_code, location_code = location.split('_', 1)
location_info = LocationController.get(
country_code, location_code)
except Exception:
location_info = None
operator_name = ""
l_name = ""
o_name = ""
n_key = ""
if location_info:
if hasattr(location_info, 'operator') and location_info.operator:
operator_name = location_info.operator.name
o_name = location_info.operator.name
n_key = location_info.operator.nostr_public_key
l_name = f"{location_info.country_name}, {location_info.name}" if hasattr(
location_info, 'country_name') else ""
if operator_name != 'Simplified Privacy' and operator_name != "":
text_color = "white"
if profile_obj and profile_obj.is_session_profile():
text_color = "black"
l_img = QLabel(self)
l_img.setGeometry(20, 125, 150, 150)
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.labels.append(l_img)
info_txt = QTextEdit(self)
info_txt.setGeometry(180, 120, 300, 250)
info_txt.setReadOnly(True)
info_txt.setFrameStyle(QFrame.Shape.NoFrame)
info_txt.setStyleSheet(
f"background: transparent; border: none; color: {text_color}; font-size: 19px;")
info_txt.setVerticalScrollBarPolicy(
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
info_txt.setHorizontalScrollBarPolicy(
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
info_txt.setWordWrapMode(
QtGui.QTextOption.WrapMode.WrapAtWordBoundaryOrAnywhere)
info_txt.setText(
f"Location: {l_name}\n\nOperator: {o_name}")
info_txt.show()
self.labels.append(info_txt)
nostr_txt = QTextEdit(self)
nostr_txt.setGeometry(20, 300, 450, 170)
nostr_txt.setReadOnly(True)
nostr_txt.setFrameStyle(QFrame.Shape.NoFrame)
nostr_txt.setStyleSheet(
f"background: transparent; border: none; color: {text_color}; font-size: 21px;")
nostr_txt.setVerticalScrollBarPolicy(
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
nostr_txt.setHorizontalScrollBarPolicy(
Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
nostr_txt.setWordWrapMode(
QtGui.QTextOption.WrapMode.WrapAnywhere)
nostr_txt.setText(f"Nostr: {n_key}")
nostr_txt.show()
self.labels.append(nostr_txt)
for i, key in enumerate(parameters.keys()):
if key == 'browser':
browser_value = f"{data_profile.get(key, '')}"