add support of hidden network (test)

This commit is contained in:
arcan1s 2014-06-04 00:18:04 +04:00
parent 4051d2f2c8
commit cce4ef4811
7 changed files with 47 additions and 4 deletions

View File

@ -1,6 +1,7 @@
Ver.1.1.1:
+ [gui] added suppoort of macvlan
+ [gui] added ability to remove profile
+ [gui] added support of hidden wifi network
Ver.1.1.0 (netctl-1.7 update):
+ [gui] added frequency

View File

@ -851,6 +851,10 @@
<source>Password</source>
<translation>Password</translation>
</message>
<message>
<source>ESSID</source>
<translation>ESSID</translation>
</message>
</context>
<context>
<name>PppoeWidget</name>

View File

@ -851,6 +851,10 @@
<source>Password</source>
<translation>Пароль</translation>
</message>
<message>
<source>ESSID</source>
<translation>ESSID</translation>
</message>
</context>
<context>
<name>PppoeWidget</name>

View File

@ -948,6 +948,13 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
}
void MainWindow::setHiddenName(const QString name)
{
ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 0)->setText(name);
wifiTabStart();
}
void MainWindow::wifiTabStart()
{
if (!checkExternalApps(QString("wpasup"))) {
@ -958,9 +965,15 @@ void MainWindow::wifiTabStart()
if (ui->tableWidget_wifi->currentItem() == 0)
return;
if (ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 0)->text() == QString("<hidden>")) {
ui->pushButton_wifiStart->setDisabled(true);
errorWin = new ErrorWindow(this, 2);
errorWin->show();
passwdWid = new PasswdWidget(this);
passwdWid->setPassword(false);
int widgetWidth = 270;
int widgetHeight = 86;
int x = (width() - widgetWidth) / 2;
int y = (height() - widgetHeight) / 2;
passwdWid->setGeometry(x, y, widgetWidth, widgetHeight);
passwdWid->show();
passwdWid->setFocusToLineEdit();
return;
}
@ -991,6 +1004,7 @@ void MainWindow::wifiTabStart()
return connectToUnknownEssid(QString(""));
else {
passwdWid = new PasswdWidget(this);
passwdWid->setPassword(true);
int widgetWidth = 270;
int widgetHeight = 86;
int x = (width() - widgetWidth) / 2;

View File

@ -62,6 +62,7 @@ public slots:
void updateTabs(const int tab);
// wifi tab slots
void connectToUnknownEssid(const QString passwd);
void setHiddenName(const QString name);
private slots:
void updateMainTab();

View File

@ -18,6 +18,8 @@
#include "passwdwidget.h"
#include "ui_passwdwidget.h"
#include <QLineEdit>
#include "mainwindow.h"
@ -59,6 +61,19 @@ void PasswdWidget::setFocusToLineEdit()
}
void PasswdWidget::setPassword(const bool mode)
{
if (mode) {
ui->lineEdit->setEchoMode(QLineEdit::Password);
ui->label->setText(QApplication::translate("PasswdWidget", "Password"));
}
else {
ui->lineEdit->setEchoMode(QLineEdit::Normal);
ui->label->setText(QApplication::translate("PasswdWidget", "ESSID"));
}
}
void PasswdWidget::cancel()
{
hide();
@ -70,5 +85,8 @@ void PasswdWidget::cancel()
void PasswdWidget::passwdApply()
{
hide();
if (ui->lineEdit->echoMode() == QLineEdit::Normal)
return parent->setHiddenName(ui->lineEdit->text());
else
return parent->connectToUnknownEssid(ui->lineEdit->text());
}

View File

@ -39,6 +39,7 @@ public:
public slots:
void setFocusToLineEdit();
void setPassword(const bool mode = true);
private slots:
void cancel();