summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-08-26 08:39:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-08-26 08:39:41 +0200
commit4559bdb44ef9b48d74cbc2e38ecdccd5e92d48e3 (patch)
treeaa869b834b036a2bcbf2a53d9cbdc92227b53d46
parentd85bc9cab41a05c5f64b0e11831287a7626263e3 (diff)
ui: auto-refresh config list
-rw-r--r--facetracknoir/ui.cpp6
-rw-r--r--facetracknoir/ui.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 9fd4a91d..3d768d8b 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -49,6 +49,8 @@ MainWindow::MainWindow() :
ui.iconcomboFilter->addItem(x->icon, x->name);
refresh_config_list();
+ connect(&config_list_timer, SIGNAL(timeout()), this, SLOT(refresh_config_list()));
+ config_list_timer.start(1000 * 3);
tie_setting(s.tracker_dll, ui.iconcomboTrackerSource);
tie_setting(s.protocol_dll, ui.iconcomboProtocol);
@@ -76,7 +78,6 @@ MainWindow::MainWindow() :
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()));
- profile_menu.addAction("Refresh configuration list", this, SLOT(refresh_config_list()));
ui.profile_button->setMenu(&profile_menu);
kbd_quit.setEnabled(true);
@@ -201,6 +202,9 @@ extern "C" volatile const char* opentrack_version;
void MainWindow::refresh_config_list()
{
+ if (work)
+ return;
+
if (group::ini_list().size() == 0)
{
QFile filename(group::ini_directory() + "/" OPENTRACK_DEFAULT_CONFIG);
diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h
index 6d15e496..46a97b3f 100644
--- a/facetracknoir/ui.h
+++ b/facetracknoir/ui.h
@@ -40,6 +40,7 @@ class MainWindow : public QMainWindow, private State
mem<QSystemTrayIcon> tray;
QTimer pose_update_timer;
QTimer det_timer;
+ QTimer config_list_timer;
mem<OptionsDialog> options_widget;
mem<MapWidget> mapping_widget;
QShortcut kbd_quit;