1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
#ifndef _CONNECTIONWINDOW_H_
#define _CONNECTIONWINDOW_H_
#include <QtGui>
#include <src/gui/connectionFrame.h>
#include <src/gui/connectionList.h>
#include <src/gui/mainWindow.h>
#include <list>
#include <iostream>
#include <math.h>
#include <QSettings>
#include <QPointer>
#define FRAME_DELAY 1000 // to comply with the standard value in the gui
typedef std::pair<QString, QPoint> clientLocation;
typedef QList<clientLocation> clientLocationList;
class ConnectionList;
class PVSClient;
class PVSConnectionManager;
class MainWindow;
class ConnectionFrame;
class QDragEnterEvent;
class QDropEvent;
class ConnectionWindow : public QWidget
{
Q_OBJECT
public:
enum FILLORDER
{
ROW,
COLUMN,
SQUARE,
};
enum VIEWSTYLE
{
FULLSCREEN,
TABLE,
};
ConnectionWindow(QWidget *parent=0);
~ConnectionWindow();
void addFrame(ConnectionFrame *conFrame);
void addFrameBySettings(QString client, QPoint pos);
void showFrameFromSettings();
void onChangeConnections(); // if connections are added or removed, this method makes sure the window changes accordingly
void addConnection(PVSClient* newCon); // handle newly connected clients (forward to con-list)
void removeConnection(PVSClient* newCon); // Remove client on disconnect
void onView();
void updateConnection(PVSClient* newCon); // update stuff like username etc on a present connection
void addVNC();
void onVNCAdd(PVSClient* newCon);
void removeVNC();
void onRemoveConnection(); // tells the PVSConnectionManager to remove the connections that are marked in the sidebar
void onConnectionRemoved(PVSClient* newConnection); // does some cleanup and tells the gui elements that this connection is removed
void setSize(int width, int height, bool forceSquare); // tell the frames to use this size settings
void getCloseupSize(int &width, int &height);
bool getShowDummies();
void setShowDummies(bool show);
QList<ConnectionFrame*> dummyList;
QList<ConnectionFrame*> AllFrameOnWindow;
QList<ConnectionFrame*> getAllFrameOnWindow()
{
return AllFrameOnWindow;
}
void removeFromList(ConnectionFrame* cF);
bool remoteHelp(QString sname);
bool projectStations(QString sname);
bool unprojectStations(QString sname);
bool lockStations();
void lockStation(PVSClient* pvsCon);
bool unlockStations();
void unlockStation(PVSClient* pvsCon);
bool lockAllStations();
bool unlockAllStations();
bool unprojectAllStations();
bool lockInvertStations();
void lockInvertStation(PVSClient* pvsCon);
bool messageStations(QString ident, QString message);
bool commandStations(QString ident, QString message);
void messageStation(QString ident, QString message, PVSClient* pvsCon);
bool lockStationsWithMessage(QString message);
void lockStationsWithMessage(QString message, PVSClient* pvsCon);
bool lockAllStationsWithMessage(QString message);
void setCloseupFrame(ConnectionFrame* cFrame);
int itemAt(ConnectionFrame* cf);
ConnectionFrame* getCloseupFrame();
QList<ConnectionFrame*> getFrameList(){ return frameList; };
clientLocationList ClientLocationList;
bool hasDozent; //if a Dozent machine is available this will be set to true else false
//Frame position in the window
int posX;
int posY;
public Q_SLOTS:
void addDummy();
protected:
QList<ConnectionFrame*> frameList; // list of all connected frames
void mousePressEvent(QMouseEvent *event);
private:
ConnectionFrame* newConFrame(PVSClient* newConnection); // returns a new frame for the given connection
ConnectionFrame* currentSingleFrame; // pointer to the frame thats currently in FullScreen
QPointer<ConnectionFrame> _closeupFrame;
QPoint currentPosition (ConnectionFrame* cF);
QMenu *menu;
QAction *newDummy;
bool ignoreRatio; // wether the native ratio should be ignored or not
bool onFullscreen; // wether on fullscreen or not
bool onCloseup; // wether on closeup or not
int defaultWidth, defaultHeight; // obvious
unsigned int frameRate; // also obvious*/
bool _showDummies;
};
#endif
|