OSDN Git Service

81f7235113340906b1c85b55a3e5dc49bc5b295c
[qt-creator-jp/qt-creator-jp.git] / src / plugins / analyzerbase / analyzeroptionspage.cpp
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
8 **
9 ** Contact: Nokia Corporation (qt-info@nokia.com)
10 **
11 ** No Commercial Usage
12 **
13 ** This file contains pre-release code and may not be distributed.
14 ** You may use this file in accordance with the terms and conditions
15 ** contained in the Technology Preview License Agreement accompanying
16 ** this package.
17 **
18 ** GNU Lesser General Public License Usage
19 **
20 ** Alternatively, this file may be used under the terms of the GNU Lesser
21 ** General Public License version 2.1 as published by the Free Software
22 ** Foundation and appearing in the file LICENSE.LGPL included in the
23 ** packaging of this file.  Please review the following information to
24 ** ensure the GNU Lesser General Public License version 2.1 requirements
25 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26 **
27 ** In addition, as a special exception, Nokia gives you certain additional
28 ** rights.  These rights are described in the Nokia Qt LGPL Exception
29 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30 **
31 ** If you have questions regarding the use of this file, please contact
32 ** Nokia at qt-info@nokia.com.
33 **
34 **************************************************************************/
35
36 #include "analyzerconstants.h"
37
38 #include "analyzeroptionspage.h"
39 #include "analyzersettings.h"
40
41 #include <coreplugin/icore.h>
42
43 #include <QtCore/QCoreApplication>
44 #include <QtCore/QLatin1String>
45 #include <QtCore/QDebug>
46
47 #include <QtGui/QIcon>
48 #include <QtGui/QWidget>
49
50 using namespace Analyzer;
51 using namespace Analyzer::Internal;
52
53 AnalyzerOptionsPage::AnalyzerOptionsPage(AbstractAnalyzerSubConfig *config, QObject *parent) :
54     Core::IOptionsPage(parent),
55     m_config(config)
56 {
57 }
58
59 QString AnalyzerOptionsPage::id() const
60 {
61     return m_config->id();
62 }
63
64 QString AnalyzerOptionsPage::displayName() const
65 {
66     return m_config->displayName();
67 }
68
69 QString AnalyzerOptionsPage::category() const
70 {
71     return QLatin1String(Constants::ANALYZER_SETTINGS_CATEGORY);
72 }
73
74 QString AnalyzerOptionsPage::displayCategory() const
75 {
76     return QCoreApplication::translate("Analyzer", Constants::ANALYZER_SETTINGS_TR_CATEGORY);
77 }
78
79 QIcon AnalyzerOptionsPage::categoryIcon() const
80 {
81     return QIcon(QLatin1String(Constants::ANALYZER_SETTINGS_CATEGORY_ICON));
82 }
83
84 QWidget *AnalyzerOptionsPage::createPage(QWidget *parent)
85 {
86     return m_config->createConfigWidget(parent);
87 }
88
89 void AnalyzerOptionsPage::apply()
90 {
91     AnalyzerGlobalSettings::instance()->writeSettings();
92 }
93
94 void AnalyzerOptionsPage::finish()
95 {
96 }