summaryrefslogtreecommitdiffstats
path: root/src/client/toolbar/toolbar.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-07-22 11:17:30 +0200
committerManuel Schneider2014-07-22 11:17:30 +0200
commit1d68bb8669151a6af6073e71efa01491be1f4ee9 (patch)
treedcbaa7319fb040674f86d44e816b8bc5a04b32b1 /src/client/toolbar/toolbar.cpp
parentMark task in todolist (diff)
downloadpvs2-1d68bb8669151a6af6073e71efa01491be1f4ee9.tar.gz
pvs2-1d68bb8669151a6af6073e71efa01491be1f4ee9.tar.xz
pvs2-1d68bb8669151a6af6073e71efa01491be1f4ee9.zip
Let the client quit if to much params. Let the client be able to connect to the empty session id.
Diffstat (limited to 'src/client/toolbar/toolbar.cpp')
-rw-r--r--src/client/toolbar/toolbar.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp
index 9bc5998..954bf24 100644
--- a/src/client/toolbar/toolbar.cpp
+++ b/src/client/toolbar/toolbar.cpp
@@ -14,7 +14,25 @@
#include "ui_toolbar.h"
/***************************************************************************//**
- * Constructor of the Toolbar. Constructs a widget which is a child of parent.
+ * @brief Constructor of the Toolbar.
+ *
+ * Does exact teh same as Toolbar::Toolbar(QWidget *parent) but additionally
+ * instantly tries to connect to a pvsmgr with the given sessionName.
+ * @param sessionName The session to connect to.
+ * @param parent If parent is 0, the new widget becomes a window. If parent is
+ * another widget, this widget becomes a child window inside parent. The new
+ * widget is deleted when its parent is deleted.
+ */
+Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent)
+ : Toolbar(parent)
+{
+ _connectWindow->connectToSession(sessionName);
+}
+
+/***************************************************************************//**
+ * @brief Constructor of the Toolbar.
+ *
+ * Constructs a widget which is a child of parent.
* Initialize the GUI and sets up the menu, sets window properties, create the
* VNC- and connect-window, connects the necessary signals, sets the UI's
* position and configuires the timer for the UI to be hidden.
@@ -22,7 +40,7 @@
* another widget, this widget becomes a child window inside parent. The new
* widget is deleted when its parent is deleted.
*/
-Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent) :
+Toolbar::Toolbar(QWidget *parent) :
QWidget(parent), _ui(new Ui::Toolbar), _hideTimer(this), _connection(NULL),
_blinkTimer(this),_cam32(":cam32.svg"), _beWatchedEye(":eye")
{
@@ -40,10 +58,7 @@ Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent) :
/* Create the connect window */
_connectWindow = new ConnectWindow(NULL);
- if (!sessionName.isEmpty())
- {
- _connectWindow->connectToSession(sessionName);
- }
+
// Connect the signals
connect(_connectWindow, SIGNAL(disconnect()), this, SLOT(onDoDisconnect()));
connect(_connectWindow, SIGNAL(connected(ServerConnection*)), this, SLOT(onConnected(ServerConnection*)));