"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "qtgui/rclm_wins.cpp" between
recoll-1.25.23.tar.gz and recoll-1.26.0.tar.gz

About: Recoll is a personal full text search tool based on Xapian as back-end (with Qt GUI).

rclm_wins.cpp  (recoll-1.25.23):rclm_wins.cpp  (recoll-1.26.0)
/* Copyright (C) 2005 J.F.Dockes /* Copyright (C) 2005-2019 J.F.Dockes
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
skipping to change at line 27 skipping to change at line 27
#include "autoconfig.h" #include "autoconfig.h"
#include <QShortcut> #include <QShortcut>
#include <QMessageBox> #include <QMessageBox>
#include "log.h" #include "log.h"
#include "internfile.h" #include "internfile.h"
#include "listdialog.h" #include "listdialog.h"
#include "confgui/confguiindex.h" #include "confgui/confguiindex.h"
#include "idxsched.h" #include "idxsched.h"
#ifdef _WIN32
#include "winschedtool.h"
#else
#include "crontool.h" #include "crontool.h"
#include "rtitool.h" #include "rtitool.h"
#endif
#include "snippets_w.h" #include "snippets_w.h"
#include "fragbuts.h" #include "fragbuts.h"
#include "specialindex.h" #include "specialindex.h"
#include "rclmain_w.h" #include "rclmain_w.h"
#include "webcache.h" #include "webcache.h"
#include "restable.h"
using namespace std; using namespace std;
static const QKeySequence quitKeySeq("Ctrl+q"); static const QKeySequence quitKeySeq("Ctrl+q");
static const QKeySequence closeKeySeq("Ctrl+w"); static const QKeySequence closeKeySeq("Ctrl+w");
// Open advanced search dialog. // Open advanced search dialog.
void RclMain::showAdvSearchDialog() void RclMain::showAdvSearchDialog()
{ {
if (asearchform == 0) { if (asearchform == 0) {
skipping to change at line 177 skipping to change at line 182
{ {
showIndexConfig(false); showIndexConfig(false);
} }
void RclMain::execIndexConfig() void RclMain::execIndexConfig()
{ {
showIndexConfig(true); showIndexConfig(true);
} }
void RclMain::showIndexConfig(bool modal) void RclMain::showIndexConfig(bool modal)
{ {
LOGDEB("showIndexConfig()\n" ); LOGDEB("showIndexConfig()\n" );
bool created{false};
if (indexConfig == 0) { if (indexConfig == 0) {
created = true;
indexConfig = new ConfIndexW(0, theconfig); indexConfig = new ConfIndexW(0, theconfig);
connect(new QShortcut(quitKeySeq, indexConfig), SIGNAL (activated()),
this, SLOT (fileExit()));
} else {
// Close and reopen, in hope that makes us visible...
indexConfig->close();
indexConfig->reloadPanels();
} }
if (modal) { indexConfig->showPrefs(modal);
indexConfig->exec(); if (created) {
indexConfig->setModal(false); connect(new QShortcut(quitKeySeq, indexConfig->getDialog()),
} else { SIGNAL (activated()), this, SLOT (fileExit()));
indexConfig->show();
} }
} }
void RclMain::showIndexSched() void RclMain::showIndexSched()
{ {
showIndexSched(false); showIndexSched(false);
} }
void RclMain::execIndexSched() void RclMain::execIndexSched()
{ {
showIndexSched(true); showIndexSched(true);
} }
void RclMain::showIndexSched(bool modal) void RclMain::showIndexSched(bool modal)
{ {
#ifdef _WIN32
QMessageBox::information(this, tr("Index scheduling"),
tr("Sorry, not available under Windows for now, use
the File menu entries "
"to update the index"));
return;
#endif
LOGDEB("showIndexSched()\n" ); LOGDEB("showIndexSched()\n" );
if (indexSched == 0) { if (indexSched == 0) {
indexSched = new IdxSchedW(this); indexSched = new IdxSchedW(this);
connect(new QShortcut(quitKeySeq, indexSched), SIGNAL (activated()), connect(new QShortcut(quitKeySeq, indexSched), SIGNAL (activated()),
this, SLOT (fileExit())); this, SLOT (fileExit()));
#ifdef _WIN32
indexSched->cronCLB->setText(tr("Batch scheduling"));
indexSched->cronCLB->setDescription(
tr("The tool will let you decide at what time indexing should run. "
" It uses the Windows task scheduler."));
indexSched->mainExplainLBL->hide();
indexSched->rtidxCLB->hide();
#endif
connect(indexSched->cronCLB, SIGNAL(clicked()), connect(indexSched->cronCLB, SIGNAL(clicked()),
this, SLOT(execCronTool())); this, SLOT(execCronTool()));
if (theconfig && theconfig->isDefaultConfig()) { if (theconfig && theconfig->isDefaultConfig()) {
#ifdef RCL_MONITOR #ifdef RCL_MONITOR
connect(indexSched->rtidxCLB, SIGNAL(clicked()), connect(indexSched->rtidxCLB, SIGNAL(clicked()),
this, SLOT(execRTITool())); this, SLOT(execRTITool()));
#else #else
indexSched->rtidxCLB->setEnabled(false); indexSched->rtidxCLB->setEnabled(false);
indexSched->rtidxCLB->setToolTip(tr("Disabled because the real time i ndexer was not compiled in.")); indexSched->rtidxCLB->setToolTip(tr("Disabled because the real time i ndexer was not compiled in."));
#endif #endif
skipping to change at line 249 skipping to change at line 251
} }
void RclMain::showCronTool() void RclMain::showCronTool()
{ {
showCronTool(false); showCronTool(false);
} }
void RclMain::execCronTool() void RclMain::execCronTool()
{ {
showCronTool(true); showCronTool(true);
} }
void RclMain::showCronTool(bool modal) void RclMain::showCronTool(bool modal)
{ {
LOGDEB("showCronTool()\n" ); LOGDEB("showCronTool()\n" );
if (cronTool == 0) { if (cronTool == 0) {
#ifdef _WIN32
cronTool = new WinSchedToolW(0);
#else
cronTool = new CronToolW(0); cronTool = new CronToolW(0);
#endif
connect(new QShortcut(quitKeySeq, cronTool), SIGNAL (activated()), connect(new QShortcut(quitKeySeq, cronTool), SIGNAL (activated()),
this, SLOT (fileExit())); this, SLOT (fileExit()));
} else { } else {
// Close and reopen, in hope that makes us visible... // Close and reopen, in hope that makes us visible...
cronTool->close(); cronTool->close();
} }
if (modal) { if (modal) {
cronTool->exec(); cronTool->exec();
cronTool->setModal(false); cronTool->setModal(false);
} else { } else {
skipping to change at line 278 skipping to change at line 285
void RclMain::showRTITool() void RclMain::showRTITool()
{ {
showRTITool(false); showRTITool(false);
} }
void RclMain::execRTITool() void RclMain::execRTITool()
{ {
showRTITool(true); showRTITool(true);
} }
void RclMain::showRTITool(bool modal) void RclMain::showRTITool(bool modal)
{ {
#ifndef _WIN32
LOGDEB("showRTITool()\n" ); LOGDEB("showRTITool()\n" );
if (rtiTool == 0) { if (rtiTool == 0) {
rtiTool = new RTIToolW(0); rtiTool = new RTIToolW(0);
connect(new QShortcut(quitKeySeq, rtiTool), SIGNAL (activated()), connect(new QShortcut(quitKeySeq, rtiTool), SIGNAL (activated()),
this, SLOT (fileExit())); this, SLOT (fileExit()));
} else { } else {
// Close and reopen, in hope that makes us visible... // Close and reopen, in hope that makes us visible...
rtiTool->close(); rtiTool->close();
} }
if (modal) { if (modal) {
rtiTool->exec(); rtiTool->exec();
rtiTool->setModal(false); rtiTool->setModal(false);
} else { } else {
rtiTool->show(); rtiTool->show();
} }
#endif
} }
void RclMain::showUIPrefs() void RclMain::showUIPrefs()
{ {
if (uiprefs == 0) { if (uiprefs == 0) {
uiprefs = new UIPrefsDialog(this); uiprefs = new UIPrefsDialog(this);
connect(new QShortcut(quitKeySeq, uiprefs), SIGNAL (activated()), connect(new QShortcut(quitKeySeq, uiprefs), SIGNAL (activated()),
this, SLOT (fileExit())); this, SLOT (fileExit()));
connect(uiprefs, SIGNAL(uiprefsDone()), this, SLOT(setUIPrefs())); connect(uiprefs, SIGNAL(uiprefsDone()), this, SLOT(setUIPrefs()));
connect(this, SIGNAL(stemLangChanged(const QString&)), connect(this, SIGNAL(stemLangChanged(const QString&)),
skipping to change at line 457 skipping to change at line 466
editor->append(QString::fromLocal8Bit(it->url.c_str()) + " | " + editor->append(QString::fromLocal8Bit(it->url.c_str()) + " | " +
QString::fromUtf8(it->ipath.c_str())); QString::fromUtf8(it->ipath.c_str()));
} }
editor->moveCursor(QTextCursor::Start); editor->moveCursor(QTextCursor::Start);
editor->ensureCursorVisible(); editor->ensureCursorVisible();
dialog.exec(); dialog.exec();
} }
void RclMain::showSnippets(Rcl::Doc doc) void RclMain::showSnippets(Rcl::Doc doc)
{ {
if (m_snippets) { if (!m_snippets) {
deleteZ(m_snippets); m_snippets = new SnippetsW(doc, m_source);
connect(m_snippets, SIGNAL(startNativeViewer(Rcl::Doc, int, QString)),
this, SLOT(startNativeViewer(Rcl::Doc, int, QString)));
connect(new QShortcut(quitKeySeq, m_snippets), SIGNAL (activated()),
this, SLOT (fileExit()));
connect(new QShortcut(closeKeySeq, m_snippets), SIGNAL (activated()),
m_snippets, SLOT (close()));
if (restable) {
connect(
restable,
SIGNAL(detailDocChanged(Rcl::Doc, std::shared_ptr<DocSequence>))
,
m_snippets,
SLOT(onSetDoc(Rcl::Doc, std::shared_ptr<DocSequence>)));
}
} else {
m_snippets->onSetDoc(doc, m_source);
} }
m_snippets = new SnippetsW(doc, m_source);
connect(m_snippets, SIGNAL(startNativeViewer(Rcl::Doc, int, QString)),
this, SLOT(startNativeViewer(Rcl::Doc, int, QString)));
connect(new QShortcut(quitKeySeq, m_snippets), SIGNAL (activated()),
this, SLOT (fileExit()));
connect(new QShortcut(closeKeySeq, m_snippets), SIGNAL (activated()),
m_snippets, SLOT (close()));
m_snippets->show(); m_snippets->show();
} }
 End of changes. 17 change blocks. 
28 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)