summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-02-02 17:00:48 +0100
committerSimon Rettberg2015-02-02 17:00:48 +0100
commit137413339f8c6e6fe18a78abedccb799e8bf5a5c (patch)
tree656537183b1e6b801b3ca1b6efe44493229f8c25
parentReset debug timeouts, fix autoconnect, remove magic numbers (diff)
downloadpvs2-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
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/client/connectwindow/connectwindow.cpp11
-rw-r--r--src/client/connectwindow/connectwindow.h1
-rw-r--r--src/client/net/serverconnection.cpp2
-rw-r--r--src/client/toolbar/toolbar.cpp7
5 files changed, 18 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8bd593d..dbb348a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,8 +9,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
SET(CMAKE_BUILD_TYPE Debug)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -std=c++11")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++11" )
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -std=c++0x")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x" )
# local cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
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 */