mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Tip of the Day (#3118)
* Basic tip of the day with sample widget added * "Show tips on startup" option added to settings * tip cycling implemented * Structure of the tipOfTheDay class and resource created * tip getter function modified * Resources added, feature works properly * clangified * accidental modification rolled back * zach cleanup * tips to spaces; cmake list combined * cleanup img * fix copy * remove TOTD as QObject so we can copy construct it * prevent mem leaks in dlg * changed order of 'next' and 'previous' buttons * Date and tip numbers added; content wraps around * useless sizepolicy removed * link support added & clangified * Initial tips & memory management updates
This commit is contained in:
parent
281e52eaa9
commit
312caae062
24 changed files with 498 additions and 2 deletions
|
|
@ -179,6 +179,10 @@ SettingsCache::SettingsCache()
|
|||
lang = settings->value("personal/lang").toString();
|
||||
keepalive = settings->value("personal/keepalive", 5).toInt();
|
||||
|
||||
// tip of the day settings
|
||||
showTipsOnStartup = settings->value("tipOfDay/showTips", true).toBool();
|
||||
lastShownTip = settings->value("tipOfDay/lastShown", -1).toInt();
|
||||
|
||||
deckPath = getSafeConfigPath("paths/decks", dataPath + "/decks/");
|
||||
replaysPath = getSafeConfigPath("paths/replays", dataPath + "/replays/");
|
||||
picsPath = getSafeConfigPath("paths/pics", dataPath + "/pics/");
|
||||
|
|
@ -335,6 +339,18 @@ void SettingsCache::setLang(const QString &_lang)
|
|||
emit langChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setShowTipsOnStartup(bool _showTipsOnStartup)
|
||||
{
|
||||
showTipsOnStartup = _showTipsOnStartup;
|
||||
settings->setValue("tipOfDay/showTips", showTipsOnStartup);
|
||||
}
|
||||
|
||||
void SettingsCache::setLastShownTip(int _lastShownTip)
|
||||
{
|
||||
lastShownTip = _lastShownTip;
|
||||
settings->setValue("tipOfDay/lastShown", lastShownTip);
|
||||
}
|
||||
|
||||
void SettingsCache::setDeckPath(const QString &_deckPath)
|
||||
{
|
||||
deckPath = _deckPath;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue