Pool Video Switch v2
Software video switch for distributed remote display in a lecture environment
toolbar.h
Go to the documentation of this file.
1 /*
2  # Copyright (c) 2009, 2010 - OpenSLX Project, Computer Center University of
3  # Freiburg
4  #
5  # This program is free software distributed under the GPL version 2.
6  # See http://openslx.org/COPYING
7  #
8  # If you have any feedback please consult http://openslx.org/feedback and
9  # send your suggestions, praise, or complaints to feedback@openslx.org
10  #
11  # General information about OpenSLX can be found at http://openslx.org/
12  */
13 
14 #ifndef PVSCLIENTGUI_H_
15 #define PVSCLIENTGUI_H_
16 
17 #include <QWidget>
18 #include <QTimer>
19 #include "../util/room.h"
20 
21 class ServerConnection;
22 class VncWindow;
23 class BlankScreen;
24 
25 class QMenu;
26 
27 namespace Ui
28 {
29 class Toolbar;
30 }
31 
32 class Toolbar : public QWidget
33 {
34  Q_OBJECT
35 
36 public:
37  explicit Toolbar(QWidget *parent = nullptr);
38  explicit Toolbar(const QByteArray& sessionName, QWidget *parent = nullptr);
39  explicit Toolbar(bool autoConnect, QWidget *parent = nullptr);
40  ~Toolbar() override;
41 
42 private:
43  Ui::Toolbar *_ui{};
44  QMenu *_menu{};
45  QAction *_acnDisconnect{};
46  QAction *_acnConnect{};
47  QAction *_acnInformation{};
48  QAction *_acnAbout{};
49  QAction *_acnQuit{};
50  QTimer _showTimer;
51  QTimer _hideTimer;
53  QTimer _blinkTimer;
55  const QPixmap _cam32, _beWatchedEye;
56  QPoint _lastDragPos;
57 
58  int _yPos{};
59  int _yPosHidden{};
60 
61  void enterEvent(QEvent* e) override;
62  void mousePressEvent(QMouseEvent* event) override;
63  void mouseMoveEvent(QMouseEvent* event) override;
64  static QList<Room> myRooms();
65  static QString identifyMgrIP();
66  void init();
67  void initButtonsAndMenus();
68 
69 private slots:
70  void onVncServerIsRunning(int port);
71  void onDisconnected(ServerConnection* connection);
72  void onConnected(ServerConnection* connection);
73  void onServerAttentionChanged(bool on);
74  void onDoDisconnect();
75  void onBtnAttention();
76  void exit();
77  void cameraBlink();
78  void showBar();
79  void hideBar();
80  void delayedShowBar();
81  void delayedHideBar();
82  void showAboutDialog();
83  void showInformationDialog();
84  void setToolbarPosition(const QRect &geometry);
85 };
86 
87 #endif /* PVSCLIENTGUI_H_ */
void mouseMoveEvent(QMouseEvent *event) override
Definition: toolbar.cpp:250
Toolbar(QWidget *parent=nullptr)
Constructor of the Toolbar.
Definition: toolbar.cpp:83
int _yPos
Definition: toolbar.h:58
Ui::Toolbar * _ui
Definition: toolbar.h:43
void showBar()
This slot shows the toolbar.
Definition: toolbar.cpp:468
QAction * _acnConnect
Definition: toolbar.h:46
void showAboutDialog()
Toolbar::showAboutDialog.
Definition: toolbar.cpp:485
void initButtonsAndMenus()
This function should be called once from the main init() function which in turn should only be called...
Definition: toolbar.cpp:163
void onServerAttentionChanged(bool on)
Definition: toolbar.cpp:425
QTimer _hideTimer
Definition: toolbar.h:51
void delayedHideBar()
Definition: toolbar.cpp:456
QAction * _acnDisconnect
Definition: toolbar.h:45
void delayedShowBar()
Definition: toolbar.cpp:474
static QString identifyMgrIP()
Identifies the responsible manager for this client by searching through the configuration file...
Definition: toolbar.cpp:319
~Toolbar() override
Destructor of the Toolbar.
Definition: toolbar.cpp:222
int _yPosHidden
Definition: toolbar.h:59
QTimer _showTimer
Definition: toolbar.h:50
void hideBar()
This slot hides the toolbar.
Definition: toolbar.cpp:439
QAction * _acnQuit
Definition: toolbar.h:49
const QPixmap _cam32
Definition: toolbar.h:55
void cameraBlink()
A slot for changing the camera icon.
Definition: toolbar.cpp:337
void enterEvent(QEvent *e) override
This event is reimplemented to receive widget enter events.
Definition: toolbar.cpp:239
const QPixmap _beWatchedEye
Definition: toolbar.h:55
QAction * _acnInformation
Definition: toolbar.h:47
int _hideCountdown
Definition: toolbar.h:52
VncWindow * _vnc
Definition: toolbar.h:54
void onConnected(ServerConnection *connection)
A slot for the onConnected signal of the ConnectWindow.
Definition: toolbar.cpp:396
QAction * _acnAbout
Definition: toolbar.h:48
void onDisconnected(ServerConnection *connection)
A slot for the onDisconnected signal of the ConnectWindow.
Definition: toolbar.cpp:374
void exit()
Definition: toolbar.cpp:89
QPoint _lastDragPos
Definition: toolbar.h:56
void mousePressEvent(QMouseEvent *event) override
Definition: toolbar.cpp:245
void setToolbarPosition(const QRect &geometry)
Definition: toolbar.cpp:520
void onBtnAttention()
Definition: toolbar.cpp:508
void onDoDisconnect()
Definition: toolbar.cpp:419
QTimer _blinkTimer
Definition: toolbar.h:53
void showInformationDialog()
Definition: toolbar.cpp:501
QMenu * _menu
Definition: toolbar.h:44
void onVncServerIsRunning(int port)
A slot for the VncServerIsRunning signal.
Definition: toolbar.cpp:354
void init()
Definition: toolbar.cpp:96
static QList< Room > myRooms()
Definition: toolbar.cpp:267