now mobile ppp widget has been completed

This commit is contained in:
arcan1s
2014-02-21 21:26:44 +04:00
parent d85e5560fa
commit f3b6457a9b
14 changed files with 256 additions and 83 deletions

View File

@ -18,6 +18,8 @@
#include "ethernetwidget.h"
#include "ui_ethernetwidget.h"
#include <QDir>
#include <QFileDialog>
#include <QFile>
@ -28,7 +30,6 @@ EthernetWidget::EthernetWidget(QWidget *parent)
ui->setupUi(this);
createActions();
clear();
showAdvanced();
}
@ -46,16 +47,32 @@ void EthernetWidget::clear()
ui->comboBox_driver->setCurrentIndex(0);
ui->spinBox_timeoutCarrier->setValue(5);
ui->spinBox_timeoutWpa->setValue(15);
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Hide advanced"));
showAdvanced();
}
void EthernetWidget::createActions()
{
connect(ui->pushButton_ethernetAdvanced, SIGNAL(clicked(bool)), this, SLOT(showAdvanced()));
connect(ui->pushButton_wpaConfig, SIGNAL(clicked(bool)), this, SLOT(selectWpaConfig()));
connect(ui->checkBox_8021x, SIGNAL(stateChanged(int)), this, SLOT(showWpa(int)));
}
void EthernetWidget::selectWpaConfig()
{
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("EthernetWidget", "Select wpa configuration file"),
QDir::currentPath(),
QApplication::translate("EthernetWidget", "Configuration files (*.conf)"));
if (!filename.isEmpty())
ui->lineEdit_wpaConfig->setText(filename);
}
void EthernetWidget::showAdvanced()
{
if (ui->pushButton_ethernetAdvanced->text().indexOf(QString("Show")) > -1) {
@ -104,8 +121,9 @@ QHash<QString, QString> EthernetWidget::getSettings()
int EthernetWidget::isOk()
{
// file wpa_supplicant doesn't exists
if (!QFile(ui->lineEdit_wpaConfig->text()).exists())
return 1;
if (!ui->lineEdit_wpaConfig->text().isEmpty())
if (!QFile(ui->lineEdit_wpaConfig->text()).exists())
return 1;
// all fine
return 0;
}