Tome
A generic data editor for games supporting arbitrary input and output formats.
settingscontroller.h
1 #ifndef SETTINGSCONTROLLER_H
2 #define SETTINGSCONTROLLER_H
3 
4 #include <QSettings>
5 #include <QStringList>
6 
7 namespace Tome
8 {
13  {
14  public:
20 
25  void addRecentProject(const QString& path);
26 
31  const QStringList getRecentProjects() const;
32 
37  bool getRunIntegrityChecksOnLoad() const;
38 
43  bool getRunIntegrityChecksOnSave() const;
44 
50 
56 
61  bool getExpandRecordTreeOnRefresh() const;
62 
67  const QString getLastProjectPath() const;
68 
73  void removeRecentProject(const QString& path);
74 
79  void setRecentProjects(const QStringList& recentProjects);
80 
85  void setRunIntegrityChecksOnLoad(bool runIntegrityChecksOnLoad);
86 
91  void setRunIntegrityChecksOnSave(bool runIntegrityChecksOnSave);
92 
97  void setShowComponentNamesInRecordTable(bool showComponentNamesInRecordTable);
98 
103  void setShowDescriptionColumnInsteadOfFieldTooltips(bool showDescriptionColumnInsteadOfFieldTooltips);
104 
109  void setExpandRecordTreeOnRefresh(bool expandRecordTreeOnRefresh);
110 
115  void setLastProjectPath(const QString &path);
116 
117  private:
118  static const QString SettingPath;
119  static const QString SettingRecentProjects;
120  static const QString SettingRunIntegrityChecksOnLoad;
121  static const QString SettingRunIntegrityChecksOnSave;
122  static const QString SettingShowComponentNamesInRecordTable;
123  static const QString SettingShowDescriptionColumnInsteadOfFieldTooltips;
124  static const QString SettingExpandRecordTreeOnRefresh;
125  static const QString SettingLastProjectPath;
126 
127  QSettings* settings;
128  };
129 }
130 
131 #endif // SETTINGSCONTROLLER_H
Definition: commandlineoptions.h:6
bool getRunIntegrityChecksOnLoad() const
Gets whether to run all integrity checks after opening a project.
Definition: settingscontroller.cpp:60
void removeRecentProject(const QString &path)
Removes the specified full project path from the list of recent projects.
Definition: settingscontroller.cpp:90
bool getShowComponentNamesInRecordTable() const
Gets whether to show the names of the respective component in front of the field name in the record t...
Definition: settingscontroller.cpp:70
void addRecentProject(const QString &path)
Adds the specified full project path to the list of recent projects.
Definition: settingscontroller.cpp:32
void setRunIntegrityChecksOnLoad(bool runIntegrityChecksOnLoad)
Sets whether to run all integrity checks after opening a project, or not.
Definition: settingscontroller.cpp:110
Controller for accessing user settings.
Definition: settingscontroller.h:12
SettingsController()
Constructs a new controller for accessing user settings.
Definition: settingscontroller.cpp:18
const QStringList getRecentProjects() const
Gets a list of full paths to recently opened projects.
Definition: settingscontroller.cpp:44
void setLastProjectPath(const QString &path)
Sets the full path to the most recently opened project.
Definition: settingscontroller.cpp:145
bool getRunIntegrityChecksOnSave() const
Gets whether to run all integrity checks after saving a project.
Definition: settingscontroller.cpp:65
void setRunIntegrityChecksOnSave(bool runIntegrityChecksOnSave)
Sets whether to run all integrity checks after saving a project, or not.
Definition: settingscontroller.cpp:117
bool getShowDescriptionColumnInsteadOfFieldTooltips() const
Gets whether to show an additional column with the description of all record fields in the record tab...
Definition: settingscontroller.cpp:75
void setExpandRecordTreeOnRefresh(bool expandRecordTreeOnRefresh)
Sets whether to expand all nodes of the record tree every time after it has changed, or not.
Definition: settingscontroller.cpp:138
const QString getLastProjectPath() const
Gets the full path to the most recently opened project.
Definition: settingscontroller.cpp:85
void setShowComponentNamesInRecordTable(bool showComponentNamesInRecordTable)
Sets whether to show the names of the respective component in front of the field name in the record t...
Definition: settingscontroller.cpp:124
void setRecentProjects(const QStringList &recentProjects)
Sets the list of full paths to recently opened projects.
Definition: settingscontroller.cpp:99
bool getExpandRecordTreeOnRefresh() const
Gets whether to expand all nodes of the record tree every time after it has changed.
Definition: settingscontroller.cpp:80
void setShowDescriptionColumnInsteadOfFieldTooltips(bool showDescriptionColumnInsteadOfFieldTooltips)
Sets whether to show an additional column with the description of all record fields in the record tab...
Definition: settingscontroller.cpp:131