# 250 — Checking for updates from the settings menu

Status: built and verified in the live Kodi 2026-10-15 (Standa: "an item in the settings menu that checks for updates at
once and then offers to install the new version, a whole new modal in the style of our skin, for both skins").

## 1. What the user sees

The settings menu (gear on Home, window 1108) has "Zkontrolovat aktualizace". It opens window 1124
(`Custom_1124_MilionarUpdate.xml`), which shows one of these states:

| State | Headline | Text | Buttons |
|-------|----------|------|---------|
| checking | spinner + Kontroluji aktualizace… | — | Zavřít |
| current | Máte nejnovější verzi | Milionář X je aktuální. | Zavřít |
| available | Je k dispozici nová verze, installed → new | the release's news | **Nainstalovat**, Později |
| available, workspace / no repository | same | why there is no install here | Později |
| installing | spinner + Instaluji novou verzi… | Kodi installs, Milionář reloads by itself | Zavřít |
| done | Aktualizováno | Milionář X je nainstalovaný. | Zavřít |
| failed | Aktualizace se nepodařilo ověřit | check the connection | **Zkusit znovu**, Zavřít |

The main button gets the focus as soon as it appears. The window is an Estuary dialog (`DialogBackgroundCommons`,
Estuary's dialog buttons, `MilionarSpinner`), so skin.milionar.modern restyles it through its overlay like every other
dialog (glass panel, accent bar, glass buttons).

## 2. How it works (`wcs/skin/update.py`)

- The menu item is a quick action (`action=skin_update`, `wcs/skin/local.py`): sent to the service, or run by the plugin
  without it. The window draws `Window(Home).Property(milionar.update.*)`; `next` says what the main button does.
- The check reads the repository index (the `<info>` of the installed `repository.milionar`, else the published URL)
  and compares versions numerically. The release writes the newest own skin changelog entry into the addon's `<news>`
  (`release.write_news`), which the window shows (and Kodi shows with the add-on).
- Installing is Kodi's own job — Kodi 21 offers no way to update an installed add-on except through its repositories:
  `UpdateAddonRepos` refreshes them and, with automatic updates on (`general.addonupdates` = 0), Kodi installs the new
  version. Otherwise, or when Kodi has not installed it within 3 minutes, Kodi's list of available updates opens.
- Kodi stops the service while it installs and starts the new version's; the new service (`service.py`, after the skin
  installer) sees `milionar.update.target` reached and opens the window with "Aktualizováno" (`update.resume`).

## 3. The development workspace is never updated

The workspace is the installed addon folder; an update from the repository would replace it. `update.is_workspace`
(a `.git` folder in the addon) shows the available version but offers no install and `install()` refuses even a
stale click; the workspace Kodi also has no `repository.milionar`. `test_update.py` checks that no `UpdateAddonRepos`
is ever sent there.

## 4. Verification (2026-10-15)

Live in both skins: the menu item, the real check against the published repository (current 2.1.76), the plugin path
without the service, `resume` finishing the window, and every state rendered from its properties (focus on the main
button). Offline: `scripts/skin_harness/test_update.py` (11), `tests.test_release` (news). Not run here by design:
Kodi's own install (the workspace must never update).
