@@ -108,7 +108,7 @@ Application::Application(int& argc, char** argv)
108108 checkUpdateResults ();
109109
110110 // TODO: if not disabled in settings / if time has come
111- checkForUpdates ();
111+ checkForUpdates (false );
112112}
113113
114114Application::~Application ()
@@ -205,15 +205,15 @@ QString Application::getUpdatePath() const
205205 return QDir::temp ().absoluteFilePath (" CEEDUpdate" );
206206}
207207
208- void Application::checkForUpdates ()
208+ void Application::checkForUpdates (bool manual )
209209{
210210 if (!Utils::isInternetConnected ())
211211 {
212212 qCritical () << " No Internet connection, update check skipped" ;
213213 return ;
214214 }
215215
216- QUrl infoUrl = _settings->getQSettings ()->value (" updateInfoUrl" , " https://api.github.com/repos/cegui/ceed-cpp/releases/latest" ).toUrl ();
216+ const QUrl infoUrl = _settings->getQSettings ()->value (" updateInfoUrl" , " https://api.github.com/repos/cegui/ceed-cpp/releases/latest" ).toUrl ();
217217
218218 _mainWindow->setStatusMessage (" Checking for updates..." );
219219
@@ -223,7 +223,7 @@ void Application::checkForUpdates()
223223 onUpdateError (infoReply->url (), infoReply->errorString ());
224224 });
225225
226- QObject::connect (infoReply, &QNetworkReply::finished, [this , infoReply]()
226+ QObject::connect (infoReply, &QNetworkReply::finished, [this , infoReply, manual ]()
227227 {
228228 // Already processed by QNetworkReply::errorOccurred handler
229229 if (infoReply->error () != QNetworkReply::NoError) return ;
@@ -246,8 +246,11 @@ void Application::checkForUpdates()
246246 auto savedVersion = QVersionNumber::fromString (_settings->getQSettings ()->value (" update/version" ).toString ());
247247 if (latestVersion.normalized () == savedVersion.normalized ())
248248 {
249- _mainWindow->setStatusMessage (tr (" Auto-update to %1 is blocked because it failed before. "
250- " Use Help->Check For Updates to try again." ).arg (latestVersionStr));
249+ const QString msg = tr (" Auto-update to %1 is blocked because it failed before. "
250+ " Use Help->Check For Updates to try again." ).arg (latestVersionStr);
251+ _mainWindow->setStatusMessage (msg);
252+ if (manual)
253+ QMessageBox::warning (_mainWindow, tr (" Auto-update blocked" ), msg);
251254 return ;
252255 }
253256 else
@@ -262,6 +265,13 @@ void Application::checkForUpdates()
262265 UpdateDialog dlg (currentVersion, latestVersion, releaseInfo);
263266 dlg.exec ();
264267 }
268+ else
269+ {
270+ const QString msg = tr (" CEED is already at the latest version: %1" ).arg (applicationVersion ());
271+ _mainWindow->setStatusMessage (" No update found" );
272+ if (manual)
273+ QMessageBox::information (_mainWindow, tr (" Already updated" ), msg);
274+ }
265275 }
266276 catch (const std::exception& e)
267277 {
0 commit comments