GUI: move some options to a new View menu, and add some more index stats

This commit is contained in:
Jean-Francois Dockes 2016-04-11 17:50:39 +02:00
parent d0400bdce7
commit 87e40eed16
2 changed files with 43 additions and 8 deletions

View File

@ -82,13 +82,17 @@
<addaction name="fileEraseSearchHistoryAction"/>
<addaction name="fileEraseDocHistoryAction"/>
<addaction name="separator"/>
<addaction name="fileExitAction"/>
</widget>
<widget class="QMenu" name="viewMenu">
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="showMissingHelpers_Action"/>
<addaction name="showActiveTypes_Action"/>
<addaction name="actionShow_index_statistics"/>
<addaction name="separator"/>
<addaction name="toggleFullScreenAction"/>
<addaction name="separator"/>
<addaction name="fileExitAction"/>
</widget>
<widget class="QMenu" name="toolsMenu">
<property name="title">
@ -139,6 +143,7 @@
<addaction name="actionSaveResultsAsCSV"/>
</widget>
<addaction name="fileMenu"/>
<addaction name="viewMenu"/>
<addaction name="toolsMenu"/>
<addaction name="menuResults"/>
<addaction name="preferencesMenu"/>
@ -190,7 +195,7 @@
</action>
<action name="showMissingHelpers_Action">
<property name="text">
<string>&amp;Show missing helpers</string>
<string>Missing &amp;helpers</string>
</property>
<property name="name" stdset="0">
<cstring>showMissingHelpers_Action</cstring>
@ -198,7 +203,7 @@
</action>
<action name="showActiveTypes_Action">
<property name="text">
<string>&amp;Show indexed types</string>
<string>Indexed &amp;MIME types</string>
</property>
<property name="name" stdset="0">
<cstring>showActiveTypes_Action</cstring>
@ -524,7 +529,7 @@
</action>
<action name="actionShow_index_statistics">
<property name="text">
<string>Show index statistics</string>
<string>Index &amp;statistics</string>
</property>
</action>
</widget>

View File

@ -45,6 +45,7 @@
#include "rclhelp.h"
#include "wasatorcl.h"
#include "execmd.h"
#include "indexer.h"
#ifdef RCL_USE_ASPELL
#include "rclaspell.h"
@ -292,19 +293,48 @@ void SpellW::showStats()
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr("Smallest document length")));
new QTableWidgetItem(tr("Smallest document length (terms)")));
resTW->setItem(row++, 1, new QTableWidgetItem(
QString::number(res.mindoclen)));
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr("Longest document length")));
new QTableWidgetItem(tr("Longest document length (terms)")));
resTW->setItem(row++, 1, new QTableWidgetItem(
QString::number(res.maxdoclen)));
if (!theconfig)
return;
ConfSimple cs(theconfig->getIdxStatusFile().c_str(), 1);
DbIxStatus st;
cs.get("fn", st.fn);
cs.get("docsdone", &st.docsdone);
cs.get("filesdone", &st.filesdone);
cs.get("fileerrors", &st.fileerrors);
cs.get("dbtotdocs", &st.dbtotdocs);
cs.get("totfiles", &st.totfiles);
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr("Results from last indexing:")));
resTW->setItem(row++, 1, new QTableWidgetItem(""));
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr(" Documents created/updated")));
resTW->setItem(row++, 1,
new QTableWidgetItem(QString::number(st.docsdone)));
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr(" Files tested")));
resTW->setItem(row++, 1,
new QTableWidgetItem(QString::number(st.filesdone)));
resTW->setRowCount(row+1);
resTW->setItem(row, 0,
new QTableWidgetItem(tr(" Unindexed files")));
resTW->setItem(row++, 1,
new QTableWidgetItem(QString::number(st.fileerrors)));
baseWordLE->setText(QString::fromLocal8Bit(theconfig->getDbDir().c_str()));
ExecCmd cmd;
@ -348,7 +378,7 @@ void SpellW::showStats()
for (multimap<int, string>::const_reverse_iterator it = mtbycnt.rbegin();
it != mtbycnt.rend(); it++) {
resTW->setRowCount(row+1);
resTW->setItem(row, 0, new QTableWidgetItem(
resTW->setItem(row, 0, new QTableWidgetItem(QString(" ") +
QString::fromUtf8(it->second.c_str())));
resTW->setItem(row++, 1, new QTableWidgetItem(
QString::number(it->first)));