parent
f9a025081a
commit
2817f54c96
3 changed files with 12 additions and 5 deletions
|
@ -108,12 +108,13 @@ void DlgUpdate::finishedUpdateCheck(bool needToUpdate, bool isCompatible, Releas
|
||||||
//If there's no need to update, tell them that. However we still allow them to run the
|
//If there's no need to update, tell them that. However we still allow them to run the
|
||||||
//downloader themselves if there's a compatible build
|
//downloader themselves if there's a compatible build
|
||||||
QMessageBox::information(this, tr("Cockatrice Update"), tr("Your version of Cockatrice is up to date."));
|
QMessageBox::information(this, tr("Cockatrice Update"), tr("Your version of Cockatrice is up to date."));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishDate = release->getPublishDate().toString(Qt::DefaultLocaleLongDate);
|
||||||
if (isCompatible) {
|
if (isCompatible) {
|
||||||
//If there is an update, save its URL and work out its name
|
//If there is an update, save its URL and work out its name
|
||||||
updateUrl = release->getDownloadUrl();
|
updateUrl = release->getDownloadUrl();
|
||||||
publishDate = release->getPublishDate().toString(Qt::DefaultLocaleLongDate);
|
|
||||||
|
|
||||||
QMessageBox::StandardButton reply;
|
QMessageBox::StandardButton reply;
|
||||||
reply = QMessageBox::question(this, "Update Available",
|
reply = QMessageBox::question(this, "Update Available",
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define DEVFILES_URL "https://api.bintray.com/packages/cockatrice/Cockatrice/Cockatrice-git/files"
|
#define DEVFILES_URL "https://api.bintray.com/packages/cockatrice/Cockatrice/Cockatrice-git/files"
|
||||||
#define DEVDOWNLOAD_URL "https://dl.bintray.com/cockatrice/Cockatrice/"
|
#define DEVDOWNLOAD_URL "https://dl.bintray.com/cockatrice/Cockatrice/"
|
||||||
#define DEVMANUALDOWNLOAD_URL "https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files"
|
#define DEVMANUALDOWNLOAD_URL "https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files"
|
||||||
|
#define DEVRELEASE_DESCURL "https://github.com/Cockatrice/Cockatrice/compare/%1...%2"
|
||||||
#define GIT_SHORT_HASH_LEN 7
|
#define GIT_SHORT_HASH_LEN 7
|
||||||
|
|
||||||
int ReleaseChannel::sharedIndex = 0;
|
int ReleaseChannel::sharedIndex = 0;
|
||||||
|
@ -253,11 +254,15 @@ void DevReleaseChannel::releaseListFinished()
|
||||||
if(!lastRelease)
|
if(!lastRelease)
|
||||||
lastRelease = new Release;
|
lastRelease = new Release;
|
||||||
|
|
||||||
lastRelease->setName("Commit " + resultMap["sha"].toString());
|
|
||||||
lastRelease->setDescriptionUrl(resultMap["html_url"].toString());
|
|
||||||
lastRelease->setCommitHash(resultMap["sha"].toString());
|
lastRelease->setCommitHash(resultMap["sha"].toString());
|
||||||
lastRelease->setPublishDate(resultMap["commit"].toMap()["author"].toMap()["date"].toDate());
|
lastRelease->setPublishDate(resultMap["commit"].toMap()["author"].toMap()["date"].toDate());
|
||||||
|
|
||||||
|
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
|
||||||
|
lastRelease->setName("Commit " + shortHash);
|
||||||
|
|
||||||
|
lastRelease->setDescriptionUrl(QString(DEVRELEASE_DESCURL).arg(VERSION_COMMIT, shortHash));
|
||||||
|
|
||||||
qDebug() << "Got reply from release server, size=" << tmp.size()
|
qDebug() << "Got reply from release server, size=" << tmp.size()
|
||||||
<< "name=" << lastRelease->getName()
|
<< "name=" << lastRelease->getName()
|
||||||
<< "desc=" << lastRelease->getDescriptionUrl()
|
<< "desc=" << lastRelease->getDescriptionUrl()
|
||||||
|
|
|
@ -166,8 +166,9 @@ SettingsCache::SettingsCache()
|
||||||
translateLegacySettings();
|
translateLegacySettings();
|
||||||
|
|
||||||
// updates - don't reorder them or their index in the settings won't match
|
// updates - don't reorder them or their index in the settings won't match
|
||||||
releaseChannels << new StableReleaseChannel()
|
// append channels one by one, or msvc will add them in the wrong order.
|
||||||
<< new DevReleaseChannel();
|
releaseChannels << new StableReleaseChannel();
|
||||||
|
releaseChannels << new DevReleaseChannel();
|
||||||
|
|
||||||
notifyAboutUpdates = settings->value("personal/updatenotification", true).toBool();
|
notifyAboutUpdates = settings->value("personal/updatenotification", true).toBool();
|
||||||
updateReleaseChannel = settings->value("personal/updatereleasechannel", 0).toInt();
|
updateReleaseChannel = settings->value("personal/updatereleasechannel", 0).toInt();
|
||||||
|
|
Loading…
Reference in a new issue