#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); ethernetSettingsTab->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(); settings.insert(ethernetSettingsTab->readSettings()); ConnectionSettingsEngine::modifyConnectionSettings(targetConnUuidStr, settings); this->done(0); }