forked from qt-creator/qt-creator
Disable the browse button if the shadow build checkbox is disabled.
This commit is contained in:
@@ -58,11 +58,11 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
|
|||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
// fix the layout
|
// fix the layout
|
||||||
QAbstractButton *browseButton = m_ui->shadowBuildDirEdit->buttonAtIndex(0);
|
m_browseButton = m_ui->shadowBuildDirEdit->buttonAtIndex(0);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
browseButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
browseButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
#endif
|
#endif
|
||||||
m_ui->gridLayout->addWidget(browseButton, 4, 2);
|
m_ui->gridLayout->addWidget(m_browseButton, 4, 2);
|
||||||
int minimumHeight = qMax(m_ui->qtVersionComboBox->sizeHint().height(), m_ui->manageQtVersionPushButtons->sizeHint().height());
|
int minimumHeight = qMax(m_ui->qtVersionComboBox->sizeHint().height(), m_ui->manageQtVersionPushButtons->sizeHint().height());
|
||||||
Qt::Alignment labelAlignment = Qt::Alignment(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
|
Qt::Alignment labelAlignment = Qt::Alignment(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
|
||||||
for (int i = 0; i < m_ui->gridLayout->rowCount(); ++i) {
|
for (int i = 0; i < m_ui->gridLayout->rowCount(); ++i) {
|
||||||
@@ -137,6 +137,7 @@ void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
|
|||||||
bool shadowBuild = m_pro->value(buildConfiguration, "useShadowBuild").toBool();
|
bool shadowBuild = m_pro->value(buildConfiguration, "useShadowBuild").toBool();
|
||||||
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
|
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
|
||||||
m_ui->shadowBuildDirEdit->setEnabled(shadowBuild);
|
m_ui->shadowBuildDirEdit->setEnabled(shadowBuild);
|
||||||
|
m_browseButton->setEnabled(shadowBuild);
|
||||||
m_ui->shadowBuildDirEdit->setPath(m_pro->buildDirectory(buildConfiguration));
|
m_ui->shadowBuildDirEdit->setPath(m_pro->buildDirectory(buildConfiguration));
|
||||||
updateImportLabel();
|
updateImportLabel();
|
||||||
updateToolChainCombo();
|
updateToolChainCombo();
|
||||||
@@ -189,6 +190,7 @@ void Qt4ProjectConfigWidget::onBeforeBeforeShadowBuildDirBrowsed()
|
|||||||
void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
|
void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
|
||||||
{
|
{
|
||||||
m_ui->shadowBuildDirEdit->setEnabled(checked);
|
m_ui->shadowBuildDirEdit->setEnabled(checked);
|
||||||
|
m_browseButton->setEnabled(checked);
|
||||||
bool b = m_ui->shadowBuildCheckBox->isChecked();
|
bool b = m_ui->shadowBuildCheckBox->isChecked();
|
||||||
m_pro->setValue(m_buildConfiguration, "useShadowBuild", b);
|
m_pro->setValue(m_buildConfiguration, "useShadowBuild", b);
|
||||||
if (b)
|
if (b)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#define QT4PROJECTCONFIGWIDGET_H
|
#define QT4PROJECTCONFIGWIDGET_H
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
#include <QtGui/QPushButton>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
@@ -62,12 +63,14 @@ private slots:
|
|||||||
void qtVersionComboBoxCurrentIndexChanged(const QString &);
|
void qtVersionComboBoxCurrentIndexChanged(const QString &);
|
||||||
void manageQtVersions();
|
void manageQtVersions();
|
||||||
void selectToolChain(int index);
|
void selectToolChain(int index);
|
||||||
|
void toggleDetails();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateToolChainCombo();
|
void updateToolChainCombo();
|
||||||
void updateImportLabel();
|
void updateImportLabel();
|
||||||
void setToolChain(int index);
|
void setToolChain(int index);
|
||||||
Ui::Qt4ProjectConfigWidget *m_ui;
|
Ui::Qt4ProjectConfigWidget *m_ui;
|
||||||
|
QAbstractButton *m_browseButton;
|
||||||
Qt4Project *m_pro;
|
Qt4Project *m_pro;
|
||||||
QString m_buildConfiguration;
|
QString m_buildConfiguration;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user