mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Client+Server] Auto deck sync with change polling
This commit is contained in:
parent
dcccb0f332
commit
e73fcd602c
18 changed files with 448 additions and 18 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "libcockatrice/settings/settings_manager.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <QtGlobal>
|
||||
|
||||
DeckSyncSettings::DeckSyncSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "deck_sync.ini", "decksync", QString(), parent)
|
||||
|
|
@ -19,3 +20,25 @@ void DeckSyncSettings::setConflictDefault(int _conflictDefault)
|
|||
setValue(_conflictDefault, "conflictDefault");
|
||||
emit conflictDefaultChanged(_conflictDefault);
|
||||
}
|
||||
|
||||
bool DeckSyncSettings::getAutoSync() const
|
||||
{
|
||||
return getValue("autoSync", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void DeckSyncSettings::setAutoSync(bool _autoSync)
|
||||
{
|
||||
setValue(_autoSync, "autoSync");
|
||||
emit autoSyncChanged(_autoSync);
|
||||
}
|
||||
|
||||
int DeckSyncSettings::getSyncIntervalMinutes() const
|
||||
{
|
||||
return qBound(1, getValue("syncIntervalMinutes", QString(), QString(), 5).toInt(), 60);
|
||||
}
|
||||
|
||||
void DeckSyncSettings::setSyncIntervalMinutes(int _syncIntervalMinutes)
|
||||
{
|
||||
setValue(_syncIntervalMinutes, "syncIntervalMinutes");
|
||||
emit syncIntervalMinutesChanged(_syncIntervalMinutes);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue