mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
Mock: DlgCrashReport preview dialog (no account needed, redacted log preview), CrashReportingMode Ask/Always/Never setting in DebugSettings, --simulate-crash flag and Help-menu preview entry. Send writes a local mock JSON only. Vendor sentry-native 0.17.3 via FetchContent behind WITH_CRASH_REPORTING (breakpad everywhere, backend none under sanitizers) plus a CrashReporter facade with early init and post-loop shutdown. DSN is a placeholder: empty CMake default with COCKATRICE_SENTRY_DSN env override, so SDK init is skipped and mock behavior is unchanged until a real DSN is configured. CI prerequisites riding here so every layer below builds green: libcurl dev plus CA bundles in the Linux images and CodeQL env, sentry Qt integration off (its own find_package cannot see the macOS thin Qt layout), and the StrFunc Using construction makensis requires. Tests: ctest green, format clean, code plus UI gates PASS.
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#ifndef PERSONAL_SETTINGS_H
|
|
#define PERSONAL_SETTINGS_H
|
|
|
|
#include "settings_manager.h"
|
|
|
|
#include <QString>
|
|
#include <libcockatrice/interfaces/interface_personal_settings_provider.h>
|
|
#include <qtmetamacros.h>
|
|
|
|
class QObject;
|
|
template <typename T> class QList;
|
|
|
|
class PersonalSettings : public SettingsManager, public IPersonalSettingsProvider
|
|
{
|
|
Q_OBJECT
|
|
friend class SettingsCache;
|
|
|
|
public:
|
|
[[nodiscard]] QString getLang() const override;
|
|
[[nodiscard]] bool getShowTipsOnStartup() const override;
|
|
[[nodiscard]] QList<int> getSeenTips() const override;
|
|
|
|
void setLang(const QString &_lang);
|
|
void setShowTipsOnStartup(bool _showTipsOnStartup);
|
|
void setSeenTips(const QList<int> &_seenTips);
|
|
|
|
enum class CrashReportingMode
|
|
{
|
|
Ask = 0,
|
|
AlwaysSend = 1,
|
|
NeverSend = 2
|
|
};
|
|
|
|
[[nodiscard]] CrashReportingMode getCrashReportingMode() const;
|
|
void setCrashReportingMode(CrashReportingMode _crashReportingMode);
|
|
|
|
signals:
|
|
void langChanged();
|
|
void crashReportingModeChanged(CrashReportingMode mode);
|
|
|
|
public:
|
|
explicit PersonalSettings(const QString &settingPath, QObject *parent = nullptr);
|
|
|
|
private:
|
|
PersonalSettings(const PersonalSettings & /*other*/);
|
|
};
|
|
|
|
#endif // PERSONAL_SETTINGS_H
|