edited ethernet widget

This commit is contained in:
arcan1s
2014-02-17 22:11:37 +04:00
parent 6b9f9beabc
commit 4e53eaa1ea
3 changed files with 83 additions and 49 deletions

View File

@ -24,6 +24,8 @@ EthernetWidget::EthernetWidget(QWidget *parent)
ui(new Ui::EthernetWidget)
{
ui->setupUi(this);
createActions();
showAdvanced();
}
@ -31,3 +33,44 @@ EthernetWidget::~EthernetWidget()
{
delete ui;
}
void EthernetWidget::clear()
{
ui->checkBox_skip->setCheckState(Qt::Unchecked);
ui->checkBox_8021x->setCheckState(Qt::Unchecked);
ui->lineEdit_wpaConfig->clear();
ui->comboBox_driver->setCurrentIndex(0);
ui->spinBox_timeoutCarrier->setValue(5);
ui->spinBox_timeoutWpa->setValue(15);
}
void EthernetWidget::createActions()
{
connect(ui->pushButton_ethernetAdvanced, SIGNAL(clicked(bool)), this, SLOT(showAdvanced()));
connect(ui->checkBox_8021x, SIGNAL(stateChanged(int)), this, SLOT(showWpa(int)));
}
void EthernetWidget::showAdvanced()
{
if (ui->pushButton_ethernetAdvanced->text().indexOf(QString("Show")) > -1) {
ui->widget_ethernetAdvanced->setShown(true);
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Hide advanced"));
}
else {
ui->widget_ethernetAdvanced->setHidden(true);
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Show advanced"));
}
clear();
}
void EthernetWidget::showWpa(int state)
{
if (state == 0)
ui->widget_wpa->setHidden(true);
else
ui->widget_wpa->setShown(true);
}