summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-17 08:28:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-17 08:28:51 +0200
commite3a5755b1c675e66163a879ee5e5290bf0b01251 (patch)
tree4de6d67c1b157459d92653e201b0a3846d40d8f7 /facetracknoir
parentfe8fa2db6a8b01e06d6fa7129a38211ce164895e (diff)
parent45b346cc1a4a7b7e6716ec8ee0f58ad03c60d865 (diff)
Merge branch 'unstable' into trackhat-ui
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/ui.cpp23
-rw-r--r--facetracknoir/ui.h9
2 files changed, 23 insertions, 9 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 88a44216..4d74aa07 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -175,11 +175,11 @@ extern "C" volatile const char* opentrack_version;
void MainWindow::fill_profile_combobox()
{
QStringList ini_list = group::ini_list();
- QString current = QFileInfo(group::ini_pathname()).fileName();
- setWindowTitle(QStringLiteral("TrackHat ") + QString( const_cast<const char*>(opentrack_version) + QStringLiteral(" :: ")) + current);
+ set_title();
ui.iconcomboProfile->clear();
for (auto x : ini_list)
ui.iconcomboProfile->addItem(QIcon(":/images/settings16.png"), x);
+ QString current = QFileInfo(group::ini_pathname()).fileName();
ui.iconcomboProfile->setCurrentText(current);
}
@@ -261,6 +261,8 @@ void MainWindow::stopTracker( ) {
display_pose(p, p);
}
updateButtonState(false, false);
+
+ set_title();
}
void MainWindow::display_pose(const double *mapped, const double *raw)
@@ -292,6 +294,20 @@ void MainWindow::display_pose(const double *mapped, const double *raw)
ui.pose_yaw->display(mapped_[Yaw]);
ui.pose_pitch->display(mapped_[Pitch]);
ui.pose_roll->display(mapped_[Roll]);
+
+ QString game_title;
+ if (libs.pProtocol)
+ game_title = libs.pProtocol->game_name();
+ set_title(game_title);
+}
+
+void MainWindow::set_title(const QString& game_title_)
+{
+ QString game_title;
+ if (game_title_ != "")
+ game_title = " :: " + game_title_;
+ QString current = QFileInfo(group::ini_pathname()).fileName();
+ setWindowTitle(QStringLiteral("TrackHat ") + const_cast<const char*>(opentrack_version) + QStringLiteral(" :: ") + current + game_title);
}
void MainWindow::showHeadPose()
@@ -402,6 +418,9 @@ void MainWindow::profileSelected(int index)
settings.setValue (OPENTRACK_CONFIG_FILENAME_KEY, remove_app_path(QFileInfo(group::ini_pathname()).absolutePath() + "/" +
ui.iconcomboProfile->itemText(index)));
}
+
+ set_title();
+
load_settings();
}
diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h
index 1a4ce5cb..ccd82e5b 100644
--- a/facetracknoir/ui.h
+++ b/facetracknoir/ui.h
@@ -25,18 +25,12 @@
#pragma once
#include <QMainWindow>
-#include <QApplication>
-#include <QWidget>
-#include <QDialog>
-#include <QUrl>
-#include <QList>
#include <QKeySequence>
#include <QShortcut>
-#include <QLayout>
#include <QPixmap>
-#include <QLabel>
#include <QTimer>
#include <QSystemTrayIcon>
+#include <QString>
#if !defined(_WIN32)
# include "qxt-mini/QxtGlobalShortcut"
@@ -87,6 +81,7 @@ class MainWindow : public QMainWindow, private State
void fill_profile_combobox();
void display_pose(const double* mapped, const double* raw);
void ensure_tray();
+ void set_title(const QString& game_title = QStringLiteral(""));
public slots:
void shortcutRecentered();
void shortcutToggled();