Skip to content
17 changes: 12 additions & 5 deletions src/intervalssync/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .settings_view import build_settings_view
from .sync_view import build_sync_view
from . import profile_sync_ui
from . import support_gamification
from . import theme


Expand Down Expand Up @@ -222,11 +223,17 @@ def _header() -> ft.Container:
),
],
),
ft.IconButton(
icon=ft.Icons.INFO_OUTLINE,
tooltip="About",
icon_color=colors["text_muted"],
on_click=show_about,
ft.Row(
spacing=0,
controls=[
support_gamification.kofi_header_button(page),
ft.IconButton(
icon=ft.Icons.INFO_OUTLINE,
tooltip="About",
icon_color=colors["text_muted"],
on_click=show_about,
),
],
),
],
),
Expand Down
15 changes: 15 additions & 0 deletions src/intervalssync/gui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ class AppConfig:
profile_sync_declined_fingerprint: str = ""
# Prompt on launch when FTP, LTHR, or max HR differ from intervals.icu.
profile_sync_check_on_launch: bool = True
# Lifetime sync stats (GUI gamification).
lifetime_activities_uploaded: int = 0
lifetime_workouts_uploaded: int = 0
celebrated_milestones: list[int] = field(default_factory=list)
stats_seeded: bool = False


def total_uploads(config: AppConfig) -> int:
return config.lifetime_activities_uploaded + config.lifetime_workouts_uploaded


def any_source_enabled(config: AppConfig) -> bool:
Expand All @@ -79,6 +88,12 @@ def load() -> AppConfig:
if activity_source == "bryton":
cfg.enable_bryton = True
cfg.enable_igpsport = False
if not cfg.stats_seeded:
cfg.lifetime_workouts_uploaded = len(cfg.uploaded_workouts) + len(
cfg.uploaded_bryton_workouts
)
cfg.stats_seeded = True
save(cfg)
return cfg


Expand Down
Loading
Loading