diff --git a/interfaces/configpage.h b/interfaces/configpage.h --- a/interfaces/configpage.h +++ b/interfaces/configpage.h @@ -65,7 +65,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. + 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. }; /** diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -81,6 +81,7 @@ settings/templateconfig.cpp settings/templatepage.cpp settings/analyzerspreferences.cpp + settings/documentationpreferences.cpp ) if(APPLE) diff --git a/shell/settings/documentationpreferences.h b/shell/settings/documentationpreferences.h new file mode 100644 --- /dev/null +++ b/shell/settings/documentationpreferences.h @@ -0,0 +1,48 @@ +/* This file is part of KDevelop + * + * Copyright 2016 Anton Anikin + * + * 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_DOCUMENTATION_PREFERENCES_H +#define KDEVPLATFORM_DOCUMENTATION_PREFERENCES_H + +#include + +namespace KDevelop +{ + +class DocumentationPreferences : public ConfigPage +{ + Q_OBJECT +public: + explicit DocumentationPreferences(QWidget* parent); + ~DocumentationPreferences() 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/documentationpreferences.cpp b/shell/settings/documentationpreferences.cpp new file mode 100644 --- /dev/null +++ b/shell/settings/documentationpreferences.cpp @@ -0,0 +1,64 @@ +/* This file is part of KDevelop +* +* Copyright 2016 Anton Anikin +* +* 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 "documentationpreferences.h" + +#include + +namespace KDevelop +{ + +DocumentationPreferences::DocumentationPreferences(QWidget* parent) + : ConfigPage(nullptr, nullptr, parent) +{ +} + +DocumentationPreferences::~DocumentationPreferences() +{ +} + +QString DocumentationPreferences::name() const +{ + return i18n("Documentation"); +} + +QIcon DocumentationPreferences::icon() const +{ + return QIcon::fromTheme(QStringLiteral("help-contents")); +} + +QString DocumentationPreferences::fullName() const +{ + return i18n("Configure Documentation"); +} + +void DocumentationPreferences::apply() +{ +} + +void DocumentationPreferences::defaults() +{ +} + +void DocumentationPreferences::reset() +{ +} + +} diff --git a/shell/uicontroller.cpp b/shell/uicontroller.cpp --- a/shell/uicontroller.cpp +++ b/shell/uicontroller.cpp @@ -61,6 +61,7 @@ #include "settings/uipreferences.h" #include "settings/templateconfig.h" #include "settings/analyzerspreferences.h" +#include "settings/documentationpreferences.h" namespace KDevelop { @@ -497,6 +498,7 @@ auto editorConfigPage = new EditorConfigPage(parent); auto languageConfigPage = new LanguagePreferences(parent); auto analyzersPreferences = new AnalyzersPreferences(parent); + auto documentationPreferences = new DocumentationPreferences(parent); auto configPages = QVector { new UiPreferences(parent), @@ -520,14 +522,17 @@ cfgDlg.addSubConfigPage(languageConfigPage, page); } else if (page->configPageType() == ConfigPage::AnalyzerConfigPage) { cfgDlg.addSubConfigPage(analyzersPreferences, page); + } else if (page->configPageType() == ConfigPage::DocumentationConfigPage) { + cfgDlg.addSubConfigPage(documentationPreferences, page); } else { // insert them before the editor config page cfgDlg.addConfigPage(page, editorConfigPage); } } }; - cfgDlg.addConfigPage(analyzersPreferences, configPages[5]); + cfgDlg.addConfigPage(documentationPreferences, configPages[5]); + cfgDlg.addConfigPage(analyzersPreferences, documentationPreferences); cfgDlg.addConfigPage(languageConfigPage, analyzersPreferences); cfgDlg.addSubConfigPage(languageConfigPage, new BGPreferences(parent));