diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2010-10-31 12:24:15 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2010-10-31 12:24:15 +0000 |
commit | 04ec6d036899a126e2d7fad1523c1c262442423d (patch) | |
tree | 900a2ff7cb58a89b6956f885453744914cb3f5e5 /FaceTrackNoIR/FaceTrackNoIR.cpp | |
parent | b785bbaf8ce50e0e11bd08e8818a613b5add66ed (diff) |
AutoStart feature added
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@27 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/FaceTrackNoIR.cpp')
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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)
|