You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
#include "ethernetsettings.h"
|
|
#include "ui_genericsettings.h"
|
|
|
|
EthernetSettings::EthernetSettings(QString title, QString connUuidStr, QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::GenericSettings)
|
|
{
|
|
targetConnUuidStr = connUuidStr;
|
|
ui->setupUi(this);
|
|
this->setWindowTitle(title);
|
|
ui->connectionNameLineEdit->setText(title);
|
|
generalSettingsTab = new GeneralSettingsTab();
|
|
ethernetSettingsTab = new EthernetSettingsTab();
|
|
ui->tabWidget->addTab(generalSettingsTab, "General");
|
|
ui->tabWidget->addTab(ethernetSettingsTab, "Ethernet");
|
|
QVariantMap connSettings = ConnectionSettingsEngine::readConnectionSettings(connUuidStr);
|
|
generalSettingsTab->loadSettings(connSettings);
|
|
connect(ui->cancelButton, &QPushButton::clicked, this, &EthernetSettings::onCancelButtonClicked);
|
|
connect(ui->saveButton, &QPushButton::clicked, this, &EthernetSettings::onSaveButtonClicked);
|
|
}
|
|
|
|
EthernetSettings::~EthernetSettings()
|
|
{
|
|
delete ui;
|
|
delete generalSettingsTab;
|
|
delete ethernetSettingsTab;
|
|
}
|
|
|
|
void EthernetSettings::onCancelButtonClicked()
|
|
{
|
|
this->done(0);
|
|
}
|
|
|
|
void EthernetSettings::onSaveButtonClicked()
|
|
{
|
|
QVariantMap settings = generalSettingsTab->readSettings();
|
|
ConnectionSettingsEngine::modifyConnectionSettings(targetConnUuidStr, settings);
|
|
this->done(0);
|
|
}
|