summaryrefslogtreecommitdiffstats
path: root/src/client/clientapp/clientapp.h
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-26 18:31:21 +0200
committerSimon Rettberg2016-10-26 18:31:21 +0200
commite19dcdfed2da5405c714bc0af56927fa8e4c2442 (patch)
treef50f9223c03c2af4e5e3b72b7d69618e0148220a /src/client/clientapp/clientapp.h
parentFix GUI translation: Don't create persistent objects on stack :/ (diff)
downloadpvs2-e19dcdfed2da5405c714bc0af56927fa8e4c2442.tar.gz
pvs2-e19dcdfed2da5405c714bc0af56927fa8e4c2442.tar.xz
pvs2-e19dcdfed2da5405c714bc0af56927fa8e4c2442.zip
[client] Move ServerConnection instance to ClientApp
Diffstat (limited to 'src/client/clientapp/clientapp.h')
-rw-r--r--src/client/clientapp/clientapp.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/clientapp/clientapp.h b/src/client/clientapp/clientapp.h
index 31b2399..8a7fd83 100644
--- a/src/client/clientapp/clientapp.h
+++ b/src/client/clientapp/clientapp.h
@@ -1,7 +1,7 @@
#include<QApplication>
-#include "../toolbar/toolbar.h"
#include "../util/util.h"
-
+#include <QSharedPointer>
+#include <QSettings>
/* define a macro `clientApp` that can be used anywhere in the program and returns a reference to the current ClientApp instance */
#if defined(clientApp)
@@ -9,6 +9,10 @@
#endif
#define clientApp (static_cast<ClientApp*>(QCoreApplication::instance()))
+class Toolbar;
+class ConnectWindow;
+class ServerConnection;
+
/* this class is supposed to (after complete refactoring) to encapsulate all
* state of the application. At the moment, the state is distributed within
* several widgets. With this class information access will also be easier as
@@ -27,6 +31,8 @@ private:
bool _examMode;
QString _sessionName; /* only set when _connectionMode == Session */
Toolbar* _toolbar;
+ ConnectWindow* _connectWindow;
+ ServerConnection* _connection;
QStringList _arguments;
QString _iniPath;
bool _isManagerPc;
@@ -45,5 +51,15 @@ public:
QSharedPointer<QSettings> getSettings();
+ ServerConnection* connection() const { return _connection; }
+
+ ConnectWindow* connectWindow() const { return _connectWindow; }
+
const bool isManagerPc() const { return _isManagerPc; }
+
+private slots:
+
+ void connected(ServerConnection* connection);
+ void disconnected(ServerConnection* connection);
+
};