GUI: add option to "special index" for setting the diagnostics file

This commit is contained in:
Jean-Francois Dockes 2021-04-01 10:50:46 +02:00
parent 4756b1252b
commit 2f646a70a4
3 changed files with 64 additions and 4 deletions

View File

@ -399,12 +399,18 @@ void RclMain::rebuildIndex()
}
}
void SpecIdxW::onBrowsePB_clicked()
void SpecIdxW::onTargBrowsePB_clicked()
{
QString dir = myGetFileName(true, tr("Top indexed entity"), true);
targLE->setText(dir);
}
void SpecIdxW::onDiagsBrowsePB_clicked()
{
QString fn = myGetFileName(false, tr("Diagnostics file"));
diagsLE->setText(fn);
}
bool SpecIdxW::noRetryFailed()
{
return !retryFailedCB->isChecked();
@ -430,6 +436,11 @@ std::string SpecIdxW::toptarg()
return qs2utf8s(targLE->text());
}
std::string SpecIdxW::diagsfile()
{
return qs2utf8s(diagsLE->text());
}
void SpecIdxW::onTargLE_textChanged(const QString& text)
{
if (text.isEmpty())
@ -484,6 +495,12 @@ void RclMain::specialIndex()
args.push_back("-r");
}
string diagsfile = specidx->diagsfile();
if (!diagsfile.empty()) {
args.push_back("--diagfile");
args.push_back(diagsfile);
}
if (specidx->eraseFirst()) {
if (top.empty()) {
args.push_back("-Z");

View File

@ -33,19 +33,22 @@ public:
: QDialog(parent) {
setupUi(this);
selPatsLE->setEnabled(false);
connect(browsePB, SIGNAL(clicked()), this, SLOT(onBrowsePB_clicked()));
connect(targBrowsePB, SIGNAL(clicked()), this, SLOT(onTargBrowsePB_clicked()));
connect(targLE, SIGNAL(textChanged(const QString&)),
this, SLOT(onTargLE_textChanged(const QString&)));
connect(diagsBrowsePB, SIGNAL(clicked()), this, SLOT(onDiagsBrowsePB_clicked()));
}
bool noRetryFailed();
bool eraseFirst();
std::vector<std::string> selpatterns();
std::string toptarg();
std::string diagsfile();
public slots:
void onTargLE_textChanged(const QString&);
void onBrowsePB_clicked();
void onTargBrowsePB_clicked();
void onDiagsBrowsePB_clicked();
};

View File

@ -58,7 +58,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="browsePB">
<widget class="QPushButton" name="targBrowsePB">
<property name="text">
<string>Browse</string>
</property>
@ -98,6 +98,46 @@
</item>
</layout>
</item>
<item>
<layout class="QGridLayout">
<item row="1" column="0">
<widget class="QLineEdit" name="diagsLE">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>8</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="diagsBrowsePB">
<property name="text">
<string>Browse</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel2">
<property name="text">
<string>Diagnostics output file. Will be truncated and receive indexing diagnostics (reasons for files not being indexed).</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">