ENH: search is case insensitive

ENH:  put back prompt for generator, and change combo to label
      showing current generator.
This commit is contained in:
Clinton Stimpson 2007-11-06 00:02:08 -05:00
parent d0a7608bb1
commit b61e5ff0f2
4 changed files with 24 additions and 20 deletions

View File

@ -155,9 +155,11 @@ void CMakeSetupDialog::initialize()
this->CacheValues, SLOT(setShowAdvanced(bool)));
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
this->CacheValues, SLOT(setSearchFilter(QString)));
QStringList gens = this->CMakeThread->cmakeInstance()->availableGenerators();
this->Generators->addItems(gens);
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(generatorChanged(QString)),
this, SLOT(updateGeneratorLabel(QString)));
this->updateGeneratorLabel(QString());
// get the saved binary directories
QSettings settings;
@ -172,13 +174,6 @@ void CMakeSetupDialog::initialize()
}
}
this->BinaryDirectory->addItems(buildPaths);
QString lastGen = settings.value("LastGenerator").toString();
int idx = this->Generators->findText(lastGen);
if(idx != -1)
{
this->Generators->setCurrentIndex(idx);
}
}
CMakeSetupDialog::~CMakeSetupDialog()
@ -213,14 +208,11 @@ void CMakeSetupDialog::doConfigure()
dir.mkpath(".");
}
/*
// prompt for generator if one doesn't exist
if(this->CMakeThread->cmakeInstance()->generator().isEmpty())
{
this->promptForGenerator();
}
*/
this->CMakeThread->cmakeInstance()->setGenerator(this->Generators->currentText());
this->InterruptButton->setEnabled(true);
this->setEnabledState(false);
@ -405,7 +397,6 @@ void CMakeSetupDialog::setEnabledState(bool enabled)
this->CancelButton->setEnabled(enabled);
}
/*
void CMakeSetupDialog::promptForGenerator()
{
QStringList gens = this->CMakeThread->cmakeInstance()->availableGenerators();
@ -428,5 +419,19 @@ void CMakeSetupDialog::promptForGenerator()
dialog.exec();
this->CMakeThread->cmakeInstance()->setGenerator(combo->currentText());
}
*/
void CMakeSetupDialog::updateGeneratorLabel(const QString& gen)
{
QString str = tr("Build for: ");
if(gen.isEmpty())
{
str += tr("None");
}
else
{
str += gen;
}
this->Generator->setText(str);
}

View File

@ -52,7 +52,8 @@ protected slots:
void setBinaryDirectory(const QString& dir);
void showProgress(const QString& msg, float percent);
void setEnabledState(bool);
//void promptForGenerator();
void promptForGenerator();
void updateGeneratorLabel(const QString& gen);
protected:
void closeEvent(QCloseEvent*);

View File

@ -91,15 +91,12 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_3" >
<widget class="QLabel" name="Generator" >
<property name="text" >
<string>Build For:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="Generators" />
</item>
<item>
<spacer>
<property name="orientation" >

View File

@ -39,6 +39,7 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p)
this->AdvancedFilter->setFilterRegExp(AdvancedRegExp[0]);
this->SearchFilter = new QSortFilterProxyModel(this);
this->SearchFilter->setSourceModel(this->AdvancedFilter);
this->SearchFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
this->setModel(this->SearchFilter);
// our delegate for creating our editors