Switch to unified view

a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.30 2007-06-19 16:19:24 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.31 2007-06-20 13:15:58 dockes Exp $ (C) 2005 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
137
        this, SLOT(startPreview(Rcl::Doc)));
137
        this, SLOT(startPreview(Rcl::Doc)));
138
138
139
    connect(fileExitAction, SIGNAL(activated() ), this, SLOT(fileExit() ) );
139
    connect(fileExitAction, SIGNAL(activated() ), this, SLOT(fileExit() ) );
140
    connect(fileStart_IndexingAction, SIGNAL(activated()), 
140
    connect(fileStart_IndexingAction, SIGNAL(activated()), 
141
        this, SLOT(startIndexing()));
141
        this, SLOT(startIndexing()));
142
    connect(fileEraseDocHistoryAction, SIGNAL(activated()), 
143
      this, SLOT(eraseDocHistory()));
142
    connect(helpAbout_RecollAction, SIGNAL(activated()), 
144
    connect(helpAbout_RecollAction, SIGNAL(activated()), 
143
        this, SLOT(showAboutDialog()));
145
        this, SLOT(showAboutDialog()));
144
    connect(userManualAction, SIGNAL(activated()), this, SLOT(startManual()));
146
    connect(userManualAction, SIGNAL(activated()), this, SLOT(startManual()));
145
    connect(toolsDoc_HistoryAction, SIGNAL(activated()), 
147
    connect(toolsDoc_HistoryAction, SIGNAL(activated()), 
146
        this, SLOT(showDocHistory()));
148
        this, SLOT(showDocHistory()));
...
...
483
        // Already there
485
        // Already there
484
        return;
486
        return;
485
    }
487
    }
486
    (void)curPreview->addEditorTab();
488
    (void)curPreview->addEditorTab();
487
    }
489
    }
488
    // Enter document in document history
489
    g_dynconf->enterDoc(fn, doc.ipath);
490
    if (!curPreview->loadFileInCurrentTab(fn, st.st_size, doc, docnum))
490
    if (!curPreview->loadFileInCurrentTab(fn, st.st_size, doc, docnum))
491
    curPreview->closeCurrentTab();
491
    curPreview->closeCurrentTab();
492
}
492
}
493
493
494
/** 
494
/** 
...
...
517
    return;
517
    return;
518
    }
518
    }
519
    preview->setSId(0, HiliteData());
519
    preview->setSId(0, HiliteData());
520
    connect(preview, SIGNAL(wordSelect(QString)),
520
    connect(preview, SIGNAL(wordSelect(QString)),
521
        this, SLOT(ssearchAddTerm(QString)));
521
        this, SLOT(ssearchAddTerm(QString)));
522
    g_dynconf->enterDoc(fn, doc.ipath);
523
    preview->show();
522
    preview->show();
524
    if (!preview->loadFileInCurrentTab(fn, st.st_size, doc, 0))
523
    if (!preview->loadFileInCurrentTab(fn, st.st_size, doc, 0))
525
    preview->closeCurrentTab();
524
    preview->closeCurrentTab();
526
}
525
}
527
526
...
...
819
    RefCntr<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND));
818
    RefCntr<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND));
820
    m_searchData->setDescription((const char *)tr("History data").utf8());
819
    m_searchData->setDescription((const char *)tr("History data").utf8());
821
820
822
    m_searchId++;
821
    m_searchId++;
823
822
823
    // If you change the title, also change it in eraseDocHistory()
824
    DocSequenceHistory *src = 
824
    DocSequenceHistory *src = 
825
    new DocSequenceHistory(rcldb, g_dynconf, 
825
    new DocSequenceHistory(rcldb, g_dynconf, 
826
                   string(tr("Document history").utf8()));
826
                   string(tr("Document history").utf8()));
827
    src->setDescription((const char *)tr("History data").utf8());
827
    src->setDescription((const char *)tr("History data").utf8());
828
    m_docSource = RefCntr<DocSequence>(src);
828
    m_docSource = RefCntr<DocSequence>(src);
829
    setDocSequence();
829
    setDocSequence();
830
}
830
}
831
831
832
void RclMain::eraseDocHistory()
833
{
834
    g_dynconf->eraseAll(RclHistory::docSubkey);
835
    // We want to reset the displayed history if it is currently shown. Using
836
    // the title value is an ugly hack
837
    if (m_docSource->title() == 
838
  string((const char *)tr("Document history").utf8())) {
839
  showDocHistory();
840
    }
841
}
832
842
833
void RclMain::sortDataChanged(DocSeqSortSpec spec)
843
void RclMain::sortDataChanged(DocSeqSortSpec spec)
834
{
844
{
835
    LOGDEB(("RclMain::sortDataChanged\n"));
845
    LOGDEB(("RclMain::sortDataChanged\n"));
836
    m_sortspecs = spec;
846
    m_sortspecs = spec;