summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordt <qtc-committer@nokia.com>2009-05-26 17:21:02 +0200
committerdt <qtc-committer@nokia.com>2009-05-27 14:58:16 +0200
commit5d75804b931f01f9718b44e0e82e6b51b775fed7 (patch)
tree39178f11a057e985adb66e2fc6f7c962426f20ee /src/plugins
parentadc7a7204b64ca305d3904386ebb616d3be48e4a (diff)
downloadqt-creator-5d75804b931f01f9718b44e0e82e6b51b775fed7.tar.gz
Refactor the checkbox "Clear system environment" out.
I don't want it in the run configurations.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp8
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.h4
-rw-r--r--src/plugins/projectexplorer/environmenteditmodel.cpp15
-rw-r--r--src/plugins/projectexplorer/environmenteditmodel.h3
-rw-r--r--src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp10
-rw-r--r--src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h5
6 files changed, 22 insertions, 23 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp b/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp
index 99526421fb..2ced7fb57b 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp
@@ -44,13 +44,15 @@ CMakeBuildEnvironmentWidget::CMakeBuildEnvironmentWidget(CMakeProject *project)
: BuildStepConfigWidget(), m_pro(project)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
- vbox->setMargin(0);
+ m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
+ m_clearSystemEnvironmentCheckBox->setText("Clear system environment");
+ vbox->addWidget(m_clearSystemEnvironmentCheckBox);
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this);
vbox->addWidget(m_buildEnvironmentWidget);
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
this, SLOT(environmentModelUserChangesUpdated()));
- connect(m_buildEnvironmentWidget, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)),
+ connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
}
@@ -66,7 +68,7 @@ void CMakeBuildEnvironmentWidget::init(const QString &buildConfiguration)
m_buildConfiguration = buildConfiguration;
- m_buildEnvironmentWidget->setClearSystemEnvironment(!m_pro->useSystemEnvironment(buildConfiguration));
+ m_clearSystemEnvironmentCheckBox->setChecked(!m_pro->useSystemEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
m_buildEnvironmentWidget->updateButtons();
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.h b/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.h
index db59b2c5df..9e18affae8 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.h
+++ b/src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.h
@@ -31,6 +31,9 @@
#define QT4BUILDENVIRONMENTWIDGET_H
#include <projectexplorer/buildstep.h>
+QT_BEGIN_NAMESPACE
+class QCheckBox;
+QT_END_NAMESPACE
namespace ProjectExplorer {
class EnvironmentWidget;
@@ -56,6 +59,7 @@ private slots:
private:
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
+ QCheckBox *m_clearSystemEnvironmentCheckBox;
CMakeProject *m_pro;
QString m_buildConfiguration;
};
diff --git a/src/plugins/projectexplorer/environmenteditmodel.cpp b/src/plugins/projectexplorer/environmenteditmodel.cpp
index 28ee8eae3f..08d1cd215d 100644
--- a/src/plugins/projectexplorer/environmenteditmodel.cpp
+++ b/src/plugins/projectexplorer/environmenteditmodel.cpp
@@ -432,12 +432,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
connect(m_model, SIGNAL(userChangesUpdated()),
this, SIGNAL(userChangesUpdated()));
- QVBoxLayout *verticalLayout = new QVBoxLayout(this);
- m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
- m_clearSystemEnvironmentCheckBox->setText("Clear system environment");
- verticalLayout->addWidget(m_clearSystemEnvironmentCheckBox);
-
- QHBoxLayout *horizontalLayout = new QHBoxLayout();
+ QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
m_environmentTreeView = new QTreeView(this);
m_environmentTreeView->setRootIsDecorated(false);
m_environmentTreeView->setHeaderHidden(false);
@@ -468,7 +463,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_2->addItem(verticalSpacer);
horizontalLayout->addLayout(verticalLayout_2);
- verticalLayout->addLayout(horizontalLayout);
connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SLOT(updateButtons()));
@@ -483,8 +477,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
this, SLOT(unsetEnvironmentButtonClicked()));
connect(m_environmentTreeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
this, SLOT(environmentCurrentIndexChanged(QModelIndex, QModelIndex)));
- connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
- this, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)));
}
EnvironmentWidget::~EnvironmentWidget()
@@ -493,11 +485,6 @@ EnvironmentWidget::~EnvironmentWidget()
m_model = 0;
}
-void EnvironmentWidget::setClearSystemEnvironment(bool b)
-{
- m_clearSystemEnvironmentCheckBox->setChecked(b);
-}
-
void EnvironmentWidget::setBaseEnvironment(const ProjectExplorer::Environment &env)
{
m_model->setBaseEnvironment(env);
diff --git a/src/plugins/projectexplorer/environmenteditmodel.h b/src/plugins/projectexplorer/environmenteditmodel.h
index def0ca46f3..3d8475bc17 100644
--- a/src/plugins/projectexplorer/environmenteditmodel.h
+++ b/src/plugins/projectexplorer/environmenteditmodel.h
@@ -97,7 +97,6 @@ public:
void setBaseEnvironment(const ProjectExplorer::Environment &env);
void setMergedEnvironments(bool b);
- void setClearSystemEnvironment(bool b);
bool mergedEnvironments();
QList<EnvironmentItem> userChanges() const;
@@ -108,7 +107,6 @@ public slots:
signals:
void userChangesUpdated();
- void clearSystemEnvironmentCheckBoxClicked(bool on);
private slots:
void editEnvironmentButtonClicked();
@@ -119,7 +117,6 @@ private slots:
private:
EnvironmentModel *m_model;
- QCheckBox *m_clearSystemEnvironmentCheckBox;
QTreeView *m_environmentTreeView;
QPushButton *m_editButton;
QPushButton *m_addButton;
diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
index c7b5199725..1c2149a9f5 100644
--- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
+++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
@@ -44,13 +44,17 @@ Qt4BuildEnvironmentWidget::Qt4BuildEnvironmentWidget(Qt4Project *project)
: BuildStepConfigWidget(), m_pro(project)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
- vbox->setMargin(0);
+
+ m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
+ m_clearSystemEnvironmentCheckBox->setText("Clear system environment");
+ vbox->addWidget(m_clearSystemEnvironmentCheckBox);
+
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this);
vbox->addWidget(m_buildEnvironmentWidget);
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
this, SLOT(environmentModelUserChangesUpdated()));
- connect(m_buildEnvironmentWidget, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)),
+ connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
}
@@ -66,7 +70,7 @@ void Qt4BuildEnvironmentWidget::init(const QString &buildConfiguration)
m_buildConfiguration = buildConfiguration;
- m_buildEnvironmentWidget->setClearSystemEnvironment(!m_pro->useSystemEnvironment(buildConfiguration));
+ m_clearSystemEnvironmentCheckBox->setChecked(!m_pro->useSystemEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
m_buildEnvironmentWidget->updateButtons();
diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h
index 6a8396811c..91f62ea544 100644
--- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h
+++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h
@@ -32,6 +32,10 @@
#include <projectexplorer/buildstep.h>
+QT_BEGIN_NAMESPACE
+class QCheckBox;
+QT_END_NAMESPACE
+
namespace ProjectExplorer {
class EnvironmentWidget;
}
@@ -57,6 +61,7 @@ private slots:
private:
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
+ QCheckBox *m_clearSystemEnvironmentCheckBox;
Qt4Project *m_pro;
QString m_buildConfiguration;
};