Commit c6d5c265 authored by Thiago Santini's avatar Thiago Santini

Makes keys parametrizable

parent 8696d543
#include "CommandManager.h" #include "CommandManager.h"
#include <QSettings>
#include <QDebug> #include <QDebug>
// TODO: make these keys configurable // TODO: make these keys configurable
CommandManager::CommandManager(QObject *parent) CommandManager::CommandManager(QObject *parent)
{ {
Q_UNUSED(parent);
QString settingsFileName = QString("%1/CommandManager").arg(gCfgDir);
bool hasSettings = QFile::exists(settingsFileName);
QSettings *settings = new QSettings(settingsFileName, QSettings::IniFormat);
if (hasSettings) {
calibrationToggleKey = settings->value("calibrationToggleKey").toInt();
recordingToggleKey = settings->value("recordingToggleKey").toInt();
previewToggleKey = settings->value("previewToggleKey").toInt();
} else {
settings->setValue("calibrationToggleKey", calibrationToggleKey);
settings->setValue("recordingToggleKey", recordingToggleKey);
settings->setValue("previewToggleKey", previewToggleKey);
}
settings->deleteLater();
} }
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include <QObject> #include <QObject>
#include <QEvent> #include <QEvent>
#include <QKeyEvent> #include <QKeyEvent>
#include <QSettings>
#include "utils.h"
class CommandManager : public QObject class CommandManager : public QObject
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment