diff options
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r-- | facetracknoir/ui.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 0876c848..6437b9d1 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -76,6 +76,9 @@ MainWindow::MainWindow() : connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose())); connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); + save_timer.setSingleShot(true); + connect(&save_timer, SIGNAL(timeout()), this, SLOT(_save())); + profile_menu.addAction("Create new empty config", this, SLOT(make_empty_config())); profile_menu.addAction("Create new copied config", this, SLOT(make_copied_config())); profile_menu.addAction("Open configuration directory", this, SLOT(open_config_directory())); @@ -116,10 +119,12 @@ bool MainWindow::get_new_config_name_from_dialog(QString& ret) MainWindow::~MainWindow() { + save_timer.stop(); + if (tray) tray->hide(); stopTracker(); - save(); + _save(); } void MainWindow::set_working_directory() @@ -131,7 +136,13 @@ void MainWindow::save_mappings() { pose.save_mappings(); } -void MainWindow::save() { +void MainWindow::save() +{ + save_timer.stop(); + save_timer.start(5000); +} + +void MainWindow::_save() { s.b->save(); save_mappings(); mem<QSettings> settings = group::ini_file(); |