MCPcopy Create free account
hub / github.com/comaps/comaps / OnCheckUpdatesClick

Method OnCheckUpdatesClick

qt/update_dialog.cpp:267–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void 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
298void UpdateDialog::OnCloseClick()
299{

Callers

nothing calls this directly

Calls 3

setEnabledMethod · 0.45

Tested by

no test coverage detected