Commit b112c277 authored by Daniel Teske's avatar Daniel Teske

Disable the "Configure Project" button if no target is selected

Change-Id: I563b93beb836dad43146319f97fb48192a139511
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 9c68ad01
......@@ -119,16 +119,20 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(ProjectExplorer::Project *project
layout->addLayout(hbox);
layout->setMargin(0);
hbox->addStretch();
QPushButton *button = new QPushButton(this);
button->setText(tr("Configure Project"));
hbox->addWidget(button);
m_configureButton = new QPushButton(this);
m_configureButton->setText(tr("Configure Project"));
hbox->addWidget(m_configureButton);
layout->addStretch(10);
connect(button, SIGNAL(clicked()),
completeChanged();
connect(m_configureButton, SIGNAL(clicked()),
this, SLOT(done()));
connect(m_targetSetupPage, SIGNAL(noteTextLinkActivated()),
this, SLOT(noteTextLinkActivated()));
connect(m_targetSetupPage, SIGNAL(completeChanged()),
this, SLOT(completeChanged()));
connect(m_project->qt4ProjectManager(), SIGNAL(unconfiguredSettingsChanged()),
this, SLOT(updateNoteText()));
}
......@@ -193,3 +197,8 @@ void TargetSetupPageWrapper::noteTextLinkActivated()
Core::ICore::instance()->showOptionsDialog(QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY),
QLatin1String(Constants::UNCONFIGURED_SETTINGS_PAGE_ID));
}
void TargetSetupPageWrapper::completeChanged()
{
m_configureButton->setEnabled(m_targetSetupPage->isComplete());
}
......@@ -37,6 +37,8 @@
#include <QString>
QT_FORWARD_DECLARE_CLASS(QPushButton)
namespace Qt4ProjectManager {
class TargetSetupPage;
class Qt4Project;
......@@ -69,10 +71,12 @@ private slots:
void done();
void noteTextLinkActivated();
void updateNoteText();
void completeChanged();
private:
Qt4Project *m_project;
TargetSetupPage *m_targetSetupPage;
QPushButton *m_configureButton;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment