mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Automatic Spoiler Season (#2991)
* oracle now can be run in spoiler or normal mode * tests for travis * only run on relaunch * spoilers in client (not oracle now) and tray icon shows when done * spoiler status will be checked before downloading spoiler file * only download if they care about spoilers * reload db on spoiler download * manual update button, code cleanup, and fix enabling sets when new * cleanup, nullchecks, and fixes to spoiler * reload DB even if not in spoiler season; necessary as we have a check elsewhere to prevent the reload if spoiler check happens * Implement changes from 2991#issuecomment-356169374 * Change implicit nullptrs, alert on file deletion, minor changes * make reload thread safe and minor changes from 2991#issuecomment-356450302 * Fix locking * Disable update now button while process running
This commit is contained in:
parent
51ec593759
commit
d19744236e
23 changed files with 2106 additions and 913 deletions
|
|
@ -171,6 +171,8 @@ SettingsCache::SettingsCache()
|
|||
releaseChannels << new StableReleaseChannel();
|
||||
releaseChannels << new DevReleaseChannel();
|
||||
|
||||
mbDownloadSpoilers = settings->value("personal/downloadspoilers", false).toBool();
|
||||
|
||||
notifyAboutUpdates = settings->value("personal/updatenotification", true).toBool();
|
||||
updateReleaseChannel = settings->value("personal/updatereleasechannel", 0).toInt();
|
||||
|
||||
|
|
@ -187,6 +189,7 @@ SettingsCache::SettingsCache()
|
|||
|
||||
cardDatabasePath = getSafeConfigFilePath("paths/carddatabase", dataPath + "/cards.xml");
|
||||
tokenDatabasePath = getSafeConfigFilePath("paths/tokendatabase", dataPath + "/tokens.xml");
|
||||
spoilerDatabasePath = getSafeConfigFilePath("paths/spoilerdatabase", dataPath + "/spoiler.xml");
|
||||
|
||||
themeName = settings->value("theme/name").toString();
|
||||
|
||||
|
|
@ -348,6 +351,13 @@ void SettingsCache::setCardDatabasePath(const QString &_cardDatabasePath)
|
|||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setSpoilerDatabasePath(const QString &_spoilerDatabasePath)
|
||||
{
|
||||
spoilerDatabasePath = _spoilerDatabasePath;
|
||||
settings->setValue("paths/spoilerdatabase", spoilerDatabasePath);
|
||||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setTokenDatabasePath(const QString &_tokenDatabasePath)
|
||||
{
|
||||
tokenDatabasePath = _tokenDatabasePath;
|
||||
|
|
@ -644,10 +654,17 @@ void SettingsCache::setRememberGameSettings(const bool _rememberGameSettings)
|
|||
|
||||
void SettingsCache::setNotifyAboutUpdate(int _notifyaboutupdate)
|
||||
{
|
||||
notifyAboutUpdates = _notifyaboutupdate;
|
||||
notifyAboutUpdates = static_cast<bool>(_notifyaboutupdate);
|
||||
settings->setValue("personal/updatenotification", notifyAboutUpdates);
|
||||
}
|
||||
|
||||
void SettingsCache::setDownloadSpoilerStatus(bool _spoilerStatus)
|
||||
{
|
||||
mbDownloadSpoilers = _spoilerStatus;
|
||||
settings->setValue("personal/downloadspoilers", mbDownloadSpoilers);
|
||||
emit downloadSpoilerStatusChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setUpdateReleaseChannel(int _updateReleaseChannel)
|
||||
{
|
||||
updateReleaseChannel = _updateReleaseChannel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue