forked from myst6re/hyne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.h
74 lines (67 loc) · 2.74 KB
/
Config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/****************************************************************************
** Hyne Final Fantasy VIII Save Editor
** Copyright (C) 2009-2013 Arzel Jérôme <[email protected]>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef CONFIG_H
#define CONFIG_H
#include <QtCore>
#include "FF8Installation.h"
#define KEYS_SIZE 13
class Config
{
public:
enum Key {
RecentFiles, Lang, Geometry, // Application
Font, Freq, FreqAuto, Mode, LastCountry, LastGameCode, SelectedFF8Installation, // FF8
LoadPath, SavePath, SavePathIcon, // Load and save
_KeysSize
};
static QString translationDir();
static QString value(Key key, const QString &defaultValue=QString());
static QVariant valueVar(Key key, const QVariant &defaultValue=QVariant());
static void setValue(Key key, const QVariant &value);
static void sync();
static quint32 sec(quint32 time, int freq_value);
static quint32 min(quint32 time, int freq_value);
static quint32 hour(quint32 time, int freq_value);
static quint32 time(quint32 hour, quint32 min, quint32 sec, int freq_value);
static bool mode();
static int freq(const int freq_value=0);
static bool freq_auto();
static void loadRecentFiles();
static void addRecentFile(const QString &path);
static const QString &recentFile(const uint &index);
static bool hasRecentFiles();
static int recentFilesSize();
static void saveRecentFiles();
static void set();
static const QMap<FF8Installation::Type, FF8Installation> &ff8Installations();
static FF8Installation ff8Installation();
static bool ff8IsInstalled(bool &hasSlots);
static void setSelectedFF8Installation(FF8Installation::Type id);
static QTranslator *translator;
private:
static inline QString keyToStr(Key key) {
return keys[int(key)];
}
static QMap<FF8Installation::Type, FF8Installation> _ff8Installations;
static FF8Installation::Type _selectedFF8Installation;
static bool _ff8InstallationsSearched;
static QSettings *settings;
static QStringList recentFiles;
static const char *keys[KEYS_SIZE];
};
#endif // CONFIG_H