recoll GUI: add menu option to retry failed files

This commit is contained in:
Jean-Francois Dockes 2015-04-24 10:47:33 +02:00
parent 1e6f56522e
commit 7876fba5f7
2 changed files with 31 additions and 1 deletions

View File

@ -60,11 +60,20 @@
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QMenuBar" name="MenuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="fileMenu">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="fileToggleIndexingAction"/>
<addaction name="fileRetryFailedAction"/>
<addaction name="fileRebuildIndexAction"/>
<addaction name="separator"/>
<addaction name="fileEraseSearchHistoryAction"/>
@ -461,6 +470,20 @@
<string>Query Fragments</string>
</property>
</action>
<action name="fileRetryFailedAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string> With failed files retrying</string>
</property>
<property name="toolTip">
<string>Next update will retry previously failed files</string>
</property>
<property name="name" stdset="0">
<cstring>fileToggleIndexingAction</cstring>
</property>
</action>
</widget>
<layoutdefault spacing="2" margin="2"/>
<customwidgets>

View File

@ -449,6 +449,7 @@ void RclMain::init()
fileRebuildIndexAction->setEnabled(false);
fileToggleIndexingAction->setEnabled(false);
fileRetryFailedAction->setEnabled(false);
// Start timer on a slow period (used for checking ^C). Will be
// speeded up during indexing
periodictimer->start(1000);
@ -793,6 +794,7 @@ void RclMain::periodic100()
m_indexerState = IXST_RUNNINGMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
fileToggleIndexingAction->setEnabled(true);
fileRetryFailedAction->setEnabled(false);
fileRebuildIndexAction->setEnabled(false);
periodictimer->setInterval(200);
} else {
@ -800,6 +802,7 @@ void RclMain::periodic100()
if (pidfile.open() == 0) {
m_indexerState = IXST_NOTRUNNING;
fileToggleIndexingAction->setText(tr("Update &Index"));
fileRetryFailedAction->setEnabled(true);
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(true);
periodictimer->setInterval(1000);
@ -808,6 +811,7 @@ void RclMain::periodic100()
m_indexerState = IXST_RUNNINGNOTMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
fileToggleIndexingAction->setEnabled(true);
fileRetryFailedAction->setEnabled(false);
fileRebuildIndexAction->setEnabled(false);
periodictimer->setInterval(200);
}
@ -838,7 +842,7 @@ void RclMain::periodic100()
fileExit();
}
// This gets called when the "update iindex" action is activated. It executes
// This gets called when the "update index" action is activated. It executes
// the requested action, and disables the menu entry. This will be
// re-enabled by the indexing status check
void RclMain::toggleIndexing()
@ -885,6 +889,8 @@ void RclMain::toggleIndexing()
vector<string> args;
args.push_back("-c");
args.push_back(theconfig->getConfDir());
if (fileRetryFailedAction->isChecked())
args.push_back("-k");
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
}
@ -1529,6 +1535,7 @@ void RclMain::updateIdxForDocs(vector<Rcl::Doc>& docs)
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
}
fileToggleIndexingAction->setEnabled(false);
fileRetryFailedAction->setEnabled(false);
}
/**