summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r--facetracknoir/ui.cpp23
1 files changed, 21 insertions, 2 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();
}