| 550 | } |
| 551 | |
| 552 | void UiController::showSettingsDialog() |
| 553 | { |
| 554 | ConfigDialog cfgDlg(activeMainWindow()); |
| 555 | |
| 556 | auto editorConfigPage = new EditorConfigPage(&cfgDlg); |
| 557 | auto languageConfigPage = new LanguagePreferences(&cfgDlg); |
| 558 | auto analyzersPreferences = new AnalyzersPreferences(&cfgDlg); |
| 559 | auto documentationPreferences = new DocumentationPreferences(&cfgDlg); |
| 560 | auto runtimesPreferences = new RuntimesPreferences(&cfgDlg); |
| 561 | auto templateConfig = new TemplateConfig(&cfgDlg); |
| 562 | |
| 563 | const auto configPages = QVector<KDevelop::ConfigPage*> { |
| 564 | new UiPreferences(&cfgDlg), |
| 565 | new PluginPreferences(&cfgDlg), |
| 566 | new SourceFormatterSettings(&cfgDlg), |
| 567 | new ProjectPreferences(&cfgDlg), |
| 568 | new EnvironmentPreferences(QString(), &cfgDlg), |
| 569 | templateConfig, |
| 570 | documentationPreferences, |
| 571 | analyzersPreferences, |
| 572 | runtimesPreferences, |
| 573 | languageConfigPage, |
| 574 | editorConfigPage |
| 575 | }; |
| 576 | |
| 577 | for (auto page : configPages) { |
| 578 | cfgDlg.appendConfigPage(page); |
| 579 | } |
| 580 | |
| 581 | cfgDlg.appendSubConfigPage(languageConfigPage, new BGPreferences(&cfgDlg)); |
| 582 | |
| 583 | auto addPluginPages = [&](IPlugin* plugin) { |
| 584 | for (int i = 0, numPages = plugin->configPages(); i < numPages; ++i) { |
| 585 | auto page = plugin->configPage(i, &cfgDlg); |
| 586 | if (!page) |
| 587 | continue; |
| 588 | |
| 589 | if (page->configPageType() == ConfigPage::LanguageConfigPage) { |
| 590 | cfgDlg.appendSubConfigPage(languageConfigPage, page); |
| 591 | } else if (page->configPageType() == ConfigPage::AnalyzerConfigPage) { |
| 592 | cfgDlg.appendSubConfigPage(analyzersPreferences, page); |
| 593 | } else if (page->configPageType() == ConfigPage::RuntimeConfigPage) { |
| 594 | cfgDlg.appendSubConfigPage(runtimesPreferences, page); |
| 595 | } else if (page->configPageType() == ConfigPage::DocumentationConfigPage) { |
| 596 | cfgDlg.appendSubConfigPage(documentationPreferences, page); |
| 597 | } else { |
| 598 | cfgDlg.insertConfigPage(editorConfigPage, page); |
| 599 | } |
| 600 | } |
| 601 | }; |
| 602 | |
| 603 | auto plugins = ICore::self()->pluginController()->loadedPlugins(); |
| 604 | std::sort(plugins.begin(), plugins.end()); |
| 605 | |
| 606 | for (IPlugin* plugin : std::as_const(plugins)) { |
| 607 | addPluginPages(plugin); |
| 608 | } |
| 609 |
no test coverage detected