ProjectFileWizard/Add new: Handle profiles with identical basenames

correctly (disambiguate, add a tooltip indicating the path).
Task-number: QTCREATORBUG-819
This commit is contained in:
Friedemann Kleint
2010-03-15 15:37:08 +01:00
parent 5b9d6614f2
commit 43f9c27b31
3 changed files with 34 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) :
m_ui(new Ui::WizardPage)
{
m_ui->setupUi(this);
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotProjectChanged(int)));
}
ProjectWizardPage::~ProjectWizardPage()
@@ -53,6 +55,11 @@ void ProjectWizardPage::setProjects(const QStringList &p)
m_ui->projectComboBox->addItems(p);
}
void ProjectWizardPage::setProjectToolTips(const QStringList &t)
{
m_projectToolTips = t;
}
int ProjectWizardPage::currentProjectIndex() const
{
return m_ui->projectComboBox->currentIndex();
@@ -112,3 +119,15 @@ void ProjectWizardPage::setFilesDisplay(const QString &commonPath, const QString
}
m_ui->filesLabel->setText(fileMessage);
}
void ProjectWizardPage::setProjectToolTip(const QString &tt)
{
m_ui->projectComboBox->setToolTip(tt);
m_ui->projectLabel->setToolTip(tt);
}
void ProjectWizardPage::slotProjectChanged(int index)
{
setProjectToolTip(index >= 0 && index < m_projectToolTips.size() ?
m_projectToolTips.at(index) : QString());
}