|
43 | 43 |
|
44 | 44 | #include <deflect/Server.h> |
45 | 45 | #include <deflect/Stream.h> |
| 46 | +#include <deflect/version.h> |
46 | 47 |
|
47 | 48 | #include <iostream> |
48 | 49 |
|
@@ -181,6 +182,14 @@ void MainWindow::_setupUI() |
181 | 182 | toolbar->addAction( _shareDesktopAction ); |
182 | 183 | toolbar->addAction( _showDesktopSelectionWindowAction ); |
183 | 184 |
|
| 185 | + // add About dialog |
| 186 | + QAction* showAboutDialog = new QAction( "About", this ); |
| 187 | + showAboutDialog->setStatusTip( "About DesktopStreamer" ); |
| 188 | + connect( showAboutDialog, &QAction::triggered, |
| 189 | + this, &MainWindow::_openAboutWidget ); |
| 190 | + QMenu* helpMenu = menuBar()->addMenu( "&Help" ); |
| 191 | + helpMenu->addAction( showAboutDialog ); |
| 192 | + |
184 | 193 | // Update timer |
185 | 194 | connect( &_updateTimer, SIGNAL( timeout( )), this, SLOT( _update( ))); |
186 | 195 |
|
@@ -451,6 +460,18 @@ void MainWindow::_onStreamEventsBoxClicked( const bool checked ) |
451 | 460 | #endif |
452 | 461 | } |
453 | 462 |
|
| 463 | +void MainWindow::_openAboutWidget() |
| 464 | +{ |
| 465 | + const int revision = deflect::Version::getRevision(); |
| 466 | + |
| 467 | + std::ostringstream aboutMsg; |
| 468 | + aboutMsg << "Current version: " << deflect::Version::getString(); |
| 469 | + aboutMsg << std::endl; |
| 470 | + aboutMsg << "SCM revision: " << std::hex << revision << std::dec; |
| 471 | + |
| 472 | + QMessageBox::about( this, "About DesktopStreamer", aboutMsg.str().c_str( )); |
| 473 | +} |
| 474 | + |
454 | 475 | #ifdef __APPLE__ |
455 | 476 | void sendMouseEvent( const CGEventType type, const CGMouseButton button, |
456 | 477 | const CGPoint point ) |
|
0 commit comments