diff --git a/interfaces/configpage.h b/interfaces/configpage.h --- a/interfaces/configpage.h +++ b/interfaces/configpage.h @@ -66,7 +66,8 @@ DefaultConfigPage, LanguageConfigPage, ///< A config page that contains language specific settings. This page is appended as a child page to the "Language support" config page. AnalyzerConfigPage, ///< A config page that contains settings for some analyzer. This page is appended as a child page to the "Analyzers" config page. - DocumentationConfigPage ///< A config page that contains settings for some documentation plugin. This page is appended as a child page to the "Documentation" config page. + DocumentationConfigPage, ///< A config page that contains settings for some documentation plugin. This page is appended as a child page to the "Documentation" config page. + RuntimeConfigPage ///< A config page that contains settings for some runtime plugin. This page is appended as a child page to the "Runtimes" config page. }; /** diff --git a/plugins/docker/dockerpreferences.h b/plugins/docker/dockerpreferences.h --- a/plugins/docker/dockerpreferences.h +++ b/plugins/docker/dockerpreferences.h @@ -31,6 +31,7 @@ explicit DockerPreferences(KDevelop::IPlugin* plugin, KCoreConfigSkeleton* config, QWidget* parent = nullptr); ~DockerPreferences() override; + KDevelop::ConfigPage::ConfigPageType configPageType() const override; QString name() const override; private: QScopedPointer m_prefsUi; diff --git a/plugins/docker/dockerpreferences.cpp b/plugins/docker/dockerpreferences.cpp --- a/plugins/docker/dockerpreferences.cpp +++ b/plugins/docker/dockerpreferences.cpp @@ -28,6 +28,11 @@ DockerPreferences::~DockerPreferences() = default; +KDevelop::ConfigPage::ConfigPageType DockerPreferences::configPageType() const +{ + return KDevelop::ConfigPage::RuntimeConfigPage; +} + QString DockerPreferences::name() const { return QStringLiteral("Docker"); diff --git a/plugins/docker/kdevdocker.json b/plugins/docker/kdevdocker.json --- a/plugins/docker/kdevdocker.json +++ b/plugins/docker/kdevdocker.json @@ -7,7 +7,7 @@ "Name[x-test]": "xxAleix Polxx" } ], - "Category": "Global", + "Category": "Runtimes", "Description": "Exposes Docker runtimes", "Description[ca@valencia]": "Exposa el temps d'execució del Docker", "Description[ca]": "Exposa el temps d'execució del Docker", diff --git a/plugins/flatpak/kdevflatpak.json b/plugins/flatpak/kdevflatpak.json --- a/plugins/flatpak/kdevflatpak.json +++ b/plugins/flatpak/kdevflatpak.json @@ -7,7 +7,7 @@ "Name[x-test]": "xxAleix Polxx" } ], - "Category": "Global", + "Category": "Runtimes", "Description": "Exposes Flatpak runtimes", "Description[ca@valencia]": "Exposa el temps d'execució del Flatpak", "Description[ca]": "Exposa el temps d'execució del Flatpak", diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -82,6 +82,7 @@ settings/templateconfig.cpp settings/templatepage.cpp settings/analyzerspreferences.cpp + settings/runtimespreferences.cpp settings/documentationpreferences.cpp ) diff --git a/shell/settings/pluginpreferences.cpp b/shell/settings/pluginpreferences.cpp --- a/shell/settings/pluginpreferences.cpp +++ b/shell/settings/pluginpreferences.cpp @@ -53,6 +53,7 @@ { "Debugging", i18nc("@title:group", "Debugging") }, { "Testing", i18nc("@title:group", "Testing") }, { "Analyzers", i18nc("@title:group", "Analyzers") }, + { "Runtimes", i18nc("@title:group", "Runtimes") }, { "Other", i18nc("@title:group", "Other") } }; foreach (const KPluginMetaData& info, Core::self()->pluginControllerInternal()->allPluginInfos()) { diff --git a/shell/settings/runtimespreferences.h b/shell/settings/runtimespreferences.h new file mode 100644 --- /dev/null +++ b/shell/settings/runtimespreferences.h @@ -0,0 +1,48 @@ +/* This file is part of KDevelop + * + * Copyright 2017 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +#ifndef KDEVPLATFORM_RUNTIMES_PREFERENCES_H +#define KDEVPLATFORM_RUNTIMES_PREFERENCES_H + +#include + +namespace KDevelop +{ + +class RuntimesPreferences : public ConfigPage +{ + Q_OBJECT +public: + explicit RuntimesPreferences(QWidget* parent); + ~RuntimesPreferences() override; + + QString name() const override; + QIcon icon() const override; + QString fullName() const override; + +public Q_SLOTS: + void apply() override; + void defaults() override; + void reset() override; +}; + +} + +#endif diff --git a/shell/settings/runtimespreferences.cpp b/shell/settings/runtimespreferences.cpp new file mode 100644 --- /dev/null +++ b/shell/settings/runtimespreferences.cpp @@ -0,0 +1,62 @@ +/* This file is part of KDevelop + * + * Copyright 2017 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +#include "runtimespreferences.h" + +#include + +namespace KDevelop +{ + +RuntimesPreferences::RuntimesPreferences(QWidget* parent) + : ConfigPage(nullptr, nullptr, parent) +{ +} + +RuntimesPreferences::~RuntimesPreferences() = default; + +QString RuntimesPreferences::name() const +{ + return i18n("Runtimes"); +} + +QIcon RuntimesPreferences::icon() const +{ + return QIcon::fromTheme(QStringLiteral("file-library-symbolic")); +} + +QString RuntimesPreferences::fullName() const +{ + return i18n("Configure Runtimes"); +} + +void RuntimesPreferences::apply() +{ +} + +void RuntimesPreferences::defaults() +{ +} + +void RuntimesPreferences::reset() +{ +} + +} diff --git a/shell/uicontroller.cpp b/shell/uicontroller.cpp --- a/shell/uicontroller.cpp +++ b/shell/uicontroller.cpp @@ -57,6 +57,7 @@ #include "settings/templateconfig.h" #include "settings/analyzerspreferences.h" #include "settings/documentationpreferences.h" +#include "settings/runtimespreferences.h" namespace KDevelop { @@ -494,6 +495,7 @@ auto languageConfigPage = new LanguagePreferences(&cfgDlg); auto analyzersPreferences = new AnalyzersPreferences(&cfgDlg); auto documentationPreferences = new DocumentationPreferences(&cfgDlg); + auto runtimesPreferences = new RuntimesPreferences(&cfgDlg); const auto configPages = QVector { new UiPreferences(&cfgDlg), @@ -519,6 +521,8 @@ cfgDlg.addSubConfigPage(languageConfigPage, page); } else if (page->configPageType() == ConfigPage::AnalyzerConfigPage) { cfgDlg.addSubConfigPage(analyzersPreferences, page); + } else if (page->configPageType() == ConfigPage::RuntimeConfigPage) { + cfgDlg.addSubConfigPage(runtimesPreferences, page); } else if (page->configPageType() == ConfigPage::DocumentationConfigPage) { cfgDlg.addSubConfigPage(documentationPreferences, page); } else { @@ -530,8 +534,9 @@ cfgDlg.addConfigPage(documentationPreferences, configPages[5]); cfgDlg.addConfigPage(analyzersPreferences, documentationPreferences); + cfgDlg.addConfigPage(runtimesPreferences, analyzersPreferences); - cfgDlg.addConfigPage(languageConfigPage, analyzersPreferences); + cfgDlg.addConfigPage(languageConfigPage, runtimesPreferences); cfgDlg.addSubConfigPage(languageConfigPage, new BGPreferences(&cfgDlg)); foreach (IPlugin* plugin, ICore::self()->pluginController()->loadedPlugins()) {