From 4b58d3b01b62809ccc303027a44ea0360b2cc249 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 Feb 2015 17:56:57 +0100 Subject: Restore window state when opening connect window. Reconnect to session when using --auto --- src/client/toolbar/toolbar.cpp | 22 ++++++++++++++++------ 1 file changed, 16 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 9b2b668..d542eb5 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -27,9 +27,11 @@ * widget is deleted when its parent is deleted. */ Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent) - : QWidget(parent) + : QWidget(parent), _hideTimer(this), _blinkTimer(this), _beWatchedEye(":eye") { qDebug() << "sessionName - constructor"; + init(); + _connectWindow->connectToSession(sessionName, ""); } @@ -43,9 +45,11 @@ Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent) * another widget, this widget becomes a child window inside parent. The new * widget is deleted when its parent is deleted. */ -Toolbar::Toolbar(const bool autoConnect, QWidget *parent) : QWidget(parent) +Toolbar::Toolbar(const bool autoConnect, QWidget *parent) + : QWidget(parent), _hideTimer(this), _blinkTimer(this), _beWatchedEye(":eye") { qDebug() << "auto - constructor!"; + init(); if (autoConnect) { // Try getting manager ip. @@ -65,10 +69,16 @@ Toolbar::Toolbar(const bool autoConnect, QWidget *parent) : QWidget(parent) * another widget, this widget becomes a child window inside parent. The new * widget is deleted when its parent is deleted. */ -Toolbar::Toolbar(QWidget *parent) : - QWidget(parent), _ui(new Ui::Toolbar), _hideTimer(this), _connection(NULL), - _blinkTimer(this),_cam32(QPixmap()), _beWatchedEye(":eye") +Toolbar::Toolbar(QWidget *parent) + : QWidget(parent), _hideTimer(this), _blinkTimer(this), _beWatchedEye(":eye") { + init(); +} + +void Toolbar::init() +{ + _ui = new Ui::Toolbar; + _connection = NULL; /* Initialize the GUI */ _ui->setupUi(this); @@ -90,7 +100,7 @@ Toolbar::Toolbar(QWidget *parent) : /* Setup menu */ _menu = new QMenu(this); _acnDisconnect = new QAction(tr("Set &session ID"), this); - _acnAbout= new QAction(tr("&Was ist das hier?"), this); + _acnAbout= new QAction(tr("&What's this?"), this); _acnQuit = new QAction(tr("&Quit"), this); _menu->addAction(_acnDisconnect); _menu->addSeparator(); -- cgit v1.2.3-55-g7522