Switch to unified view

a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp
...
...
226
    connect(sc, SIGNAL (activated()), 
226
    connect(sc, SIGNAL (activated()), 
227
        this, SLOT (focusToSearch()));
227
        this, SLOT (focusToSearch()));
228
228
229
    connect(&m_watcher, SIGNAL(fileChanged(QString)), 
229
    connect(&m_watcher, SIGNAL(fileChanged(QString)), 
230
        this, SLOT(idxStatus()));
230
        this, SLOT(idxStatus()));
231
    connect(sSearch, SIGNAL(startSearch(RefCntr<Rcl::SearchData>)), 
231
    connect(sSearch, SIGNAL(startSearch(RefCntr<Rcl::SearchData>, bool)), 
232
        this, SLOT(startSearch(RefCntr<Rcl::SearchData>)));
232
        this, SLOT(startSearch(RefCntr<Rcl::SearchData>, bool)));
233
    connect(sSearch, SIGNAL(clearSearch()), 
233
    connect(sSearch, SIGNAL(clearSearch()), 
234
        this, SLOT(resetSearch()));
234
        this, SLOT(resetSearch()));
235
235
236
    connect(preferencesMenu, SIGNAL(triggered(QAction*)),
236
    connect(preferencesMenu, SIGNAL(triggered(QAction*)),
237
        this, SLOT(setStemLang(QAction*)));
237
        this, SLOT(setStemLang(QAction*)));
...
...
279
        reslist, SLOT(showQueryDetails()));
279
        reslist, SLOT(showQueryDetails()));
280
    connect(periodictimer, SIGNAL(timeout()), 
280
    connect(periodictimer, SIGNAL(timeout()), 
281
        this, SLOT(periodic100()));
281
        this, SLOT(periodic100()));
282
282
283
    restable->setRclMain(this, true);
283
    restable->setRclMain(this, true);
284
    connect(actionSaveResultsAsCSV, SIGNAL(activated()), 
285
      restable, SLOT(saveAsCSV()));
284
    connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
286
    connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
285
        restable, SLOT(setDocSource(RefCntr<DocSequence>)));
287
        restable, SLOT(setDocSource(RefCntr<DocSequence>)));
286
    connect(this, SIGNAL(searchReset()), 
288
    connect(this, SIGNAL(searchReset()), 
287
        restable, SLOT(resetSource()));
289
        restable, SLOT(resetSource()));
288
    connect(this, SIGNAL(resultsReady()), 
290
    connect(this, SIGNAL(resultsReady()), 
...
...
773
    break;
775
    break;
774
    }
776
    }
775
}
777
}
776
778
777
// Start a db query and set the reslist docsource
779
// Start a db query and set the reslist docsource
778
void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata)
780
void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple)
779
{
781
{
780
    LOGDEB(("RclMain::startSearch. Indexing %s Active %d\n", 
782
    LOGDEB(("RclMain::startSearch. Indexing %s Active %d\n", 
781
        m_idxproc?"on":"off", m_queryActive));
783
        m_idxproc?"on":"off", m_queryActive));
782
    if (m_queryActive) {
784
    if (m_queryActive) {
783
    LOGDEB(("startSearch: already active\n"));
785
    LOGDEB(("startSearch: already active\n"));
784
    return;
786
    return;
785
    }
787
    }
786
    m_queryActive = true;
788
    m_queryActive = true;
787
    m_source = RefCntr<DocSequence>();
789
    m_source = RefCntr<DocSequence>();
790
791
    m_searchIsSimple = issimple;
788
792
789
    // The db may have been closed at the end of indexing
793
    // The db may have been closed at the end of indexing
790
    string reason;
794
    string reason;
791
    // If indexing is being performed, we reopen the db at each query.
795
    // If indexing is being performed, we reopen the db at each query.
792
    if (!maybeOpenDb(reason, m_idxproc != 0)) {
796
    if (!maybeOpenDb(reason, m_idxproc != 0)) {
...
...
895
    if (asearchform == 0) {
899
    if (asearchform == 0) {
896
    asearchform = new AdvSearch(0);
900
    asearchform = new AdvSearch(0);
897
    connect(new QShortcut(quitKeySeq, asearchform), SIGNAL (activated()), 
901
    connect(new QShortcut(quitKeySeq, asearchform), SIGNAL (activated()), 
898
        this, SLOT (fileExit()));
902
        this, SLOT (fileExit()));
899
903
904
  connect(asearchform, 
900
    connect(asearchform, SIGNAL(startSearch(RefCntr<Rcl::SearchData>)), 
905
      SIGNAL(startSearch(RefCntr<Rcl::SearchData>, bool)), 
901
        this, SLOT(startSearch(RefCntr<Rcl::SearchData>)));
906
        this, SLOT(startSearch(RefCntr<Rcl::SearchData>, bool)));
902
    asearchform->show();
907
    asearchform->show();
903
    } else {
908
    } else {
904
    // Close and reopen, in hope that makes us visible...
909
    // Close and reopen, in hope that makes us visible...
905
    asearchform->close();
910
    asearchform->close();
906
    asearchform->show();
911
    asearchform->show();
...
...
1462
1467
1463
void RclMain::on_actionShowResultsAsTable_toggled(bool on)
1468
void RclMain::on_actionShowResultsAsTable_toggled(bool on)
1464
{
1469
{
1465
    LOGDEB(("RclMain::on_actionShowResultsAsTable_toggled(%d)\n", int(on)));
1470
    LOGDEB(("RclMain::on_actionShowResultsAsTable_toggled(%d)\n", int(on)));
1466
    prefs.showResultsAsTable = on;
1471
    prefs.showResultsAsTable = on;
1472
    displayingTable = on;
1467
    restable->setVisible(on);
1473
    restable->setVisible(on);
1468
    reslist->setVisible(!on);
1474
    reslist->setVisible(!on);
1475
    actionSaveResultsAsCSV->setEnabled(on);
1469
    if (!on) {
1476
    if (!on) {
1470
  displayingTable = false;
1471
    int docnum = restable->getDetailDocNumOrTopRow();
1477
    int docnum = restable->getDetailDocNumOrTopRow();
1472
    if (docnum >= 0)
1478
    if (docnum >= 0)
1473
        reslist->resultPageFor(docnum);
1479
        reslist->resultPageFor(docnum);
1474
    } else {
1480
    } else {
1475
  displayingTable = true;
1476
    int docnum = reslist->pageFirstDocNum();
1481
    int docnum = reslist->pageFirstDocNum();
1477
    if (docnum >= 0) {
1482
    if (docnum >= 0) {
1478
        restable->makeRowVisible(docnum);
1483
        restable->makeRowVisible(docnum);
1479
    }
1484
    }
1480
    nextPageAction->setEnabled(false);
1485
    nextPageAction->setEnabled(false);