ProjectExplorer: Add history completer to path choosers

Change-Id: Ifbe1d0d69a131e397d01d26c46ac49aab523aadb
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2013-11-25 14:35:35 +01:00
parent 4a527c67d3
commit b70f159033
10 changed files with 12 additions and 1 deletions

View File

@@ -501,7 +501,9 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
m_cxx11Flags->setToolTip(tr("Comma-separated list of flags that turn on C++11 support."));
m_mkspecs->setToolTip(tr("Comma-separated list of mkspecs."));
m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand);
m_compilerCommand->setHistoryCompleter(QLatin1String("PE.ToolChainCommand.History"));
m_makeCommand->setExpectedKind(PathChooser::ExistingCommand);
m_makeCommand->setHistoryCompleter(QLatin1String("PE.MakeCommand.History"));
m_mainLayout->addRow(tr("&Compiler path:"), m_compilerCommand);
m_mainLayout->addRow(tr("&Make path:"), m_makeCommand);
m_mainLayout->addRow(tr("&ABI:"), m_abiWidget);

View File

@@ -336,6 +336,7 @@ QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName,
pathChooser->setExpectedKind(Utils::PathChooser::Command);
else if (expectedKind == QLatin1String("any"))
pathChooser->setExpectedKind(Utils::PathChooser::Any);
pathChooser->setHistoryCompleter(QString::fromLatin1("PE.Custom.") + m_parameters->id + QLatin1Char('.') + field.name);
registerField(fieldName, pathChooser, "path", SIGNAL(changed(QString)));
// Connect to completeChanged() for derived classes that reimplement isComplete()
@@ -523,6 +524,7 @@ CustomWizardPage::CustomWizardPage(const QSharedPointer<CustomWizardContext> &ct
CustomWizardFieldPage(ctx, parameters, parent),
m_pathChooser(new Utils::PathChooser)
{
m_pathChooser->setHistoryCompleter(QLatin1String("PE.ProjectDir.History"));
addRow(tr("Path:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(validChanged()), this, SIGNAL(completeChanged()));
}

View File

@@ -587,6 +587,7 @@ CustomWizardParameters::ParseResult
if (!booleanAttributeValue(reader, wizardEnabledAttributeC, true))
return ParseDisabled;
bp->id = attributeValue(reader, idAttributeC);
id = bp->id;
bp->category = attributeValue(reader, categoryAttributeC);
bp->kind = kindAttribute(reader);
bp->requiredFeatures = requiredFeatures(reader);

View File

@@ -111,6 +111,7 @@ public:
Core::IWizard::Data *bp, QString *errorMessage);
QString toString() const;
QString id;
QString directory;
QString klass;
QList<CustomWizardFile> files;

View File

@@ -852,6 +852,7 @@ GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) :
const QStringList gnuVersionArgs = QStringList(QLatin1String("--version"));
m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand);
m_compilerCommand->setCommandVersionArguments(gnuVersionArgs);
m_compilerCommand->setHistoryCompleter(QLatin1String("PE.Gcc.Command.History"));
m_mainLayout->addRow(tr("&Compiler path:"), m_compilerCommand);
m_platformCodeGenFlagsLineEdit = new QLineEdit(this);
m_platformCodeGenFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformCodeGenFlags()));

View File

@@ -59,6 +59,7 @@ ImportWidget::ImportWidget(QWidget *parent) :
layout->addWidget(m_pathChooser);
m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_pathChooser->setHistoryCompleter(QLatin1String("SourceDir.History"));
QPushButton *importButton = new QPushButton(tr("Import"), widget);
layout->addWidget(importButton);

View File

@@ -61,6 +61,7 @@ SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k, const Kit
{
m_chooser = new Utils::PathChooser;
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_chooser->setHistoryCompleter(QLatin1String("PE.SysRoot.History"));
m_chooser->setFileName(SysRootKitInformation::sysRoot(k));
connect(m_chooser, SIGNAL(changed(QString)), this, SLOT(pathWasChanged()));
}

View File

@@ -236,6 +236,7 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step)
{
m_ui.setupUi(this);
m_ui.command->setExpectedKind(Utils::PathChooser::Command);
m_ui.command->setHistoryCompleter(QLatin1String("PE.ProcessStepCommand.History"));
m_ui.workingDirectory->setExpectedKind(Utils::PathChooser::Directory);
BuildConfiguration *bc = m_step->buildConfiguration();

View File

@@ -696,7 +696,7 @@ void SelectableFilesDialogAddDirectory::createPathChooser(QVBoxLayout *layout, c
m_pathChooser = new Utils::PathChooser;
m_pathChooser->setPath(path);
m_pathChooser->setHistoryCompleter(QLatin1String("PE.AddToProjectDir.History"));
m_sourceDirectoryLabel = new QLabel(tr("Source directory:"));
hbox->addWidget(m_sourceDirectoryLabel);

View File

@@ -180,6 +180,7 @@ void TargetSetupWidget::addBuildInfo(BuildInfo *info, bool isImport)
pathChooser->setExpectedKind(Utils::PathChooser::Directory);
pathChooser->setFileName(info->buildDirectory);
pathChooser->setEnabled(info->supportsShadowBuild);
pathChooser->setHistoryCompleter(QLatin1String("BuildDir.History"));
pathChooser->setReadOnly(!info->supportsShadowBuild || isImport);
m_newBuildsLayout->addWidget(pathChooser, pos * 2, 1);