mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[Client] Sync conflict dialog, onboarding and conflict default
This commit is contained in:
parent
de3468cc33
commit
d2e2e722e7
21 changed files with 1020 additions and 48 deletions
|
|
@ -12,6 +12,7 @@ set(HEADERS
|
|||
libcockatrice/settings/commander_bracket_settings.h
|
||||
libcockatrice/settings/debug_settings.h
|
||||
libcockatrice/settings/deck_editor_settings.h
|
||||
libcockatrice/settings/deck_sync_settings.h
|
||||
libcockatrice/settings/download_settings.h
|
||||
libcockatrice/settings/game_filters_settings.h
|
||||
libcockatrice/settings/game_settings.h
|
||||
|
|
@ -43,6 +44,7 @@ add_library(
|
|||
libcockatrice/settings/chat_settings.cpp
|
||||
libcockatrice/settings/debug_settings.cpp
|
||||
libcockatrice/settings/deck_editor_settings.cpp
|
||||
libcockatrice/settings/deck_sync_settings.cpp
|
||||
libcockatrice/settings/download_settings.cpp
|
||||
libcockatrice/settings/game_filters_settings.cpp
|
||||
libcockatrice/settings/game_settings.cpp
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
#include "deck_sync_settings.h"
|
||||
|
||||
#include "libcockatrice/settings/settings_manager.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
DeckSyncSettings::DeckSyncSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "deck_sync.ini", "decksync", QString(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
int DeckSyncSettings::getConflictDefault() const
|
||||
{
|
||||
return getValue("conflictDefault", QString(), QString(), DeckSyncConflictAsk).toInt();
|
||||
}
|
||||
|
||||
void DeckSyncSettings::setConflictDefault(int _conflictDefault)
|
||||
{
|
||||
setValue(_conflictDefault, "conflictDefault");
|
||||
emit conflictDefaultChanged(_conflictDefault);
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef DECK_SYNC_SETTINGS_H
|
||||
#define DECK_SYNC_SETTINGS_H
|
||||
|
||||
#include "settings_manager.h"
|
||||
|
||||
#include <QString>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
class QObject;
|
||||
|
||||
enum DeckSyncConflictDefault
|
||||
{
|
||||
DeckSyncConflictAsk = 0, ///< Ask every time a deck changed on both sides.
|
||||
DeckSyncConflictKeepMine, ///< Silently keep the local deck.
|
||||
DeckSyncConflictKeepServer, ///< Silently keep the server deck.
|
||||
DeckSyncConflictKeepNewer, ///< Silently keep whichever side changed last.
|
||||
};
|
||||
|
||||
class DeckSyncSettings : public SettingsManager
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
[[nodiscard]] int getConflictDefault() const;
|
||||
void setConflictDefault(int _conflictDefault);
|
||||
|
||||
signals:
|
||||
void conflictDefaultChanged(int conflictDefault);
|
||||
|
||||
public:
|
||||
explicit DeckSyncSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
DeckSyncSettings(const DeckSyncSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // DECK_SYNC_SETTINGS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue