void ConfigurationPanel::add() { ConfigurationDialog dialog; dialog.setWindowTitle(tr("Add Configuration")); dialog.setSettings(m_settings); if (dialog.exec() == QDialog::Accepted) { const QString key = dialog.key(); m_settings->setStyle(key, dialog.value()); populateConfigurations(key); } }
void ConfigurationPanel::edit() { const QString key = ui->configurations->currentText(); ConfigurationDialog dialog; dialog.setWindowTitle(tr("Edit Configuration")); dialog.setSettings(m_settings); dialog.setKey(key); if (dialog.exec() == QDialog::Accepted) { const QString newKey = dialog.key(); if (newKey == key) { m_settings->setStyle(key, dialog.value()); } else { m_settings->replaceStyle(key, newKey, dialog.value()); ui->configurations->setItemText(ui->configurations->currentIndex(), newKey); } } }