parent
807b01d5d2
commit
b9139483e1
@ -0,0 +1,47 @@
|
|||||||
|
#include "wifisettings.h"
|
||||||
|
#include "ui_genericsettings.h"
|
||||||
|
|
||||||
|
WifiSettings::WifiSettings(QString connUuidStr, QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::GenericSettings)
|
||||||
|
{
|
||||||
|
targetConnUuidStr = connUuidStr;
|
||||||
|
ui->setupUi(this);
|
||||||
|
QVariantMap connSettings = ConnectionSettingsEngine::readConnectionSettings(connUuidStr);
|
||||||
|
this->setWindowTitle(connSettings["connName"].toString());
|
||||||
|
ui->connectionNameLineEdit->setText(connSettings["connName"].toString());
|
||||||
|
generalSettingsTab = new GeneralSettingsTab();
|
||||||
|
ipv4SettingsTab = new Ipv4SettingsTab();
|
||||||
|
ipv6SettingsTab = new Ipv6SettingsTab();
|
||||||
|
ui->tabWidget->addTab(generalSettingsTab, tr("General"));
|
||||||
|
ui->tabWidget->addTab(ipv4SettingsTab, tr("IPv4"));
|
||||||
|
ui->tabWidget->addTab(ipv6SettingsTab, tr("IPv6"));
|
||||||
|
generalSettingsTab->loadSettings(connSettings);
|
||||||
|
ipv4SettingsTab->loadSettings(connSettings);
|
||||||
|
ipv6SettingsTab->loadSettings(connSettings);
|
||||||
|
connect(ui->cancelButton, &QPushButton::clicked, this, &WifiSettings::onCancelButtonClicked);
|
||||||
|
connect(ui->saveButton, &QPushButton::clicked, this, &WifiSettings::onSaveButtonClicked);
|
||||||
|
}
|
||||||
|
|
||||||
|
WifiSettings::~WifiSettings()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
delete generalSettingsTab;
|
||||||
|
delete ipv4SettingsTab;
|
||||||
|
delete ipv6SettingsTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WifiSettings::onCancelButtonClicked()
|
||||||
|
{
|
||||||
|
this->done(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WifiSettings::onSaveButtonClicked()
|
||||||
|
{
|
||||||
|
QVariantMap settings = generalSettingsTab->readSettings();
|
||||||
|
settings.insert(ipv4SettingsTab->readSettings());
|
||||||
|
settings.insert(ipv6SettingsTab->readSettings());
|
||||||
|
settings.insert("connName", ui->connectionNameLineEdit->text());
|
||||||
|
ConnectionSettingsEngine::modifyConnectionSettings(targetConnUuidStr, settings);
|
||||||
|
this->done(0);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
#ifndef WIFISETTINGS_H
|
||||||
|
#define WIFISETTINGS_H
|
||||||
|
|
||||||
|
#include "connectionsettingsengine.h"
|
||||||
|
#include "generalsettingstab.h"
|
||||||
|
#include "security802_1xtab.h"
|
||||||
|
#include "ipv4settingstab.h"
|
||||||
|
#include "ipv6settingstab.h"
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class GenericSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
class WifiSettings : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit WifiSettings(QString connUuidStr, QWidget *parent = nullptr);
|
||||||
|
~WifiSettings();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onCancelButtonClicked();
|
||||||
|
void onSaveButtonClicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::GenericSettings *ui;
|
||||||
|
|
||||||
|
QString targetConnUuidStr;
|
||||||
|
GeneralSettingsTab *generalSettingsTab;
|
||||||
|
Ipv4SettingsTab *ipv4SettingsTab;
|
||||||
|
Ipv6SettingsTab *ipv6SettingsTab;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // WIFISETTINGS_H
|
Loading…
Reference in new issue