From 1d68bb8669151a6af6073e71efa01491be1f4ee9 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 22 Jul 2014 11:17:30 +0200 Subject: Let the client quit if to much params. Let the client be able to connect to the empty session id. --- src/client/toolbar/toolbar.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/client/toolbar/toolbar.cpp') 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*))); -- cgit v1.2.3-55-g7522