From 867f6eb946365f47470080bbee503d295311bfd2 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Wed, 7 May 2014 14:15:21 +0200 Subject: Hide bar if the menu is left --- src/client/toolbar/toolbar.cpp | 15 +++++++++------ 1 file changed, 9 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 8de9e31..b0ded44 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -32,6 +32,9 @@ Toolbar::Toolbar(QWidget *parent) : /* Create the connect window */ _connectWindow = new ConnectWindow(NULL); + // Connect the signals + connect(_connectWindow, SIGNAL(disconnect()), this, SLOT(onDoDisconnect())); + connect(_connectWindow, SIGNAL(connected(ServerConnection*)), this, SLOT(onConnected(ServerConnection*))); /* Setup menu */ _menu = new QMenu(this); @@ -41,15 +44,15 @@ Toolbar::Toolbar(QWidget *parent) : _menu->addSeparator(); _menu->addAction(_acnQuit); _ui->cmdMenu->setMenu(_menu); + // Connect the signals + connect(_menu, SIGNAL(aboutToHide()), this, SLOT(hideBar())); + connect(_acnDisconnect, SIGNAL(triggered()), _connectWindow, SLOT(show())); + connect(_acnQuit, SIGNAL(triggered()), qApp, SLOT(quit())); - /* Connect the signals */ - connect(_connectWindow, SIGNAL(disconnect()), this, SLOT(onDoDisconnect())); - connect(_connectWindow, SIGNAL(connected(ServerConnection*)), this, SLOT(onConnected(ServerConnection*))); + /* Connect the signals from vnc server */ connect(VncServer::instance(), SIGNAL(started(int, QString&, QString&)), this, SLOT(onVncServerIsRunning(int, QString&, QString&))); - connect(_acnQuit, SIGNAL(triggered()), qApp, SLOT(quit())); - connect(_acnDisconnect, SIGNAL(triggered()), _connectWindow, SLOT(show())); - /* Set location */ + /* Set position */ const QDesktopWidget desktop; const QRect primaryScreen = desktop.screenGeometry(); move(primaryScreen.left() + (primaryScreen.width() - this->width())/2 , primaryScreen.top()); -- cgit v1.2.3-55-g7522