Line 1... |
Line 1... |
1 |
#include "SMPreferenceDialog.h"
|
1 |
#include "SMPreferenceDialog.h"
|
2 |
#include "ui_SMPreferenceDialog.h"
|
2 |
#include "ui_SMPreferenceDialog.h"
|
3 |
|
3 |
|
4 |
#include "OpenGLContext.h"
|
4 |
#include "OpenGLContext.h"
|
5 |
#include "Camera.h"
|
5 |
#include "Camera.h"
|
6 |
#include "Codec.h"
|
6 |
#include "Algorithm.h"
|
7 |
|
7 |
|
8 |
using namespace std;
|
8 |
using namespace std;
|
9 |
|
9 |
|
10 |
SMPreferenceDialog::SMPreferenceDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SMPreferenceDialog) {
|
10 |
SMPreferenceDialog::SMPreferenceDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SMPreferenceDialog) {
|
11 |
ui->setupUi(this);
|
11 |
ui->setupUi(this);
|
Line 43... |
Line 43... |
43 |
|
43 |
|
44 |
// Set all elements to current application settings
|
44 |
// Set all elements to current application settings
|
45 |
unsigned int patternModeIndex = ui->patternModeComboBox->findData(settings.value("pattern/mode"));
|
45 |
unsigned int patternModeIndex = ui->patternModeComboBox->findData(settings.value("pattern/mode"));
|
46 |
ui->patternModeComboBox->setCurrentIndex(patternModeIndex);
|
46 |
ui->patternModeComboBox->setCurrentIndex(patternModeIndex);
|
47 |
|
47 |
|
48 |
CodecDir codecDir = (CodecDir)settings.value("pattern/direction", CodecDirHorizontal).toInt();
|
48 |
CodingDir codingDir = (CodingDir)settings.value("pattern/direction", CodingDirHorizontal).toInt();
|
49 |
ui->patternHorizontalCheckBox->setChecked(codecDir & CodecDirHorizontal);
|
49 |
ui->patternHorizontalCheckBox->setChecked(codingDir & CodingDirHorizontal);
|
50 |
ui->patternVerticalCheckBox->setChecked(codecDir & CodecDirVertical);
|
50 |
ui->patternVerticalCheckBox->setChecked(codingDir & CodingDirVertical);
|
51 |
|
51 |
|
52 |
int projectorIndex = ui->projectorComboBox->findData(settings.value("projector/screenNumber"));
|
52 |
int projectorIndex = ui->projectorComboBox->findData(settings.value("projector/screenNumber"));
|
53 |
ui->projectorComboBox->setCurrentIndex(projectorIndex);
|
53 |
ui->projectorComboBox->setCurrentIndex(projectorIndex);
|
54 |
ui->diamondPatternCheckBox->setChecked(settings.value("projector/diamondPattern").toBool());
|
54 |
ui->diamondPatternCheckBox->setChecked(settings.value("projector/diamondPattern").toBool());
|
55 |
|
55 |
|
Line 92... |
Line 92... |
92 |
settings.setValue("pattern/mode", patternMode);
|
92 |
settings.setValue("pattern/mode", patternMode);
|
93 |
|
93 |
|
94 |
// Pattern direction
|
94 |
// Pattern direction
|
95 |
bool patternHorizontal = ui->patternHorizontalCheckBox->isChecked();
|
95 |
bool patternHorizontal = ui->patternHorizontalCheckBox->isChecked();
|
96 |
bool patternVertical = ui->patternVerticalCheckBox->isChecked();
|
96 |
bool patternVertical = ui->patternVerticalCheckBox->isChecked();
|
97 |
CodecDir dir = CodecDirNone;
|
97 |
CodingDir dir = CodingDirNone;
|
98 |
if(patternHorizontal && patternVertical)
|
98 |
if(patternHorizontal && patternVertical)
|
99 |
dir = CodecDirBoth;
|
99 |
dir = CodingDirBoth;
|
100 |
else if(patternHorizontal)
|
100 |
else if(patternHorizontal)
|
101 |
dir = CodecDirHorizontal;
|
101 |
dir = CodingDirHorizontal;
|
102 |
else if(patternVertical)
|
102 |
else if(patternVertical)
|
103 |
dir = CodecDirVertical;
|
103 |
dir = CodingDirVertical;
|
104 |
settings.setValue("pattern/direction", dir);
|
104 |
settings.setValue("pattern/direction", dir);
|
105 |
|
105 |
|
106 |
// Projector
|
106 |
// Projector
|
107 |
int proj = ui->projectorComboBox->itemData(ui->projectorComboBox->currentIndex()).toInt();
|
107 |
int proj = ui->projectorComboBox->itemData(ui->projectorComboBox->currentIndex()).toInt();
|
108 |
settings.setValue("projector/screenNumber", proj);
|
108 |
settings.setValue("projector/screenNumber", proj);
|