Add "Add library wizard" to the pro file editor

Reviewed-by: dt <qtc-committer@nokia.com>
Task-number: QTCREATORBUG-125
This commit is contained in:
Jarek Kobus
2010-08-16 18:23:30 +02:00
parent 8cd3b54949
commit 573006f370
18 changed files with 1870 additions and 31 deletions

View File

@@ -173,13 +173,27 @@ void PathChooser::slotBrowse()
newPath = QFileDialog::getExistingDirectory(this,
makeDialogTitle(tr("Choose Directory")), predefined);
break;
case PathChooser::File: // fall through
case PathChooser::Command:
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose File")), predefined,
m_d->m_dialogFilter);
break;
case PathChooser::Any: {
QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setWindowTitle(makeDialogTitle(tr("Choose File")));
QFileInfo fi(predefined);
if (fi.exists())
dialog.setDirectory(fi.absolutePath());
dialog.setNameFilter(m_d->m_dialogFilter); // fix QFileDialog so that it filters properly: lib*.a
if (dialog.exec() == QDialog::Accepted) { // probably loop here until the *.framework dir match
QStringList paths = dialog.selectedFiles();
if (!paths.isEmpty())
newPath = paths.at(0);
}
break;
}
default:
;
@@ -255,6 +269,9 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
// i.e. search $PATH for a matching file
break;
case PathChooser::Any:
break;
default:
;
}