summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohann Latocha2010-11-29 23:49:56 +0100
committerJohann Latocha2010-11-29 23:49:56 +0100
commit37f03f003c997b0f5275d342a9f89da190de7cfb (patch)
treeb234219323a124c2a44e1924aa48cffd4f73f292
parentBetter build script (diff)
downloadpvs-37f03f003c997b0f5275d342a9f89da190de7cfb.tar.gz
pvs-37f03f003c997b0f5275d342a9f89da190de7cfb.tar.xz
pvs-37f03f003c997b0f5275d342a9f89da190de7cfb.zip
[PVSMGR] Fullscreen mode added
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/gui/mainWindow.cpp4
-rw-r--r--src/gui/mainWindow.h2
-rw-r--r--src/pvsmgr.cpp76
-rw-r--r--src/version.h4
5 files changed, 75 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbbdeb0..f45fda8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -449,9 +449,9 @@ ADD_CUSTOM_TARGET( uninstall
SET( CPACK_GENERATOR "DEB;RPM" )
SET( CPACK_SET_DESTDIR "ON" )
SET( CPACK_PACKAGE_NAME "pvs" )
-SET( CPACK_PACKAGE_VERSION_MAJOR "2" )
-SET( CPACK_PACKAGE_VERSION_MINOR "8" )
-SET( CPACK_PACKAGE_VERSION_PATCH "0" )
+SET( CPACK_PACKAGE_VERSION_MAJOR "3" )
+SET( CPACK_PACKAGE_VERSION_MINOR "1" )
+SET( CPACK_PACKAGE_VERSION_PATCH "1" )
SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pool Video Switch" )
SET( CPACK_PACKAGE_DESCRIPTION "")
SET( CPACK_PACKAGE_CONTACT "Simon Wittenberg <wittenb@informatik.uni-freiburg.de>" )
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp
index 476a40f..cb2dc25 100644
--- a/src/gui/mainWindow.cpp
+++ b/src/gui/mainWindow.cpp
@@ -41,8 +41,8 @@ using namespace std;
#include <src/gui/multicastConfigDialog.h>
#include <iostream>
-MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent), ui(new Ui::MainWindow)
+MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) :
+ QMainWindow(parent, flags), ui(new Ui::MainWindow)
{
ui->setupUi(this);
diff --git a/src/gui/mainWindow.h b/src/gui/mainWindow.h
index a8f892d..bbe9c49 100644
--- a/src/gui/mainWindow.h
+++ b/src/gui/mainWindow.h
@@ -41,7 +41,7 @@ class MainWindow : public QMainWindow
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~MainWindow();
//singleton methods
diff --git a/src/pvsmgr.cpp b/src/pvsmgr.cpp
index f543c6d..b9e53f3 100644
--- a/src/pvsmgr.cpp
+++ b/src/pvsmgr.cpp
@@ -16,15 +16,73 @@
#include <QtGui>
#include <QtGui/QDesktopServices>
+#include <getopt.h>
#include "gui/mainWindow.h"
#include "util/consoleLogger.h"
#include "util/CertManager.h"
#include "src/input/i18n.h"
+#include "version.h"
QApplication *qtApp;
+void printHelp()
+{
+ QTextStream qout(stdout);
+ qout << QObject::tr("Usage: pvsmgr/pvsmgrtouch [OPTIONS]...") << endl;
+ qout << QObject::tr("Start the Pool Video Switch Manager.") << endl;
+ qout << QObject::tr("Options:") << endl << endl;
+ qout << "-f or --fullscreen" << "\t" << QObject::tr("Start in fullscreen mode.") << endl;
+ qout << "-h or --help" << "\t\t" << QObject::tr("Show this help text and quit.") << endl;
+ qout << "-v or --version" << "\t\t" << QObject::tr("Show version and quit.") << endl;
+ qout << endl;
+ qout.flush();
+ exit(0);
+}
+
+void printVersion()
+{
+ QTextStream qout(stdout);
+ qout << QObject::tr("Version: ") << VERSION_STRING << endl;
+ qout << endl;
+ qout.flush();
+ exit(0);
+}
+
int main(int argc, char** argv)
{
+ bool fullscreen = false;
+
+ // parse command line arguments
+ int opt = 0;
+ int longIndex = 0;
+ static const char *optString = "hvf?";
+ static const struct option longOpts[] =
+ {
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'v' },
+ { "fullscreen", no_argument, NULL, 'f' }
+ };
+
+ opt = getopt_long( argc, argv, optString, longOpts, &longIndex );
+ while( opt != -1 )
+ {
+ switch( opt )
+ {
+ case 'h':
+ printHelp();
+ break;
+ case 'v':
+ printVersion();
+ break;
+ case 'f':
+ fullscreen = true;
+ break;
+ case '?':
+ exit(1);
+ }
+ opt = getopt_long( argc, argv, optString, longOpts, &longIndex );
+ }
+
//system("openssl genrsa 1024 >~/.pvs/");
qtApp = new QApplication(argc, argv);
qtApp->setOrganizationName("openslx");
@@ -42,15 +100,15 @@ int main(int argc, char** argv)
ConsoleLog writeLine(QString("PVS-Server started."));
QSslKey k = CertManager::getPrivateKey("manager"); // preload key so the gui won't hang later
- /*
- if (k.isNull())
- {
- printf("FATAL: Private key could not be generated or loaded!\n");
- exit(123);
- }
- */
- MainWindow w;
- w.show();
+
+ MainWindow *w;
+ if (fullscreen)
+ w = new MainWindow(0, Qt::FramelessWindowHint);
+ else
+ w = new MainWindow();
+
+ w->show();
+
return qtApp->exec();
}
diff --git a/src/version.h b/src/version.h
index a08c819..eaee67e 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1,2 +1,2 @@
-#define VERSION_STRING "2.8.0"
-#define VERSION_NUMBER 280
+#define VERSION_STRING "3.1.1"
+#define VERSION_NUMBER 311