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 LanguageSettings::prompt(bool force) { d.Init(); // Ask for language if we don't already know. if (force || d.m_language.isEmpty()) { ConfigurationDialog langEdit; langEdit.addChild(new LangEditorSetting()); langEdit.exec(); } // Always update the database, even if there's // no change -- during bootstrapping, we don't // actually get to write to the database until // a later run, so do it every time. gContext->SaveSetting("Language", d.m_language); }
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); } } }
void ConfigDialogManager::run() { ConfigurationDialog config; for(auto& tab: m_tabs) { IConfigTab* confTab = tab.second; QWidget* w = confTab->constructTab(); const QString name = confTab->tabName(); config.addTab(name, w); } connect(&config, &ConfigurationDialog::saveData, this, &ConfigDialogManager::applyConfiguration); config.exec(); }
void HoIModDesigner::OpenConfigurationDialog() { ConfigurationDialog dialog; dialog.exec(); }