Add update checking system to Qt UI

* This only runs on windows - on other platforms we rely on system
  distribution or user local builds.
This commit is contained in:
baldurk
2017-12-19 17:31:32 +00:00
parent 08c67f2149
commit 764b39a23c
16 changed files with 1283 additions and 50 deletions
+30
View File
@@ -121,6 +121,29 @@ int main(int argc, char *argv[])
}
}
bool updateApplied = false;
for(int i = 0; i < argc; i++)
{
if(!QString::compare(QString::fromUtf8(argv[i]), lit("--updatefailed"), Qt::CaseInsensitive))
{
if(i < argc - 1)
RDDialog::critical(NULL, QApplication::translate("qrenderdoc", "Error updating"),
QApplication::translate("qrenderdoc", "Error applying update: %1")
.arg(QString::fromUtf8(argv[i + 1])));
else
RDDialog::critical(NULL, QApplication::translate("qrenderdoc", "Error updating"),
QApplication::translate("qrenderdoc", "Unknown error applying update"));
}
if(!QString::compare(QString::fromUtf8(argv[i]), lit("--updatedone"), Qt::CaseInsensitive))
{
updateApplied = true;
RENDERDOC_UpdateInstalledVersionNumber();
}
}
QString remoteHost;
uint remoteIdent = 0;
@@ -327,6 +350,13 @@ int main(int argc, char *argv[])
}
}
if(updateApplied)
{
config.CheckUpdate_UpdateAvailable = false;
config.CheckUpdate_UpdateResponse = "";
config.Save();
}
while(ctx.isRunning())
{
application.processEvents(QEventLoop::WaitForMoreEvents);