qtoptionspage.h 4.13 KB
Newer Older
1 2 3 4
/**************************************************************************
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
8
**
con's avatar
con committed
9
** No Commercial Usage
10
**
con's avatar
con committed
11 12 13 14
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
15 16 17 18 19 20 21 22 23 24
**
** 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.
**
con's avatar
con committed
25 26 27 28 29 30
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
31 32 33 34 35
**
**************************************************************************/
#ifndef QTOPTIONSPAGE_H
#define QTOPTIONSPAGE_H

36 37
#include "debugginghelperbuildtask.h"

38 39
#include <coreplugin/dialogs/ioptionspage.h>

40
#include <QtCore/QSharedPointer>
41
#include <QtCore/QFutureInterface>
42

43 44 45 46 47 48
#include <QtGui/QWidget>

QT_BEGIN_NAMESPACE
class QTreeWidgetItem;
QT_END_NAMESPACE

49
namespace Qt4ProjectManager {
50 51 52 53 54 55

class QtVersion;

namespace Internal {
namespace Ui {
class QtVersionManager;
56 57
class QtVersionInfo;
class DebuggingHelper;
58 59
}

60
class QtOptionsPageWidget : public QWidget
61 62
{
    Q_OBJECT
63
    Q_DISABLE_COPY(QtOptionsPageWidget)
64
public:
Tobias Hunger's avatar
Tobias Hunger committed
65
    QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> versions);
66
    ~QtOptionsPageWidget();
67
    QList<QtVersion *> versions() const;
68
    void finish();
69
    QString searchKeywords() const;
70

71 72
    virtual bool eventFilter(QObject *o, QEvent *e);

73 74 75
private:
    void showEnvironmentPage(QTreeWidgetItem * item);
    void fixQtVersionName(int index);
76
    int indexForTreeItem(const QTreeWidgetItem *item) const;
77
    QTreeWidgetItem *treeItemForIndex(int index) const;
78 79
    QtVersion *currentVersion() const;
    int currentIndex() const;
80

81 82
    const QString m_specifyNameString;
    const QString m_specifyPathString;
83

84
    Internal::Ui::QtVersionManager *m_ui;
85 86
    Internal::Ui::QtVersionInfo *m_versionUi;
    Internal::Ui::DebuggingHelper *m_debuggingHelperUi;
87
    QList<QtVersion *> m_versions;
88 89 90 91 92 93 94
    int m_defaultVersion;

private slots:
    void versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old);
    void addQtDir();
    void removeQtDir();
    void updateState();
95
    void makeS60Visible(bool visible);
96 97
    void onQtBrowsed();
    void updateCurrentQtName();
98
    void updateCurrentQMakeLocation();
99
    void updateCurrentS60SDKDirectory();
100
    void updateCurrentSbsV2Directory();
101
    void updateDebuggingHelperUi();
102 103 104 105
    void buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools
                              = DebuggingHelperBuildTask::AllTools);
    void buildGdbHelper();
    void buildQmlDump();
106
    void buildQmlDebuggingLibrary();
107
    void buildQmlObserver();
108
    void slotShowDebuggingBuildLog();
109
    void debuggingHelperBuildFinished(int qtVersionId, DebuggingHelperBuildTask::Tools tools, const QString &output);
110 111

private:
112
    void updateDescriptionLabel();
113
    void showDebuggingBuildLog(const QTreeWidgetItem *currentItem);
114 115 116 117 118 119 120 121
};

class QtOptionsPage : public Core::IOptionsPage
{
    Q_OBJECT
public:
    QtOptionsPage();
    QString id() const;
122
    QString displayName() const;
123
    QString category() const;
124
    QString displayCategory() const;
125
    QIcon categoryIcon() const;
126 127
    QWidget *createPage(QWidget *parent);
    void apply();
128
    void finish() {}
129 130
    virtual bool matches(const QString &) const;

131
private:
132
    QtOptionsPageWidget *m_widget;
133
    QString m_searchKeywords;
134 135 136
};

} //namespace Internal
137
} //namespace Qt4ProjectManager
138 139 140


#endif // QTOPTIONSPAGE_H