diff options
author | Simon Rettberg | 2015-02-02 17:56:57 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-02 17:56:57 +0100 |
commit | 4b58d3b01b62809ccc303027a44ea0360b2cc249 (patch) | |
tree | 3ed448ac6525c2bbaac3438b5f58593450aecd97 /src/client/toolbar | |
parent | Try to bring connect window to top more agressively; require c++0x instead of... (diff) | |
download | pvs2-4b58d3b01b62809ccc303027a44ea0360b2cc249.tar.gz pvs2-4b58d3b01b62809ccc303027a44ea0360b2cc249.tar.xz pvs2-4b58d3b01b62809ccc303027a44ea0360b2cc249.zip |
Restore window state when opening connect window. Reconnect to session when using --auto
Diffstat (limited to 'src/client/toolbar')
-rw-r--r-- | src/client/toolbar/toolbar.cpp | 22 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.h | 1 |
2 files changed, 17 insertions, 6 deletions
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(); diff --git a/src/client/toolbar/toolbar.h b/src/client/toolbar/toolbar.h index 84f6d2d..25964c6 100644 --- a/src/client/toolbar/toolbar.h +++ b/src/client/toolbar/toolbar.h @@ -51,6 +51,7 @@ private: void leaveEvent(QEvent* e); void enterEvent(QEvent* e); QString identifyMgrIP(); + void init(); private slots: void onVncServerIsRunning(int port); |