| 265 | } |
| 266 | |
| 267 | void UpdateDialog::OnCheckUpdatesClick() |
| 268 | { |
| 269 | auto const callback = [this](storage::CheckUpdatesStatus const & status) |
| 270 | { |
| 271 | QString txt; |
| 272 | switch (status) |
| 273 | { |
| 274 | case storage::CheckUpdatesStatus::Updated: |
| 275 | txt = tr("Map updates available!"); |
| 276 | RefillTree(); |
| 277 | break; |
| 278 | case storage::CheckUpdatesStatus::NoUpdate: txt = tr("No updates available"); break; |
| 279 | case storage::CheckUpdatesStatus::EOL: |
| 280 | txt = tr("No more map updates for this app version. Please update the app!"); |
| 281 | break; |
| 282 | case storage::CheckUpdatesStatus::Error: |
| 283 | default: txt = tr("Error checking for updates"); break; |
| 284 | } |
| 285 | m_pCheckUpdatesLabel->setText(txt); |
| 286 | |
| 287 | m_pCheckUpdatesButton->setText(tr("Check for updates")); |
| 288 | m_pCheckUpdatesButton->setEnabled(true); |
| 289 | }; |
| 290 | GetStorage().SetCheckUpdatesListener(callback); |
| 291 | |
| 292 | m_pCheckUpdatesButton->setEnabled(false); |
| 293 | m_pCheckUpdatesButton->setText(tr("Checking for updates...")); |
| 294 | m_pCheckUpdatesLabel->setText(""); |
| 295 | GetStorage().RunCountriesCheckAsyncSaveOnly(); |
| 296 | } |
| 297 | |
| 298 | void UpdateDialog::OnCloseClick() |
| 299 | { |
nothing calls this directly
no test coverage detected