Streamline sync through action plumbing. Redundant UK node art for future likely format switch

This commit is contained in:
SimplifiedPrivacy 2026-10-29 19:54:08 -04:00
parent b0b0c3c1c4
commit ec90b2bf7a
8 changed files with 19 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

@ -5,28 +5,27 @@ from core.errors.logger import logger
from gui.v2.infrastructure.setup_observers import connection_observer
from gui.v2.infrastructure.ThreadSafetyTool import ThreadSafetyTool
mainthread = ThreadSafetyTool()
# from gui.v2.infrastructure.ThreadSafetyTool import ThreadSafetyTool
# mainthread = ThreadSafetyTool()
from gui.v2.infrastructure.take_plumbing_action import take_action
@mainthread
def post_state_evaluation(result: Result):
"""Success path for initial state evaluation"""
print("Initial State evaluation complete.")
if not result.valid and result.error_type == ResultError.ZOMBIE_SESSION and result.data:
active_session_profiles = result.data
logger.info("Removing Zombie Session profiles on the main thread.")
for each_profile in active_session_profiles:
logger.info(f"Removing this profile {active_session_profiles} from session since it's a fresh restart.")
SessionStateController.remove(each_profile.id)
# if not result.valid and result.error_type == ResultError.ZOMBIE_SESSION and result.data:
# active_session_profiles = result.data
# logger.info("Removing Zombie Session profiles on the main thread.")
# for each_profile in active_session_profiles:
# logger.info(f"Removing this profile {active_session_profiles} from session since it's a fresh restart.")
# SessionStateController.remove(each_profile.id)
@mainthread
@register_action(ResultError.ZOMBIE_SYSTEM)
def evaluate_bad_state():
"""Start core's evaluation of state with a GUI observer."""
# return coordinate_evaluation(connection_observer=connection_observer)
take_action(
action=coordinate_evaluation,
ui_caller=post_state_evaluation,

View file

@ -346,3 +346,4 @@ def sync_now(ui_caller: Callable):
client_observer=client_observer,
connection_observer=connection_observer
)

View file

@ -288,7 +288,8 @@ def _delete(request: dict[str, Any]) -> MenuResult:
def _navigate(request: dict[str, Any], emit: MenuCallback) -> MenuResult:
"""Keep fast-registration and edit synchronization policy out of page signal handlers."""
fast = is_fast_registration_enabled(request.get("gui_config_file"))
fast = True
# is_fast_registration_enabled(request.get("gui_config_file"))
auto = is_auto_sync_enabled(request.get("gui_config_file"))
create = request["task"] == "create"
synced = request.get("is_synced", False)

View file

@ -300,6 +300,7 @@ class FastRegistrationPage(Page):
self.selected_values['location'], fallback_path, provider)
else:
if locations and hasattr(locations, 'country_name'):
print(f'Fetching image for {locations.country_code}_{locations.code}')
location_image = LocationPage.create_location_button_image(
f'{locations.country_code}_{locations.code}', fallback_path, provider, image_path)
else:

View file

@ -566,9 +566,6 @@ class MenuPage(Page):
print(f"location code for mini is {location}")
import time
time.sleep(20)
location_pixmap = QPixmap(os.path.join(
self.btn_path, f"icon_mini_{location}.png"))
if location_pixmap.isNull():

View file

@ -4,9 +4,13 @@ from PyQt6.QtWidgets import QLabel, QPushButton
from PyQt6.QtGui import QPixmap
from core.controllers.ClientController import ClientController
from core.models.Result import Result
from gui.v2.actions.menu_coordinator import sync_now
from gui.v2.ui.pages.Page import Page
from gui.v2.workers.worker_thread import WorkerThread
from gui.v2.infrastructure.ThreadSafetyTool import ThreadSafetyTool
mainthread = ThreadSafetyTool()
class SyncScreen(Page):
@ -72,9 +76,7 @@ class SyncScreen(Page):
self.update_status('Sync failed. Please try again later.')
return
self.perform_update_check()
self.update_status.update_status('Sync complete')
self.connection_manager.set_synced(True)
update_available = ClientController.can_be_updated()