Skip to content

Commit

Permalink
Added a 'total matches' label in the reader
Browse files Browse the repository at this point in the history
  • Loading branch information
AmericanEnglish committed Nov 23, 2017
1 parent eb361e7 commit 2526f87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpp/widgets/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ void Reader::newSearch(QString basepath, QStringList Files, QStringList Dates, Q
base = basepath;
len = Files.length();
filesSearched->setMaximum(len);
tMatchesLabel->hide();
tMatches = 0;
progWidget->show();
files = Files;
qDebug() << "+Reader: Building additional objects on the heap...";
Expand Down Expand Up @@ -120,6 +122,9 @@ void Reader::initGui() {
progWidget = new QWidget(this);
progWidget->setLayout(progBox);

tMatchesLabel = new QLabel(this);
tMatchesLabel->hide();

// Setup
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->addWidget(logTitle);
Expand All @@ -137,6 +142,7 @@ void Reader::initGui() {
outerVBox->setAlignment(Qt::AlignCenter);
outerVBox->addWidget(hboxWidget);
outerVBox->addWidget(progWidget);
outerVBox->addWidget(tMatchesLabel);

setLayout(outerVBox);
}
Expand Down Expand Up @@ -256,6 +262,8 @@ void Reader::tRefresh() {
if (currentComplete == files.length()) {
poll->stop();
progWidget->hide();
tMatchesLabel->setText("Total Matches: " + QString::number(tMatches));
tMatchesLabel->show();
// delete searchObj;
// delete searchThd;
}
Expand All @@ -271,6 +279,7 @@ void Reader::tRefresh() {
// qDebug() << "+Reader: Match!" << newDate;
allData[newDate] = entries[i];
appendToTree(newDate);
tMatches += entries[i].length();
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions headers/widgets/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ class Reader : public QWidget {
bool *stopped;
QProgressBar *filesSearched;
QWidget *progWidget;
QLabel *tMatchesLabel;
int tMatches = 0;
};

0 comments on commit 2526f87

Please sign in to comment.