Commit c6d5c265 authored by Thiago Santini's avatar Thiago Santini

Makes keys parametrizable

parent 8696d543
#include "CommandManager.h"
#include <QSettings>
#include <QDebug>
// TODO: make these keys configurable
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 @@
#include <QObject>
#include <QEvent>
#include <QKeyEvent>
#include <QSettings>
#include "utils.h"
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