void OptionsWindow::on_RestoreAP_clicked() { /* Resets all values tab "Hostapd" */ QMessageBox msgBox; msgBox.setText(tr("factory reset")); msgBox.setIcon(QMessageBox::Warning); msgBox.setInformativeText(tr("Caution All settings will be reset to the original. proceed?")); msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Cancel); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Ok: ui->IP_SERVER->setText("192.168.0.1"); ui->MASKA->setText("255.255.255.0"); ui->SSID->setText("MyWiFI_AP"); ui->ShowSSID->setChecked(false); ui->driver->setCurrentIndex(1); ui->Iface->setCurrentIndex(0); ui->TypeAP->setCurrentIndex(0); ui->Protection->setCurrentIndex(1); ui->CountryCode->setCurrentIndex(0); ui->Channels->setCurrentIndex(6); QDateTime TimeNow; QString dateUNIXNow; dateUNIXNow = QString::number(TimeNow.currentDateTime().toTime_t()); emit toMainLog(QString("%1|%2|%3|%4").arg(tr("Options"), dateUNIXNow, tr("Hostapd settings set to default."), QString("1"))); on_APSave_clicked(false); break; } }
void OptionsWindow::on_RestoreAP_clicked() { /* Обнуляем все значения на вкладке "Hostapd" */ QMessageBox msgBox; msgBox.setText(tr("Сброс данных")); msgBox.setIcon(QMessageBox::Warning); msgBox.setInformativeText(tr("Внимание! Все настройки будут сброшены до первоначальных. Продолжить?")); msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Cancel); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Ok: ui->IP_SERVER->setText("192.168.0.1"); ui->MASKA->setText("255.255.255.0"); ui->SSID->setText("MyWiFI_AP"); ui->ShowSSID->setChecked(false); ui->driver->setCurrentIndex(1); ui->Iface->setCurrentIndex(0); ui->TypeAP->setCurrentIndex(0); ui->Protection->setCurrentIndex(1); ui->CountryCode->setCurrentIndex(0); ui->Channels->setCurrentIndex(6); QDateTime TimeNow; QString dateUNIXNow; dateUNIXNow = QString::number(TimeNow.currentDateTime().toTime_t()); emit toMainLog(QString("%1|%2|%3|%4").arg(tr("Options"), dateUNIXNow, tr("Hostapd settings set to default."), QString("1"))); on_APSave_clicked(false); break; } }