From 590a8888fcf18881349d7ac5352bf88d31f5156b Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 8 Jan 2023 17:37:28 +0100 Subject: [PATCH] gui: Add index options group in index tab --- gui/mainwindow.cpp | 23 ++++-- gui/mainwindow.ui | 178 +++++++++++++++++++++++++++++---------------- 2 files changed, 133 insertions(+), 68 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 32a4256..74d53bf 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -222,16 +222,18 @@ void MainWindow::connectSignals() qCritical() << msg << Qt::endl; QMessageBox::critical(this, "IPC error", msg); }); - - /*connect(this, &MainWindow::startIpcPreviews, &previewCoordinator, &IPCPreviewClient::startGeneration, - Qt::QueuedConnection); - connect(this, &MainWindow::stopIpcPreviews, &ipcPreviewClient, &IPCPreviewClient::stopGeneration, - Qt::QueuedConnection); */ + connect(ui->radioMetadataOnly, &QRadioButton::toggled, this, + [this](bool toggled) + { + if(toggled) + { + this->ui->chkFillContentForContentless->setChecked(false); + }; + }); } void MainWindow::exportFailedPaths() { - QString filename = QString("/tmp/looqs_indexresult_failed_%1").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hhmmss")); QFile outFile(filename); @@ -312,6 +314,15 @@ void MainWindow::startIndexing() this->indexer->setTargetPaths(paths); QString ignorePatterns = ui->txtIgnorePatterns->text(); this->indexer->setIgnorePattern(ignorePatterns.split(";")); + + FileSaverOptions options; + options.fillExistingContentless = + ui->chkFillContentForContentless->isEnabled() && ui->chkFillContentForContentless->isChecked(); + options.metadataOnly = ui->radioMetadataOnly->isChecked(); + options.verbose = false; + options.keepGoing = true; + + this->indexer->setFileSaverOptions(options); this->indexer->beginIndexing(); QSettings settings; settings.setValue("indexPaths", pathSettingsValue); diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 9c520c7..03b452b 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -18,16 +18,13 @@ - - - QTabWidget::South - 1 + 2 @@ -82,7 +79,7 @@ 0 0 1244 - 633 + 641 @@ -195,62 +192,6 @@ - - - - - - Start indexing - - - - - - - Add paths to scan - - - - - - - - - - - - false - - - Delete - - - - - - - ... - - - - - - - Add - - - - - - - - - - Ignore patterns, separated by ';'. Example: *.js;*Downloads* - - - - Qt::PreventContextMenu @@ -452,6 +393,102 @@ + + + + Index options + + + + + + Ignore patterns, separated by ';'. Example: *.js;*Downloads*: + + + + + + + + + + Qt::Horizontal + + + + + + + Index everything (metadata + file content) + + + + + + + false + + + Index content for files previously indexed without content + + + + + + + Index metadata only, don't process content of files + + + + + + + + + + Start indexing + + + + + + + Add paths to scan + + + + + + + + + + + + false + + + Delete + + + + + + + ... + + + + + + + Add + + + + + + @@ -701,5 +738,22 @@ - + + + radioIndexEverything + toggled(bool) + chkFillContentForContentless + setEnabled(bool) + + + 639 + 464 + + + 639 + 497 + + + +