forked from qt-creator/qt-creator
Refactor the checkbox "Clear system environment" out.
I don't want it in the run configurations.
This commit is contained in:
@@ -44,13 +44,15 @@ CMakeBuildEnvironmentWidget::CMakeBuildEnvironmentWidget(CMakeProject *project)
|
|||||||
: BuildStepConfigWidget(), m_pro(project)
|
: BuildStepConfigWidget(), m_pro(project)
|
||||||
{
|
{
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
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);
|
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this);
|
||||||
vbox->addWidget(m_buildEnvironmentWidget);
|
vbox->addWidget(m_buildEnvironmentWidget);
|
||||||
|
|
||||||
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
||||||
this, SLOT(environmentModelUserChangesUpdated()));
|
this, SLOT(environmentModelUserChangesUpdated()));
|
||||||
connect(m_buildEnvironmentWidget, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)),
|
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
|
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ void CMakeBuildEnvironmentWidget::init(const QString &buildConfiguration)
|
|||||||
|
|
||||||
m_buildConfiguration = 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->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
|
||||||
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
|
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
|
||||||
m_buildEnvironmentWidget->updateButtons();
|
m_buildEnvironmentWidget->updateButtons();
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
#define QT4BUILDENVIRONMENTWIDGET_H
|
#define QT4BUILDENVIRONMENTWIDGET_H
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QCheckBox;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class EnvironmentWidget;
|
class EnvironmentWidget;
|
||||||
@@ -56,6 +59,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
|
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
|
||||||
|
QCheckBox *m_clearSystemEnvironmentCheckBox;
|
||||||
CMakeProject *m_pro;
|
CMakeProject *m_pro;
|
||||||
QString m_buildConfiguration;
|
QString m_buildConfiguration;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -432,12 +432,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
|
|||||||
connect(m_model, SIGNAL(userChangesUpdated()),
|
connect(m_model, SIGNAL(userChangesUpdated()),
|
||||||
this, SIGNAL(userChangesUpdated()));
|
this, SIGNAL(userChangesUpdated()));
|
||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
|
||||||
m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
|
|
||||||
m_clearSystemEnvironmentCheckBox->setText("Clear system environment");
|
|
||||||
verticalLayout->addWidget(m_clearSystemEnvironmentCheckBox);
|
|
||||||
|
|
||||||
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
|
||||||
m_environmentTreeView = new QTreeView(this);
|
m_environmentTreeView = new QTreeView(this);
|
||||||
m_environmentTreeView->setRootIsDecorated(false);
|
m_environmentTreeView->setRootIsDecorated(false);
|
||||||
m_environmentTreeView->setHeaderHidden(false);
|
m_environmentTreeView->setHeaderHidden(false);
|
||||||
@@ -468,7 +463,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
|
|||||||
QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||||
verticalLayout_2->addItem(verticalSpacer);
|
verticalLayout_2->addItem(verticalSpacer);
|
||||||
horizontalLayout->addLayout(verticalLayout_2);
|
horizontalLayout->addLayout(verticalLayout_2);
|
||||||
verticalLayout->addLayout(horizontalLayout);
|
|
||||||
|
|
||||||
connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
|
connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
|
||||||
this, SLOT(updateButtons()));
|
this, SLOT(updateButtons()));
|
||||||
@@ -483,8 +477,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent)
|
|||||||
this, SLOT(unsetEnvironmentButtonClicked()));
|
this, SLOT(unsetEnvironmentButtonClicked()));
|
||||||
connect(m_environmentTreeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
|
connect(m_environmentTreeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
|
||||||
this, SLOT(environmentCurrentIndexChanged(QModelIndex, QModelIndex)));
|
this, SLOT(environmentCurrentIndexChanged(QModelIndex, QModelIndex)));
|
||||||
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
|
||||||
this, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentWidget::~EnvironmentWidget()
|
EnvironmentWidget::~EnvironmentWidget()
|
||||||
@@ -493,11 +485,6 @@ EnvironmentWidget::~EnvironmentWidget()
|
|||||||
m_model = 0;
|
m_model = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentWidget::setClearSystemEnvironment(bool b)
|
|
||||||
{
|
|
||||||
m_clearSystemEnvironmentCheckBox->setChecked(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnvironmentWidget::setBaseEnvironment(const ProjectExplorer::Environment &env)
|
void EnvironmentWidget::setBaseEnvironment(const ProjectExplorer::Environment &env)
|
||||||
{
|
{
|
||||||
m_model->setBaseEnvironment(env);
|
m_model->setBaseEnvironment(env);
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ public:
|
|||||||
|
|
||||||
void setBaseEnvironment(const ProjectExplorer::Environment &env);
|
void setBaseEnvironment(const ProjectExplorer::Environment &env);
|
||||||
void setMergedEnvironments(bool b);
|
void setMergedEnvironments(bool b);
|
||||||
void setClearSystemEnvironment(bool b);
|
|
||||||
|
|
||||||
bool mergedEnvironments();
|
bool mergedEnvironments();
|
||||||
QList<EnvironmentItem> userChanges() const;
|
QList<EnvironmentItem> userChanges() const;
|
||||||
@@ -108,7 +107,6 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void userChangesUpdated();
|
void userChangesUpdated();
|
||||||
void clearSystemEnvironmentCheckBoxClicked(bool on);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void editEnvironmentButtonClicked();
|
void editEnvironmentButtonClicked();
|
||||||
@@ -119,7 +117,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
EnvironmentModel *m_model;
|
EnvironmentModel *m_model;
|
||||||
QCheckBox *m_clearSystemEnvironmentCheckBox;
|
|
||||||
QTreeView *m_environmentTreeView;
|
QTreeView *m_environmentTreeView;
|
||||||
QPushButton *m_editButton;
|
QPushButton *m_editButton;
|
||||||
QPushButton *m_addButton;
|
QPushButton *m_addButton;
|
||||||
|
|||||||
@@ -44,13 +44,17 @@ Qt4BuildEnvironmentWidget::Qt4BuildEnvironmentWidget(Qt4Project *project)
|
|||||||
: BuildStepConfigWidget(), m_pro(project)
|
: BuildStepConfigWidget(), m_pro(project)
|
||||||
{
|
{
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
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);
|
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this);
|
||||||
vbox->addWidget(m_buildEnvironmentWidget);
|
vbox->addWidget(m_buildEnvironmentWidget);
|
||||||
|
|
||||||
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
||||||
this, SLOT(environmentModelUserChangesUpdated()));
|
this, SLOT(environmentModelUserChangesUpdated()));
|
||||||
connect(m_buildEnvironmentWidget, SIGNAL(clearSystemEnvironmentCheckBoxClicked(bool)),
|
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
|
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +70,7 @@ void Qt4BuildEnvironmentWidget::init(const QString &buildConfiguration)
|
|||||||
|
|
||||||
m_buildConfiguration = 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->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
|
||||||
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
|
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
|
||||||
m_buildEnvironmentWidget->updateButtons();
|
m_buildEnvironmentWidget->updateButtons();
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QCheckBox;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class EnvironmentWidget;
|
class EnvironmentWidget;
|
||||||
}
|
}
|
||||||
@@ -57,6 +61,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
|
ProjectExplorer::EnvironmentWidget *m_buildEnvironmentWidget;
|
||||||
|
QCheckBox *m_clearSystemEnvironmentCheckBox;
|
||||||
Qt4Project *m_pro;
|
Qt4Project *m_pro;
|
||||||
QString m_buildConfiguration;
|
QString m_buildConfiguration;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user