mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-17 15:49:59 +00:00
now mobile ppp widget has been completed
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user