Commit 9d3fa363 authored by Thiago Santini's avatar Thiago Santini

Adds .ini extension to config files

parent 15825fb1
...@@ -25,7 +25,7 @@ Camera::Camera(QString id, QObject *parent) ...@@ -25,7 +25,7 @@ Camera::Camera(QString id, QObject *parent)
connect(ui, SIGNAL(setViewfinderSettings(QCameraViewfinderSettings)), this, SLOT(setViewfinderSettings(QCameraViewfinderSettings)) ); connect(ui, SIGNAL(setViewfinderSettings(QCameraViewfinderSettings)), this, SLOT(setViewfinderSettings(QCameraViewfinderSettings)) );
connect(ui, SIGNAL(setColorCode(int)), this, SLOT(setColorCode(int)) ); connect(ui, SIGNAL(setColorCode(int)), this, SLOT(setColorCode(int)) );
connect(ui, SIGNAL(setParameter(QString,float)), this, SLOT(setParameter(QString,float)) ); connect(ui, SIGNAL(setParameter(QString,float)), this, SLOT(setParameter(QString,float)) );
settings = new QSettings(gCfgDir + "/" + id + " Camera", QSettings::IniFormat); settings = new QSettings(gCfgDir + "/" + id + " Camera.ini", QSettings::IniFormat);
} }
Camera::~Camera() Camera::~Camera()
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
CommandManager::CommandManager(QObject *parent) CommandManager::CommandManager(QObject *parent)
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
QString settingsFileName = QString("%1/CommandManager").arg(gCfgDir); QString settingsFileName = QString("%1/CommandManager.ini").arg(gCfgDir);
bool hasSettings = QFile::exists(settingsFileName); bool hasSettings = QFile::exists(settingsFileName);
QSettings *settings = new QSettings(settingsFileName, QSettings::IniFormat); QSettings *settings = new QSettings(settingsFileName, QSettings::IniFormat);
if (hasSettings) { if (hasSettings) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// We can't include utils.h here because of the global access used for the log // We can't include utils.h here because of the global access used for the log
// and performance monitor widgets. So we define an alternative set function // and performance monitor widgets. So we define an alternative set function
// here for convenience // here for convenience
template<typename T> void erset(const QSettings *settings, const QString key, T &v) template<typename T> void reset(const QSettings *settings, const QString key, T &v)
{ {
if (!settings) if (!settings)
return; return;
...@@ -55,9 +55,9 @@ public slots: ...@@ -55,9 +55,9 @@ public slots:
} }
settings->sync(); settings->sync();
erset(settings, id + " Pos", pos); reset(settings, id + " Pos", pos);
erset(settings, id + " Size", size); reset(settings, id + " Size", size);
erset(settings, id + " Visible", visible); reset(settings, id + " Visible", visible);
move(pos); move(pos);
resize(size); resize(size);
......
...@@ -22,7 +22,7 @@ EyeImageProcessor::EyeImageProcessor(QString id, QObject *parent) ...@@ -22,7 +22,7 @@ EyeImageProcessor::EyeImageProcessor(QString id, QObject *parent)
#ifdef SWIRSKI #ifdef SWIRSKI
availablePupilDetectionMethods.push_back(new Swirski()); availablePupilDetectionMethods.push_back(new Swirski());
#endif #endif
settings = new QSettings(gCfgDir + "/" + id + " ImageProcessor", QSettings::IniFormat); settings = new QSettings(gCfgDir + "/" + id + " ImageProcessor.ini", QSettings::IniFormat);
updateConfig(); updateConfig();
pmIdx = gPerformanceMonitor.enrol(id, "Image Processor"); pmIdx = gPerformanceMonitor.enrol(id, "Image Processor");
......
...@@ -15,7 +15,7 @@ FieldImageProcessor::FieldImageProcessor(QString id, QObject *parent) ...@@ -15,7 +15,7 @@ FieldImageProcessor::FieldImageProcessor(QString id, QObject *parent)
cameraCalibration(NULL), cameraCalibration(NULL),
QObject(parent) QObject(parent)
{ {
settings = new QSettings(gCfgDir + "/" + id + " ImageProcessor", QSettings::IniFormat); settings = new QSettings(gCfgDir + "/" + id + " ImageProcessor.ini", QSettings::IniFormat);
updateConfig(); updateConfig();
dict = getPredefinedDictionary(DICT_4X4_250); dict = getPredefinedDictionary(DICT_4X4_250);
......
...@@ -54,7 +54,7 @@ GazeEstimationWidget::GazeEstimationWidget(QString id, QWidget *parent) : ...@@ -54,7 +54,7 @@ GazeEstimationWidget::GazeEstimationWidget(QString id, QWidget *parent) :
this, SLOT(updateStatus(bool,QString)) ); this, SLOT(updateStatus(bool,QString)) );
// TODO: right now options from widget and gaze estimation are mixed in a single file, separate them // TODO: right now options from widget and gaze estimation are mixed in a single file, separate them
settings = new QSettings(gCfgDir + "/" + "Gaze Estimation", QSettings::IniFormat); settings = new QSettings(gCfgDir + "/" + "Gaze Estimation.ini", QSettings::IniFormat);
cfg.load(settings); cfg.load(settings);
// QSignalBlocker blocker(this) does not block the GUI elements // QSignalBlocker blocker(this) does not block the GUI elements
......
...@@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent) : ...@@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent) :
createExtraMenus(); createExtraMenus();
connect(ui->menuBar, SIGNAL(triggered(QAction*)), this, SLOT(menuOption(QAction*)) ); connect(ui->menuBar, SIGNAL(triggered(QAction*)), this, SLOT(menuOption(QAction*)) );
settings = new QSettings(gCfgDir + "/" + "EyeRecToo", QSettings::IniFormat); settings = new QSettings(gCfgDir + "/" + "EyeRecToo.ini", QSettings::IniFormat);
cfg.load(settings); cfg.load(settings);
ui->statusBar->showMessage( QString("This is version %1").arg(VERSION) ); ui->statusBar->showMessage( QString("This is version %1").arg(VERSION) );
...@@ -564,7 +564,7 @@ void MainWindow::showAboutDialog() ...@@ -564,7 +564,7 @@ void MainWindow::showAboutDialog()
void MainWindow::setupWidget(ERWidget *widget, QSettings* settings, QPushButton *button) void MainWindow::setupWidget(ERWidget *widget, QSettings* settings, QPushButton *button)
{ {
// TODO: we might consider eventually move each ERWidget settings to their own file // TODO: we might consider eventually moving each ERWidget settings to their own file
widget->load(settings); widget->load(settings);
widget->setup(); widget->setup();
......
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