void AutoUpdater::checkUpdatesAsyncInteractiveWorker() { if (!isUpdateAvailable()) return; if (Widget::getInstance()->askMsgboxQuestion(QObject::tr("Update", "The title of a message box"), QObject::tr("An update is available, do you want to download it now?\nIt will be installed when qTox restarts."))) { downloadUpdate(); } }
void AutoUpdater::checkUpdatesAsyncInteractiveWorker() { if (!isUpdateAvailable()) return; // If there's already an update dir, resume updating, otherwise ask the user QString updateDirStr = Settings::getInstance().getSettingsDirPath() + "/update/"; QDir updateDir(updateDirStr); if ((updateDir.exists() && QFile(updateDirStr+"flist").exists()) || GUI::askQuestion(QObject::tr("Update", "The title of a message box"), QObject::tr("An update is available, do you want to download it now?\nIt will be installed when qTox restarts."), true, false)) { downloadUpdate(); } }
void AutoUpdater::checkUpdatesAsyncInteractiveWorker() { if (!isUpdateAvailable()) return; // If there's already an update dir, resume updating, otherwise ask the user QString updateDirStr = Settings::getInstance().getSettingsDirPath() + "/update/"; QDir updateDir(updateDirStr); if (updateDir.exists() && QFile(updateDirStr+"flist").exists()) { setProgressVersion(getUpdateVersion().versionString); downloadUpdate(); return; } VersionInfo newVersion = getUpdateVersion(); QString contentText = QObject::tr("An update is available, do you want to download it now?\n" "It will be installed when qTox restarts."); if (!newVersion.versionString.isEmpty()) contentText += "\n\n" + QObject::tr("Version %1, %2").arg(newVersion.versionString, QDateTime::fromMSecsSinceEpoch(newVersion.timestamp*1000).toString()); if (abortFlag) return; if (GUI::askQuestion(QObject::tr("Update", "The title of a message box"), contentText, true, false)) { setProgressVersion(newVersion.versionString); GUI::showUpdateDownloadProgress(); downloadUpdate(); } }
Update_Status UpdateChecker::isUpdateAvailable() { return isUpdateAvailable(MPC_VERSION); }