update: new display for non SP locations

This commit is contained in:
Your Name 2025-12-29 18:19:53 +01:00
parent a8c88363d8
commit 98d0b0f473

View file

@ -3822,8 +3822,19 @@ 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(
self.display.size(), Qt.AspectRatioMode.KeepAspectRatio)) target_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)
@ -4620,8 +4631,9 @@ 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(
f'{locations.country_code}_{locations.code}', fallback_path, provider) location_name, 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(
@ -5107,8 +5119,9 @@ 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(
f'{locations.country_code}_{locations.code}', fallback_path, provider) location_name, 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)
@ -5520,8 +5533,19 @@ 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(
390, 520, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation)) target_size, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
location_display.show() location_display.show()
title = QLabel("Operator Information", self) title = QLabel("Operator Information", self)