mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2024-12-29 03:19:44 +00:00
42ce22f568
Convenience methods for saving and loading integer settings. Versions for QSpinBox and QComboBox are included. Right now, only simple settings are used for it; we have some additional settings that include validation that aren't using these new methods.
53 lines
1.9 KiB
C++
53 lines
1.9 KiB
C++
#ifndef ADVANCEDPAGE_H
|
|
#define ADVANCEDPAGE_H
|
|
|
|
#include <QCompleter>
|
|
#include <QStringListModel>
|
|
|
|
#include "ui_advancedpage.h"
|
|
|
|
#include <components/settings/settings.hpp>
|
|
|
|
namespace Config { class GameSettings; }
|
|
|
|
namespace Launcher
|
|
{
|
|
class AdvancedPage : public QWidget, private Ui::AdvancedPage
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AdvancedPage(Config::GameSettings &gameSettings, QWidget *parent = nullptr);
|
|
|
|
bool loadSettings();
|
|
void saveSettings();
|
|
|
|
public slots:
|
|
void slotLoadedCellsChanged(QStringList cellNames);
|
|
|
|
private slots:
|
|
void on_skipMenuCheckBox_stateChanged(int state);
|
|
void on_runScriptAfterStartupBrowseButton_clicked();
|
|
void slotAnimSourcesToggled(bool checked);
|
|
void slotViewOverShoulderToggled(bool checked);
|
|
|
|
private:
|
|
Config::GameSettings &mGameSettings;
|
|
QCompleter mCellNameCompleter;
|
|
QStringListModel mCellNameCompleterModel;
|
|
|
|
/**
|
|
* Load the cells associated with the given content files for use in autocomplete
|
|
* @param filePaths the file paths of the content files to be examined
|
|
*/
|
|
void loadCellsForAutocomplete(QStringList filePaths);
|
|
static void loadSettingBool(QCheckBox *checkbox, const std::string& setting, const std::string& group);
|
|
static void saveSettingBool(QCheckBox *checkbox, const std::string& setting, const std::string& group);
|
|
static void loadSettingInt(QComboBox *comboBox, const std::string& setting, const std::string& group);
|
|
static void saveSettingInt(QComboBox *comboBox, const std::string& setting, const std::string& group);
|
|
static void loadSettingInt(QSpinBox *spinBox, const std::string& setting, const std::string& group);
|
|
static void saveSettingInt(QSpinBox *spinBox, const std::string& setting, const std::string& group);
|
|
};
|
|
}
|
|
#endif
|