diff options
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r-- | src/plugins/vcsbase/commonsettingspage.cpp | 17 | ||||
-rw-r--r-- | src/plugins/vcsbase/commonsettingspage.h | 10 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbase.pro | 6 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseoptionspage.cpp | 58 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseoptionspage.h | 56 |
5 files changed, 124 insertions, 23 deletions
diff --git a/src/plugins/vcsbase/commonsettingspage.cpp b/src/plugins/vcsbase/commonsettingspage.cpp index b300c950622..d9d2ffb1511 100644 --- a/src/plugins/vcsbase/commonsettingspage.cpp +++ b/src/plugins/vcsbase/commonsettingspage.cpp @@ -94,7 +94,7 @@ QString CommonSettingsWidget::searchKeyWordMatchString() const // --------------- VCSBaseSettingsPage CommonOptionsPage::CommonOptionsPage(QObject *parent) : - Core::IOptionsPage(parent) + VCSBaseOptionsPage(parent) { m_settings.fromSettings(Core::ICore::instance()->settings()); } @@ -117,21 +117,6 @@ QString CommonOptionsPage::displayName() const return QCoreApplication::translate("VCSBase", Constants::VCS_COMMON_SETTINGS_NAME); } -QString CommonOptionsPage::category() const -{ - return QLatin1String(Constants::VCS_SETTINGS_CATEGORY); -} - -QString CommonOptionsPage::displayCategory() const -{ - return QCoreApplication::translate("VCSBase", Constants::VCS_SETTINGS_TR_CATEGORY); -} - -QIcon CommonOptionsPage::categoryIcon() const -{ - return QIcon(); // TODO: Icon for Version Control -} - QWidget *CommonOptionsPage::createPage(QWidget *parent) { m_widget = new CommonSettingsWidget(parent); diff --git a/src/plugins/vcsbase/commonsettingspage.h b/src/plugins/vcsbase/commonsettingspage.h index ea478760292..b944305f38a 100644 --- a/src/plugins/vcsbase/commonsettingspage.h +++ b/src/plugins/vcsbase/commonsettingspage.h @@ -32,7 +32,8 @@ #include "commonvcssettings.h" -#include <coreplugin/dialogs/ioptionspage.h> +#include "vcsbaseoptionspage.h" + #include <QtCore/QPointer> #include <QtGui/QWidget> @@ -48,6 +49,7 @@ namespace Internal { class CommonSettingsWidget : public QWidget { Q_OBJECT + public: explicit CommonSettingsWidget(QWidget *parent = 0); virtual ~CommonSettingsWidget(); @@ -61,18 +63,16 @@ private: Ui::CommonSettingsPage *m_ui; }; -class CommonOptionsPage : public Core::IOptionsPage +class CommonOptionsPage : public VCSBaseOptionsPage { Q_OBJECT + public: explicit CommonOptionsPage(QObject *parent = 0); virtual ~CommonOptionsPage(); virtual QString id() const; virtual QString displayName() const; - virtual QString category() const; - virtual QString displayCategory() const; - virtual QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/src/plugins/vcsbase/vcsbase.pro b/src/plugins/vcsbase/vcsbase.pro index 2f3c1c0be6f..acf42be106c 100644 --- a/src/plugins/vcsbase/vcsbase.pro +++ b/src/plugins/vcsbase/vcsbase.pro @@ -26,7 +26,8 @@ HEADERS += vcsbase_global.h \ checkoutjobs.h \ basecheckoutwizardpage.h \ vcsbaseoutputwindow.h \ - cleandialog.h + cleandialog.h \ + vcsbaseoptionspage.h SOURCES += vcsplugin.cpp \ vcsbaseplugin.cpp \ @@ -49,7 +50,8 @@ SOURCES += vcsplugin.cpp \ checkoutjobs.cpp \ basecheckoutwizardpage.cpp \ vcsbaseoutputwindow.cpp \ - cleandialog.cpp + cleandialog.cpp \ + vcsbaseoptionspage.cpp RESOURCES += vcsbase.qrc diff --git a/src/plugins/vcsbase/vcsbaseoptionspage.cpp b/src/plugins/vcsbase/vcsbaseoptionspage.cpp new file mode 100644 index 00000000000..d5a025b7226 --- /dev/null +++ b/src/plugins/vcsbase/vcsbaseoptionspage.cpp @@ -0,0 +1,58 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation ([email protected]) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "vcsbaseoptionspage.h" + +#include "vcsbaseconstants.h" + +#include <QCoreApplication> + +namespace VCSBase { + +VCSBaseOptionsPage::VCSBaseOptionsPage(QObject *parent) : + Core::IOptionsPage(parent) +{ +} + +QString VCSBaseOptionsPage::category() const +{ + return QLatin1String(Constants::VCS_SETTINGS_CATEGORY); +} + +QString VCSBaseOptionsPage::displayCategory() const +{ + return QCoreApplication::translate("VCSBase", Constants::VCS_SETTINGS_TR_CATEGORY); +} + +QIcon VCSBaseOptionsPage::categoryIcon() const +{ + return QIcon(); // TODO: Icon for Version Control +} + +} // namespace VCSBase diff --git a/src/plugins/vcsbase/vcsbaseoptionspage.h b/src/plugins/vcsbase/vcsbaseoptionspage.h new file mode 100644 index 00000000000..25c07f290b3 --- /dev/null +++ b/src/plugins/vcsbase/vcsbaseoptionspage.h @@ -0,0 +1,56 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation ([email protected]) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef VCSBASEOPTIONSPAGE_H +#define VCSBASEOPTIONSPAGE_H + +#include <coreplugin/dialogs/ioptionspage.h> + +#include "vcsbase_global.h" + +namespace VCSBase { + +/** + * An abstract options page in the Version Control category. + */ +class VCSBASE_EXPORT VCSBaseOptionsPage : public Core::IOptionsPage +{ + Q_OBJECT + +public: + explicit VCSBaseOptionsPage(QObject *parent = 0); + + QString category() const; + QString displayCategory() const; + QIcon categoryIcon() const; +}; + +} // namespace VCSBase + +#endif // VCSBASEOPTIONSPAGE_H |