summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR
diff options
context:
space:
mode:
Diffstat (limited to 'FaceTrackNoIR')
-rw-r--r--FaceTrackNoIR/FTNoIR_Preferences.ui24
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp14
2 files changed, 32 insertions, 6 deletions
diff --git a/FaceTrackNoIR/FTNoIR_Preferences.ui b/FaceTrackNoIR/FTNoIR_Preferences.ui
index 63db7fbc..c3fbeff0 100644
--- a/FaceTrackNoIR/FTNoIR_Preferences.ui
+++ b/FaceTrackNoIR/FTNoIR_Preferences.ui
@@ -25,8 +25,8 @@
</property>
<layout class="QVBoxLayout" name="_vertical_layout">
<item>
- <layout class="QHBoxLayout" name="horLayCenter">
- <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
<widget class="QLabel" name="textLabel2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@@ -42,7 +42,7 @@
</property>
</widget>
</item>
- <item>
+ <item row="0" column="1">
<widget class="QSlider" name="slideAutoMinimizeTime">
<property name="toolTip">
<string extracomment="Time after Start Tracker"/>
@@ -55,7 +55,7 @@
</property>
</widget>
</item>
- <item>
+ <item row="0" column="2">
<widget class="QSpinBox" name="spinAutoMinimizeTime">
<property name="toolTip">
<string extracomment="Time after Start Tracker"/>
@@ -68,13 +68,27 @@
</property>
</widget>
</item>
- <item>
+ <item row="0" column="3">
<widget class="QLabel" name="label">
<property name="text">
<string>sec. (after 'Start')</string>
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkAutoStartTracking">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Automatically Start tracking on Startup</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index 8f26d08a..3a259cba 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -55,6 +55,15 @@ QMainWindow(parent, flags)
trayIcon = 0;
setupFaceTrackNoIR();
+
+ //
+ // Read the AutoStartTracking value from the registry. If it is '1', start the Tracker and Minimize...
+ //
+ QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
+ if (settings.value ( "AutoStartTracking", 0 ).toBool()) {
+ startTracker();
+ showMinimized();
+ }
}
/** sets up all objects and connections to buttons */
@@ -171,7 +180,7 @@ void FaceTrackNoIR::getGameProgramName() {
}
//
-// Get the ProgramName from a connected game and display it.
+// Update the Settings, after a value has changed. This way, the Tracker does not have to re-start.
//
void FaceTrackNoIR::updateSettings() {
if ( tracker != NULL ) {
@@ -885,6 +894,7 @@ QWidget( parent , f)
connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
connect(ui.slideAutoMinimizeTime, SIGNAL(valueChanged(int)), this, SLOT(keyChanged(int)));
+ connect(ui.chkAutoStartTracking, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
// Load the settings from the current .INI-file
loadSettings();
@@ -950,6 +960,7 @@ void PreferencesDialog::loadSettings() {
QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
ui.slideAutoMinimizeTime->setValue( settings.value ( "AutoMinimizeTime", 0 ).toInt() );
+ ui.chkAutoStartTracking->setChecked( settings.value ( "AutoStartTracking", 0 ).toBool() );
settingsDirty = false;
@@ -962,6 +973,7 @@ void PreferencesDialog::save() {
QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
settings.setValue( "AutoMinimizeTime", ui.slideAutoMinimizeTime->value() );
+ settings.setValue( "AutoStartTracking", ui.chkAutoStartTracking->isChecked() );
//
// Send a message to the main program, to update the Settings (for the tracker)