diff options
author | Simon Rettberg | 2015-02-02 17:00:48 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-02 17:00:48 +0100 |
commit | 137413339f8c6e6fe18a78abedccb799e8bf5a5c (patch) | |
tree | 656537183b1e6b801b3ca1b6efe44493229f8c25 /src | |
parent | Reset debug timeouts, fix autoconnect, remove magic numbers (diff) | |
download | pvs2-137413339f8c6e6fe18a78abedccb799e8bf5a5c.tar.gz pvs2-137413339f8c6e6fe18a78abedccb799e8bf5a5c.tar.xz pvs2-137413339f8c6e6fe18a78abedccb799e8bf5a5c.zip |
Try to bring connect window to top more agressively; require c++0x instead of c++11 so it compiles on gcc 4.6
Diffstat (limited to 'src')
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 11 | ||||
-rw-r--r-- | src/client/connectwindow/connectwindow.h | 1 | ||||
-rw-r--r-- | src/client/net/serverconnection.cpp | 2 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.cpp | 7 |
4 files changed, 16 insertions, 5 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp index b84f22c..8631b43 100644 --- a/src/client/connectwindow/connectwindow.cpp +++ b/src/client/connectwindow/connectwindow.cpp @@ -32,7 +32,7 @@ ConnectWindow::ConnectWindow(QWidget *parent) : QWidget(parent) _ui->setupUi(this); // Set window properties - setWindowFlags(Qt::WindowStaysOnTopHint); + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool); // Set page 0 as default _ui->stackedWidget->setCurrentIndex(0); @@ -142,12 +142,21 @@ void ConnectWindow::closeEvent(QCloseEvent *e) this->hide(); } +void ConnectWindow::doShow() +{ + show(); + activateWindow(); + raise(); +} + /***************************************************************************//** * Gives the keyboard input focus to the input line. * @param event */ void ConnectWindow::showEvent(QShowEvent* event) { + activateWindow(); + raise(); _ui->lineEditName->setFocus(); } diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h index ab59e00..7cf52c3 100644 --- a/src/client/connectwindow/connectwindow.h +++ b/src/client/connectwindow/connectwindow.h @@ -75,6 +75,7 @@ protected: void showEvent(QShowEvent* event); protected slots: + void doShow(); void onBtnConnection(); void onBtnHide(); diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp index 46cba79..c81bfb4 100644 --- a/src/client/net/serverconnection.cpp +++ b/src/client/net/serverconnection.cpp @@ -19,7 +19,7 @@ #define CHALLENGE_LEN 20 ServerConnection::ServerConnection(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect) : - QObject(NULL), _timerDelete(0), _jpegQuality(80), _authed(0), _sessionName(sessionName), _certHash(certHash), _autoConnect(autoConnect) + QObject(NULL), _timerDelete(0), _jpegQuality(80), _authed(0), _autoConnect(autoConnect), _sessionName(sessionName), _certHash(certHash) { _socket = new QSslSocket(); _blank = new BlankScreen(); diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index e3859fd..9b2b668 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -27,7 +27,7 @@ * widget is deleted when its parent is deleted. */ Toolbar::Toolbar(const QByteArray sessionName, QWidget *parent) - : Toolbar(parent) + : QWidget(parent) { qDebug() << "sessionName - constructor"; _connectWindow->connectToSession(sessionName, ""); @@ -43,7 +43,7 @@ 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) : Toolbar(parent) +Toolbar::Toolbar(const bool autoConnect, QWidget *parent) : QWidget(parent) { qDebug() << "auto - constructor!"; @@ -101,7 +101,7 @@ Toolbar::Toolbar(QWidget *parent) : // Connect the signals connect(_menu, SIGNAL(aboutToHide()), this, SLOT(hideBar())); - connect(_acnDisconnect, SIGNAL(triggered()), _connectWindow, SLOT(show())); + connect(_acnDisconnect, SIGNAL(triggered()), _connectWindow, SLOT(doShow())); connect(_acnAbout, SIGNAL(triggered()), this, SLOT(showAboutDialog())); connect(_acnQuit, SIGNAL(triggered()), qApp, SLOT(quit())); @@ -119,6 +119,7 @@ Toolbar::Toolbar(QWidget *parent) : _hideTimer.setSingleShot(true); connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideBar())); setVisible(true); + activateWindow(); _hideTimer.start(); // initially show PVS and hide later /* Setup blink timer */ |