diff options
-rw-r--r-- | gui/client/connect.ui | 89 | ||||
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 8 | ||||
-rw-r--r-- | src/client/connectwindow/connectwindow.h | 1 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.cpp | 13 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.h | 1 |
5 files changed, 66 insertions, 46 deletions
diff --git a/gui/client/connect.ui b/gui/client/connect.ui index a108fe8..8adfd2b 100644 --- a/gui/client/connect.ui +++ b/gui/client/connect.ui @@ -10,7 +10,7 @@ <x>0</x> <y>0</y> <width>512</width> - <height>92</height> + <height>150</height> </rect> </property> <property name="minimumSize"> @@ -29,47 +29,27 @@ <bool>false</bool> </property> <property name="currentIndex"> - <number>1</number> + <number>0</number> </property> <widget class="QWidget" name="page0"> <layout class="QVBoxLayout" name="sl_p0_vl"> <property name="spacing"> <number>0</number> </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> + <property name="margin"> <number>0</number> </property> <item> <widget class="QLabel" name="lblSessionName"> <property name="text"> - <string>Session Name:</string> + <string>Automatically selected session</string> </property> </widget> </item> <item> <widget class="QLineEdit" name="lineEditName"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> - </property> - <property name="text"> - <string notr="true"/> + <property name="readOnly"> + <bool>true</bool> </property> </widget> </item> @@ -95,18 +75,32 @@ </item> </layout> </widget> + <widget class="QWidget" name="page"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Advanced Options</string> + </property> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Specify Session Name</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="lineEdit_2"/> + </item> + </layout> + </widget> + </item> + </layout> + </widget> <widget class="QWidget" name="page1"> <layout class="QHBoxLayout" name="sw_p1_hl"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> + <property name="margin"> <number>0</number> </property> <item> @@ -154,15 +148,9 @@ </widget> </item> <item> - <widget class="QPushButton" name="btn_hide"> + <widget class="QPushButton" name="btn_advanced"> <property name="text"> - <string>Hide</string> - </property> - <property name="autoDefault"> - <bool>false</bool> - </property> - <property name="default"> - <bool>false</bool> + <string>Advanced...</string> </property> </widget> </item> @@ -179,6 +167,19 @@ </property> </spacer> </item> + <item> + <widget class="QPushButton" name="btn_hide"> + <property name="text"> + <string>Cancel</string> + </property> + <property name="autoDefault"> + <bool>false</bool> + </property> + <property name="default"> + <bool>false</bool> + </property> + </widget> + </item> </layout> </item> </layout> diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp index 6fd92e6..818cbd2 100644 --- a/src/client/connectwindow/connectwindow.cpp +++ b/src/client/connectwindow/connectwindow.cpp @@ -40,6 +40,7 @@ ConnectWindow::ConnectWindow(QWidget *parent) : QWidget(parent) // Set actions of buttons connect(_ui->btn_connection, SIGNAL(clicked()), this, SLOT(onBtnConnection())); connect(_ui->btn_hide, SIGNAL(clicked()), this, SLOT(onBtnHide())); + connect(_ui->btn_advanced, SIGNAL(clicked()), this, SLOT(onBtnAdvanced())); // React on discovery signal connect(&_serverDiscovery, SIGNAL(serverDetected(QString,quint16,QByteArray,QByteArray,bool)), @@ -291,3 +292,10 @@ void ConnectWindow::onConnectionDisconnected() connectToSession(_currentSession, _currentIp); } } +void ConnectWindow::onBtnAdvanced() { + if (_ui->stackedWidget->currentIndex()== 1) { + _ui->stackedWidget->setCurrentIndex(0); + } else { + _ui->stackedWidget->setCurrentIndex(1); + } +} diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h index bc8a4ba..9daa420 100644 --- a/src/client/connectwindow/connectwindow.h +++ b/src/client/connectwindow/connectwindow.h @@ -78,6 +78,7 @@ protected: protected slots: void doShow(); void onBtnConnection(); + void onBtnAdvanced(); void onBtnHide(); void onConnectionStateChange(ConnectWindow::ConnectionState state); diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index 964561e..64fc5dc 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -104,9 +104,13 @@ void Toolbar::init() /* Setup menu */ _menu = new QMenu(this); - _acnDisconnect = new QAction(tr("Set &session ID"), this); + _acnConnect = new QAction(tr("&Connect..."), this); + _acnDisconnect = new QAction(tr("&Disconnect"), this); + _acnDisconnect->setEnabled(false); _acnAbout= new QAction(tr("&What's this?"), this); _acnQuit = new QAction(tr("&Quit"), this); + + _menu->addAction(_acnConnect); _menu->addAction(_acnDisconnect); _menu->addSeparator(); _menu->addAction(_acnAbout); @@ -116,7 +120,7 @@ void Toolbar::init() // Connect the signals connect(_menu, SIGNAL(aboutToHide()), this, SLOT(hideBar())); - connect(_acnDisconnect, SIGNAL(triggered()), _connectWindow, SLOT(doShow())); + connect(_acnConnect, SIGNAL(triggered()), _connectWindow, SLOT(doShow())); connect(_acnAbout, SIGNAL(triggered()), this, SLOT(showAboutDialog())); connect(_acnQuit, SIGNAL(triggered()), this, SLOT(exit())); @@ -298,6 +302,8 @@ void Toolbar::onDisconnected() */ void Toolbar::onConnected(ServerConnection* connection) { + + this->_acnConnect->setEnabled(false); _ui->lblStatus->setStyleSheet("color:green"); _ui->lblStatus->setText(tr("Online")); // @@ -322,6 +328,9 @@ void Toolbar::onDoDisconnect() { if (_connection != NULL) _connection->disconnectFromServer(); + + this->_acnConnect->setEnabled(true); + this->_acnDisconnect->setEnabled(false); } /***************************************************************************//** diff --git a/src/client/toolbar/toolbar.h b/src/client/toolbar/toolbar.h index 27849cf..c3c727c 100644 --- a/src/client/toolbar/toolbar.h +++ b/src/client/toolbar/toolbar.h @@ -39,6 +39,7 @@ private: Ui::Toolbar *_ui; QMenu *_menu; QAction *_acnDisconnect; + QAction *_acnConnect; QAction *_acnAbout; QAction *_acnQuit; ConnectWindow *_connectWindow; |