shadPS4/src/qt_gui/settings.h
georgemoralis 02cbebbf78
file formats and qt (#88)
* added psf file format

* clang format fix

* crypto functions for pkg decryption

* pkg decryption

* initial add of qt gui , not yet usable

* renamed ini for qt gui settings into shadps4qt.ini

* file detection and loader support

* option to build QT qui

* clang format fix

* fixed reuse

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.h

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* uppercase fix

* clang format fix

* small fixes

* let's try windows qt build ci

* some more fixes for ci

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update .github/workflows/windows-qt.yml

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/psf.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* loader namespace

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* constexpr magic

* linux qt ci by qurious

* fix for linux qt

* Make script executable

* ci fix?

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
Co-authored-by: GPUCode <geoster3d@gmail.com>
2024-03-01 00:00:35 +02:00

50 lines
1.4 KiB
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
#include <QDir>
#include <QSettings>
#include <QSize>
#include <QVariant>
#include "gui_save.h"
typedef QPair<QString, QString> q_string_pair;
typedef QPair<QString, QSize> q_size_pair;
typedef QList<q_string_pair> q_pair_list;
typedef QList<q_size_pair> q_size_list;
// Parent Class for GUI settings
class Settings : public QObject {
Q_OBJECT
public:
explicit Settings(QObject* parent = nullptr);
~Settings();
QString GetSettingsDir() const;
QVariant GetValue(const QString& key, const QString& name, const QVariant& def) const;
QVariant GetValue(const GuiSave& entry) const;
static QVariant List2Var(const q_pair_list& list);
static q_pair_list Var2List(const QVariant& var);
public Q_SLOTS:
/** Remove entry */
void RemoveValue(const QString& key, const QString& name) const;
void RemoveValue(const GuiSave& entry) const;
/** Write value to entry */
void SetValue(const GuiSave& entry, const QVariant& value) const;
void SetValue(const QString& key, const QVariant& value) const;
void SetValue(const QString& key, const QString& name, const QVariant& value) const;
protected:
static QString ComputeSettingsDir();
std::unique_ptr<QSettings> m_settings;
QDir m_settings_dir;
};