2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef PROJECTWINDOW_H
|
|
|
|
|
#define PROJECTWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QtGui/QWidget>
|
2009-07-16 15:33:19 +02:00
|
|
|
#include <QtGui/QScrollArea>
|
2009-09-17 13:59:10 +02:00
|
|
|
#include <QtGui/QComboBox>
|
|
|
|
|
#include <QtCore/QPair>
|
2009-09-29 18:06:13 +02:00
|
|
|
#include <QtGui/QStackedWidget>
|
|
|
|
|
#include <QtGui/QPushButton>
|
|
|
|
|
#include <QtGui/QToolButton>
|
|
|
|
|
#include <QtGui/QLabel>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2009-07-16 15:33:19 +02:00
|
|
|
class QLabel;
|
|
|
|
|
class QVBoxLayout;
|
2008-12-02 12:01:29 +01:00
|
|
|
class QModelIndex;
|
|
|
|
|
class QTabWidget;
|
2009-08-06 15:31:32 +02:00
|
|
|
class QHBoxLayout;
|
2009-09-17 13:59:10 +02:00
|
|
|
class QComboBox;
|
2009-09-29 18:06:13 +02:00
|
|
|
class QMenu;
|
2009-10-01 14:24:44 +02:00
|
|
|
class QSpacerItem;
|
2008-12-02 12:01:29 +01:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2009-11-25 15:57:09 +01:00
|
|
|
class IPropertiesPanel;
|
2008-12-02 12:01:29 +01:00
|
|
|
class Project;
|
|
|
|
|
class ProjectExplorerPlugin;
|
|
|
|
|
class SessionManager;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-07-16 15:33:19 +02:00
|
|
|
class PanelsWidget : public QScrollArea
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
PanelsWidget(QWidget *parent);
|
|
|
|
|
~PanelsWidget();
|
|
|
|
|
// Adds a widget
|
2009-09-17 13:59:10 +02:00
|
|
|
void addWidget(QWidget *widget);
|
2009-07-16 15:33:19 +02:00
|
|
|
void addWidget(const QString &name, QWidget *widget);
|
|
|
|
|
|
|
|
|
|
// Removes all widgets and deletes them
|
|
|
|
|
void clear();
|
|
|
|
|
|
2009-11-25 15:18:51 +01:00
|
|
|
private:
|
2009-07-16 15:33:19 +02:00
|
|
|
struct Panel
|
|
|
|
|
{
|
2009-11-25 15:18:51 +01:00
|
|
|
// This does not take ownership of widget!
|
|
|
|
|
explicit Panel(QWidget * widget);
|
|
|
|
|
~Panel();
|
|
|
|
|
|
2009-10-01 14:24:44 +02:00
|
|
|
QSpacerItem *spacer;
|
2009-07-16 15:33:19 +02:00
|
|
|
QLabel *nameLabel;
|
|
|
|
|
QWidget *panelWidget;
|
2009-08-06 15:31:32 +02:00
|
|
|
QHBoxLayout *marginLayout;
|
2009-07-16 15:33:19 +02:00
|
|
|
};
|
2009-11-25 15:18:51 +01:00
|
|
|
QList<Panel *> m_panels;
|
|
|
|
|
|
2009-07-16 15:33:19 +02:00
|
|
|
QVBoxLayout *m_layout;
|
|
|
|
|
};
|
|
|
|
|
|
2009-09-29 18:06:13 +02:00
|
|
|
class BuildConfigurationComboBox : public QStackedWidget
|
2009-09-17 13:59:10 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
BuildConfigurationComboBox(ProjectExplorer::Project *p, QWidget *parent = 0);
|
|
|
|
|
~BuildConfigurationComboBox();
|
|
|
|
|
private slots:
|
|
|
|
|
void nameChanged(const QString &buildConfiguration);
|
|
|
|
|
void activeConfigurationChanged();
|
|
|
|
|
void addedBuildConfiguration(ProjectExplorer::Project *, const QString &buildConfiguration);
|
|
|
|
|
void removedBuildConfiguration(ProjectExplorer::Project *, const QString &buildConfiguration);
|
|
|
|
|
void changedIndex(int newIndex);
|
|
|
|
|
private:
|
|
|
|
|
int nameToIndex(const QString &buildConfiguration);
|
|
|
|
|
bool ignoreIndexChange;
|
|
|
|
|
ProjectExplorer::Project *m_project;
|
2009-09-29 18:06:13 +02:00
|
|
|
QComboBox *m_comboBox;
|
|
|
|
|
QLabel *m_label;
|
2009-09-17 13:59:10 +02:00
|
|
|
};
|
2009-08-06 15:31:32 +02:00
|
|
|
|
2009-09-17 13:59:10 +02:00
|
|
|
class ActiveConfigurationWidget : public QWidget
|
2009-08-06 15:31:32 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2009-09-17 13:59:10 +02:00
|
|
|
ActiveConfigurationWidget(QWidget *parent = 0);
|
|
|
|
|
~ActiveConfigurationWidget();
|
2009-08-06 15:31:32 +02:00
|
|
|
private slots:
|
2009-09-17 13:59:10 +02:00
|
|
|
void projectAdded(ProjectExplorer::Project*);
|
|
|
|
|
void projectRemoved(ProjectExplorer::Project*);
|
2009-08-06 15:31:32 +02:00
|
|
|
private:
|
2009-09-17 13:59:10 +02:00
|
|
|
QMap<ProjectExplorer::Project *, QPair<BuildConfigurationComboBox *, QLabel *> > m_buildComboBoxMap;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class RunConfigurationComboBox : public QComboBox
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
RunConfigurationComboBox(QWidget *parent = 0);
|
|
|
|
|
~RunConfigurationComboBox();
|
|
|
|
|
private slots:
|
|
|
|
|
void activeRunConfigurationChanged();
|
|
|
|
|
void activeItemChanged(int);
|
|
|
|
|
void addedRunConfiguration(ProjectExplorer::Project *p, const QString &);
|
|
|
|
|
void removedRunConfiguration(ProjectExplorer::Project *p, const QString &);
|
|
|
|
|
void projectAdded(ProjectExplorer::Project*);
|
|
|
|
|
void projectRemoved(ProjectExplorer::Project*);
|
|
|
|
|
void rebuildTree();
|
|
|
|
|
private:
|
|
|
|
|
int convertTreeIndexToInt(int project, int runconfigurationIndex);
|
|
|
|
|
QPair<int, int> convertIntToTreeIndex(int index);
|
|
|
|
|
void connectToProject(ProjectExplorer::Project *p);
|
|
|
|
|
void disconnectFromProject(ProjectExplorer::Project *p);
|
|
|
|
|
|
|
|
|
|
bool m_ignoreChange;
|
|
|
|
|
};
|
|
|
|
|
|
2009-09-29 18:06:13 +02:00
|
|
|
class ProjectLabel : public QLabel
|
2009-09-17 13:59:10 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2009-09-29 18:06:13 +02:00
|
|
|
ProjectLabel(QWidget *parent);
|
|
|
|
|
~ProjectLabel();
|
|
|
|
|
public slots:
|
|
|
|
|
void setProject(ProjectExplorer::Project *);
|
|
|
|
|
};
|
2009-09-17 13:59:10 +02:00
|
|
|
|
2009-09-29 18:06:13 +02:00
|
|
|
class ProjectPushButton : public QPushButton
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
ProjectPushButton(QWidget *parent);
|
|
|
|
|
~ProjectPushButton();
|
2009-09-17 13:59:10 +02:00
|
|
|
signals:
|
|
|
|
|
void projectChanged(ProjectExplorer::Project *);
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void projectAdded(ProjectExplorer::Project*);
|
|
|
|
|
void projectRemoved(ProjectExplorer::Project*);
|
2009-09-29 18:06:13 +02:00
|
|
|
void actionTriggered();
|
2009-09-17 13:59:10 +02:00
|
|
|
private:
|
2009-09-29 18:06:13 +02:00
|
|
|
QMenu *m_menu;
|
2009-08-06 15:31:32 +02:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class ProjectWindow : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2009-01-20 15:31:33 +01:00
|
|
|
explicit ProjectWindow(QWidget *parent = 0);
|
2008-12-02 12:01:29 +01:00
|
|
|
~ProjectWindow();
|
|
|
|
|
|
|
|
|
|
private slots:
|
2009-09-17 13:59:10 +02:00
|
|
|
void showProperties(ProjectExplorer::Project *project);
|
2008-12-02 12:01:29 +01:00
|
|
|
void restoreStatus();
|
|
|
|
|
void saveStatus();
|
2009-10-07 15:46:07 +02:00
|
|
|
void projectAdded();
|
|
|
|
|
void projectRemoved();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
private:
|
2009-09-17 13:59:10 +02:00
|
|
|
void updateRunConfigurationsComboBox();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-09-17 13:59:10 +02:00
|
|
|
ActiveConfigurationWidget *m_activeConfigurationWidget;
|
|
|
|
|
QWidget *m_spacerBetween;
|
|
|
|
|
QWidget *m_projectChooser;
|
2009-10-07 15:46:07 +02:00
|
|
|
QLabel *m_noprojectLabel;
|
2009-07-16 15:33:19 +02:00
|
|
|
PanelsWidget *m_panelsWidget;
|
2009-11-25 15:57:09 +01:00
|
|
|
QList<IPropertiesPanel *> m_panels;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2009-08-06 15:31:32 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|
|
|
|
|
|
|
|
|
|
#endif // PROJECTWINDOW_H
|