diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-27 12:48:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-27 12:48:22 +0200 |
commit | 1edb87b13a58cbb87cbf99ee30cc5ee7eb15003a (patch) | |
tree | 2a50a92f0b206fc5eee43830606cded1c6eed68f /facetracknoir | |
parent | e70bef88fdb5ffdf1c2dcf99ac9e22181d18f5ac (diff) |
Implement game name in the UI, lost previously due to refactoring.
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 8 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.ui | 19 | ||||
-rw-r--r-- | facetracknoir/tracker.cpp | 15 | ||||
-rw-r--r-- | facetracknoir/tracker.h | 1 |
4 files changed, 24 insertions, 19 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index c031f2a8..59efeb60 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -857,7 +857,7 @@ void FaceTrackNoIR::startTracker( ) { /** stop tracking the face **/
void FaceTrackNoIR::stopTracker( ) {
-
+ ui.game_name->setText("Not connected");
#if defined(_WIN32) || defined(__WIN32)
if (keybindingWorker)
{
@@ -1002,7 +1002,11 @@ void FaceTrackNoIR::showHeadPose() { if (_curve_config) {
_curve_config->update();
}
-
+ if (Libraries->pProtocol)
+ {
+ QString name = Libraries->pProtocol->getGameName();
+ ui.game_name->setText(name);
+ }
}
/** toggles Video Widget **/
diff --git a/facetracknoir/facetracknoir.ui b/facetracknoir/facetracknoir.ui index d91a6a92..63107a80 100644 --- a/facetracknoir/facetracknoir.ui +++ b/facetracknoir/facetracknoir.ui @@ -848,7 +848,7 @@ QGroupBox { <property name="geometry">
<rect>
<x>20</x>
- <y>20</y>
+ <y>10</y>
<width>400</width>
<height>25</height>
</rect>
@@ -1339,6 +1339,23 @@ background:none;</string> <string>Roll</string>
</property>
</widget>
+ <widget class="QLabel" name="game_name">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>40</y>
+ <width>411</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color:#ccc;
+background:none;</string>
+ </property>
+ <property name="text">
+ <string>Not connected</string>
+ </property>
+ </widget>
</widget>
<widget class="QFrame" name="video_frame">
<property name="geometry">
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index ca7d71fb..7320abaf 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -263,21 +263,6 @@ void Tracker::run() { }
//
-// Get the ProgramName from the Game and return it.
-//
-QString Tracker::getGameProgramName() {
-QString str;
-char dest[100];
-
- str = QString("No protocol active?");
- if (Libraries->pProtocol) {
- Libraries->pProtocol->getNameFromGame( dest );
- str = QString( dest );
- }
- return str;
-}
-
-//
// Handle the command, send upstream by the game.
// Valid values are:
// 1 = reset Headpose
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index 59e0f19c..035a88ed 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -156,7 +156,6 @@ public: // void registerHeadPoseCallback();
bool handleGameCommand ( int command );
- QString getGameProgramName(); // Get the ProgramName from the game and display it.
void loadSettings(); // Load settings from the INI-file
//bool isShortKeyPressed( TShortKey *key, BYTE *keystate );
//bool isMouseKeyPressed( int *key, DIMOUSESTATE *mousestate );
|