|
a/src/qtgui/rclmain_w.cpp |
|
b/src/qtgui/rclmain_w.cpp |
|
... |
|
... |
66 |
#include "internfile.h"
|
66 |
#include "internfile.h"
|
67 |
#include "docseqdb.h"
|
67 |
#include "docseqdb.h"
|
68 |
#include "docseqhist.h"
|
68 |
#include "docseqhist.h"
|
69 |
#include "confguiindex.h"
|
69 |
#include "confguiindex.h"
|
70 |
#include "restable.h"
|
70 |
#include "restable.h"
|
|
|
71 |
#include "listdialog.h"
|
71 |
|
72 |
|
72 |
using namespace confgui;
|
73 |
using namespace confgui;
|
73 |
|
74 |
|
74 |
#include "rclmain_w.h"
|
75 |
#include "rclmain_w.h"
|
75 |
#include "rclhelp.h"
|
76 |
#include "rclhelp.h"
|
|
... |
|
... |
223 |
this, SLOT(eraseSearchHistory()));
|
224 |
this, SLOT(eraseSearchHistory()));
|
224 |
connect(helpAbout_RecollAction, SIGNAL(activated()),
|
225 |
connect(helpAbout_RecollAction, SIGNAL(activated()),
|
225 |
this, SLOT(showAboutDialog()));
|
226 |
this, SLOT(showAboutDialog()));
|
226 |
connect(showMissingHelpers_Action, SIGNAL(activated()),
|
227 |
connect(showMissingHelpers_Action, SIGNAL(activated()),
|
227 |
this, SLOT(showMissingHelpers()));
|
228 |
this, SLOT(showMissingHelpers()));
|
|
|
229 |
connect(showActiveTypes_Action, SIGNAL(activated()),
|
|
|
230 |
this, SLOT(showActiveTypes()));
|
228 |
connect(userManualAction, SIGNAL(activated()),
|
231 |
connect(userManualAction, SIGNAL(activated()),
|
229 |
this, SLOT(startManual()));
|
232 |
this, SLOT(startManual()));
|
230 |
connect(toolsDoc_HistoryAction, SIGNAL(activated()),
|
233 |
connect(toolsDoc_HistoryAction, SIGNAL(activated()),
|
231 |
this, SLOT(showDocHistory()));
|
234 |
this, SLOT(showDocHistory()));
|
232 |
connect(toolsAdvanced_SearchAction, SIGNAL(activated()),
|
235 |
connect(toolsAdvanced_SearchAction, SIGNAL(activated()),
|
|
... |
|
... |
747 |
msg += tr("No helpers found missing");
|
750 |
msg += tr("No helpers found missing");
|
748 |
}
|
751 |
}
|
749 |
QMessageBox::information(this, tr("Missing helper programs"), msg);
|
752 |
QMessageBox::information(this, tr("Missing helper programs"), msg);
|
750 |
}
|
753 |
}
|
751 |
|
754 |
|
|
|
755 |
void RclMain::showActiveTypes()
|
|
|
756 |
{
|
|
|
757 |
if (rcldb == 0) {
|
|
|
758 |
QMessageBox::warning(0, tr("Error"),
|
|
|
759 |
tr("Index not open"),
|
|
|
760 |
QMessageBox::Ok,
|
|
|
761 |
QMessageBox::NoButton);
|
|
|
762 |
return;
|
|
|
763 |
}
|
|
|
764 |
|
|
|
765 |
// Get list of all mime types in index. For this, we use a
|
|
|
766 |
// wildcard field search on mtype
|
|
|
767 |
Rcl::TermMatchResult matches;
|
|
|
768 |
string prefix;
|
|
|
769 |
if (!rcldb->termMatch(Rcl::Db::ET_WILD, "", "*", matches, -1, "mtype",
|
|
|
770 |
&prefix)) {
|
|
|
771 |
QMessageBox::warning(0, tr("Error"),
|
|
|
772 |
tr("Index query error"),
|
|
|
773 |
QMessageBox::Ok,
|
|
|
774 |
QMessageBox::NoButton);
|
|
|
775 |
return;
|
|
|
776 |
}
|
|
|
777 |
|
|
|
778 |
// Build the set of mtypes, stripping the prefix
|
|
|
779 |
set<string> mtypesfromdb;
|
|
|
780 |
for (list<Rcl::TermMatchEntry>::const_iterator it = matches.entries.begin();
|
|
|
781 |
it != matches.entries.end(); it++) {
|
|
|
782 |
mtypesfromdb.insert(it->term.substr(prefix.size()));
|
|
|
783 |
}
|
|
|
784 |
|
|
|
785 |
// All types listed in mimeconf:
|
|
|
786 |
list<string> mtypesfromconfig = theconfig->getAllMimeTypes();
|
|
|
787 |
|
|
|
788 |
// Intersect file system types with config types (those not in the
|
|
|
789 |
// config can be indexed by name, not by content)
|
|
|
790 |
set<string> mtypesfromdbconf;
|
|
|
791 |
for (list<string>::const_iterator it = mtypesfromconfig.begin();
|
|
|
792 |
it != mtypesfromconfig.end(); it++) {
|
|
|
793 |
if (mtypesfromdb.find(*it) != mtypesfromdb.end())
|
|
|
794 |
mtypesfromdbconf.insert(*it);
|
|
|
795 |
}
|
|
|
796 |
|
|
|
797 |
// Substract the types for missing helpers (the docs are indexed by name only):
|
|
|
798 |
string miss = theconfig->getMissingHelperDesc();
|
|
|
799 |
if (!miss.empty()) {
|
|
|
800 |
FIMissingStore st;
|
|
|
801 |
FileInterner::getMissingFromDescription(&st, miss);
|
|
|
802 |
map<string, set<string> >::const_iterator it;
|
|
|
803 |
for (it = st.m_typesForMissing.begin();
|
|
|
804 |
it != st.m_typesForMissing.end(); it++) {
|
|
|
805 |
set<string>::const_iterator it1;
|
|
|
806 |
for (it1 = it->second.begin();
|
|
|
807 |
it1 != it->second.end(); it1++) {
|
|
|
808 |
set<string>::iterator it2 = mtypesfromdbconf.find(*it1);
|
|
|
809 |
if (it2 != mtypesfromdbconf.end())
|
|
|
810 |
mtypesfromdbconf.erase(it2);
|
|
|
811 |
}
|
|
|
812 |
}
|
|
|
813 |
}
|
|
|
814 |
ListDialog dialog;
|
|
|
815 |
dialog.setWindowTitle(tr("Indexed Mime Types"));
|
|
|
816 |
|
|
|
817 |
// Turn the result into a string and display
|
|
|
818 |
dialog.groupBox->setTitle(tr("Content has been indexed for these mime types:"));
|
|
|
819 |
|
|
|
820 |
// We replace the list with an editor so that the user can copy/paste
|
|
|
821 |
delete dialog.listWidget;
|
|
|
822 |
QTextEdit *editor = new QTextEdit(dialog.groupBox);
|
|
|
823 |
editor->setReadOnly(TRUE);
|
|
|
824 |
dialog.horizontalLayout->addWidget(editor);
|
|
|
825 |
|
|
|
826 |
for (set<string>::const_iterator it = mtypesfromdbconf.begin();
|
|
|
827 |
it != mtypesfromdbconf.end(); it++) {
|
|
|
828 |
editor->append(QString::fromAscii(it->c_str()));
|
|
|
829 |
}
|
|
|
830 |
editor->moveCursor(QTextCursor::Start);
|
|
|
831 |
editor->ensureCursorVisible();
|
|
|
832 |
dialog.exec();
|
|
|
833 |
}
|
|
|
834 |
|
752 |
// If a preview (toplevel) window gets closed by the user, we need to
|
835 |
// If a preview (toplevel) window gets closed by the user, we need to
|
753 |
// clean up because there is no way to reopen it. And check the case
|
836 |
// clean up because there is no way to reopen it. And check the case
|
754 |
// where the current one is closed
|
837 |
// where the current one is closed
|
755 |
void RclMain::previewClosed(Preview *w)
|
838 |
void RclMain::previewClosed(Preview *w)
|
756 |
{
|
839 |
{
|