Switch to unified view

a/src/qtgui/rclmain_w.h b/src/qtgui/rclmain_w.h
...
...
45
class WebcacheEdit;
45
class WebcacheEdit;
46
46
47
#include "ui_rclmain.h"
47
#include "ui_rclmain.h"
48
48
49
namespace confgui {
49
namespace confgui {
50
    class ConfIndexW;
50
class ConfIndexW;
51
}
51
}
52
52
53
using confgui::ConfIndexW;
53
using confgui::ConfIndexW;
54
54
55
class RclTrayIcon;
55
class RclTrayIcon;
56
56
57
class RclMain : public QMainWindow, public Ui::RclMainBase
57
class RclMain : public QMainWindow, public Ui::RclMainBase {
58
{
59
    Q_OBJECT
58
    Q_OBJECT;
60
59
61
public:
60
public:
62
    enum  IndexerState {IXST_UNKNOWN, IXST_NOTRUNNING, 
63
                        IXST_RUNNINGMINE, IXST_RUNNINGNOTMINE};
64
    RclMain(QWidget * parent = 0) 
61
    RclMain(QWidget * parent = 0)
65
  : QMainWindow(parent),
62
        : QMainWindow(parent),
66
    curPreview(0),
63
          curPreview(0),
67
    asearchform(0),
64
          asearchform(0),
68
    uiprefs(0),
65
          uiprefs(0),
69
    indexConfig(0),
66
          indexConfig(0),
70
    indexSched(0),
67
          indexSched(0),
71
    cronTool(0),
68
          cronTool(0),
72
    rtiTool(0),
69
          rtiTool(0),
73
    spellform(0),
70
          spellform(0),
74
          fragbuts(0),
71
          fragbuts(0),
75
          specidx(0),
72
          specidx(0),
76
    periodictimer(0),
73
          periodictimer(0),
77
          webcache(0),
74
          webcache(0),
78
    restable(0),
75
          restable(0),
79
    displayingTable(0),
76
          displayingTable(0),
80
          m_idNoStem(0),
77
          m_idNoStem(0),
81
          m_idAllStem(0),
78
          m_idAllStem(0),
82
          m_toolsTB(0), m_resTB(0), 
79
          m_toolsTB(0), m_resTB(0),
83
          m_filtFRM(0), m_filtCMB(0), m_filtBGRP(0), m_filtMN(0),
80
          m_filtFRM(0), m_filtCMB(0), m_filtBGRP(0), m_filtMN(0),
84
    m_idxproc(0),
81
          m_idxproc(0),
85
          m_idxkilled(false),
82
          m_idxkilled(false),
86
          m_catgbutvecidx(0),
83
          m_catgbutvecidx(0),
87
    m_sortspecnochange(false),
84
          m_sortspecnochange(false),
88
    m_indexerState(IXST_UNKNOWN),
85
          m_indexerState(IXST_UNKNOWN),
89
    m_queryActive(false),
86
          m_queryActive(false),
90
    m_firstIndexing(false),
87
          m_firstIndexing(false),
91
    m_searchIsSimple(false)
88
          m_searchIsSimple(false),
92
    {
89
          m_pidfile(0) {
93
  setupUi(this);
90
        setupUi(this);
94
  init();
91
        init();
95
    }
92
    }
96
    ~RclMain() {}
93
    ~RclMain() {}
94
97
    QString getQueryDescription();
95
    QString getQueryDescription();
98
96
99
    /** This is only called from main() to set an URL to be displayed (using
97
    /** This is only called from main() to set an URL to be displayed (using
100
  recoll as a doc extracter for embedded docs */
98
    recoll as a doc extracter for embedded docs */
101
    virtual void setUrlToView(const QString& u) {m_urltoview = u;}
99
    virtual void setUrlToView(const QString& u) {
100
        m_urltoview = u;
101
    }
102
    /** Same usage: actually display the current urltoview */
102
    /** Same usage: actually display the current urltoview */
103
    virtual void viewUrl();
103
    virtual void viewUrl();
104
104
105
    bool lastSearchSimple() 
105
    bool lastSearchSimple() {
106
    {
107
  return m_searchIsSimple;
106
        return m_searchIsSimple;
108
    }
107
    }
109
108
110
    // Takes copies of the args instead of refs. Lazy and safe.
109
    // Takes copies of the args instead of refs. Lazy and safe.
111
    void newDupsW(const Rcl::Doc doc, const std::vector<Rcl::Doc> dups);
110
    void newDupsW(const Rcl::Doc doc, const std::vector<Rcl::Doc> dups);
112
111
113
protected:
112
    enum  IndexerState {IXST_UNKNOWN, IXST_NOTRUNNING,
114
    virtual void showEvent(QShowEvent *);
113
                        IXST_RUNNINGMINE, IXST_RUNNINGNOTMINE};
115
114
115
    IndexerState indexerState() const {
116
        return m_indexerState;
117
    }
118
119
                            
116
public slots:
120
public slots:
117
    virtual void fileExit();
121
    virtual void fileExit();
118
    virtual void idxStatus();
119
    virtual void periodic100();
122
    virtual void periodic100();
120
    virtual void toggleIndexing();
123
    virtual void toggleIndexing();
121
    virtual void rebuildIndex();
124
    virtual void rebuildIndex();
122
    virtual void specialIndex();
125
    virtual void specialIndex();
123
    virtual void startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple);
126
    virtual void startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata,
127
                             bool issimple);
124
    virtual void previewClosed(Preview *w);
128
    virtual void previewClosed(Preview *w);
125
    virtual void showAdvSearchDialog();
129
    virtual void showAdvSearchDialog();
126
    virtual void showSpellDialog();
130
    virtual void showSpellDialog();
127
    virtual void showWebcacheDialog();
131
    virtual void showWebcacheDialog();
128
    virtual void showIndexStatistics();
132
    virtual void showIndexStatistics();
...
...
151
    virtual void docExpand(Rcl::Doc);
155
    virtual void docExpand(Rcl::Doc);
152
    virtual void showSubDocs(Rcl::Doc);
156
    virtual void showSubDocs(Rcl::Doc);
153
    virtual void showSnippets(Rcl::Doc);
157
    virtual void showSnippets(Rcl::Doc);
154
    virtual void startPreview(int docnum, Rcl::Doc doc, int keymods);
158
    virtual void startPreview(int docnum, Rcl::Doc doc, int keymods);
155
    virtual void startPreview(Rcl::Doc);
159
    virtual void startPreview(Rcl::Doc);
156
    virtual void startNativeViewer(Rcl::Doc, int pagenum = -1, 
160
    virtual void startNativeViewer(Rcl::Doc, int pagenum = -1,
157
                 QString term=QString());
161
                                   QString term = QString());
158
    virtual void openWith(Rcl::Doc, string);
162
    virtual void openWith(Rcl::Doc, string);
159
    virtual void saveDocToFile(Rcl::Doc);
163
    virtual void saveDocToFile(Rcl::Doc);
160
    virtual void previewNextInTab(Preview *, int sid, int docnum);
164
    virtual void previewNextInTab(Preview *, int sid, int docnum);
161
    virtual void previewPrevInTab(Preview *, int sid, int docnum);
165
    virtual void previewPrevInTab(Preview *, int sid, int docnum);
162
    virtual void previewExposed(Preview *, int sid, int docnum);
166
    virtual void previewExposed(Preview *, int sid, int docnum);
...
...
179
    virtual void resultCount(int);
183
    virtual void resultCount(int);
180
    virtual void applyStyleSheet();
184
    virtual void applyStyleSheet();
181
    virtual void setFilterCtlStyle(int stl);
185
    virtual void setFilterCtlStyle(int stl);
182
    virtual void showTrayMessage(const QString& text);
186
    virtual void showTrayMessage(const QString& text);
183
187
188
private slots:
189
    virtual void updateIdxStatus();
190
    virtual void onWebcacheDestroyed(QObject *);
184
signals:
191
signals:
185
    void docSourceChanged(STD_SHARED_PTR<DocSequence>);
192
    void docSourceChanged(STD_SHARED_PTR<DocSequence>);
186
    void stemLangChanged(const QString& lang);
193
    void stemLangChanged(const QString& lang);
187
    void sortDataChanged(DocSeqSortSpec);
194
    void sortDataChanged(DocSeqSortSpec);
188
    void resultsReady();
195
    void resultsReady();
189
    void searchReset();
196
    void searchReset();
190
197
191
protected:
198
protected:
192
    virtual void closeEvent( QCloseEvent * );
199
    virtual void closeEvent(QCloseEvent *);
200
    virtual void showEvent(QShowEvent *);
201
193
202
194
private:
203
private:
195
    Preview        *curPreview;
204
    Preview        *curPreview;
196
    AdvSearch      *asearchform;
205
    AdvSearch      *asearchform;
197
    UIPrefsDialog  *uiprefs;
206
    UIPrefsDialog  *uiprefs;
...
...
234
    // preview (if no ext app set)
243
    // preview (if no ext app set)
235
    QString          m_urltoview;
244
    QString          m_urltoview;
236
245
237
    RclTrayIcon     *m_trayicon;
246
    RclTrayIcon     *m_trayicon;
238
247
248
    // We sometimes take the indexer lock (e.g.: when editing the webcache)
249
    Pidfile         *m_pidfile;
250
    
239
    virtual void init();
251
    virtual void init();
240
    virtual void setupResTB(bool combo);
252
    virtual void setupResTB(bool combo);
241
    virtual void previewPrevOrNextInTab(Preview *, int sid, int docnum, 
253
    virtual void previewPrevOrNextInTab(Preview *, int sid, int docnum,
242
                  bool next);
254
                                        bool next);
243
    virtual void execViewer(const map<string, string>& subs, bool enterHistory,
255
    virtual void execViewer(const map<string, string>& subs, bool enterHistory,
244
                            const string& execpath, const vector<string>& lcmd,
256
                            const string& execpath, const vector<string>& lcmd,
245
                            const string& cmd, Rcl::Doc doc);
257
                            const string& cmd, Rcl::Doc doc);
246
    virtual void setStemLang(const QString& lang);
258
    virtual void setStemLang(const QString& lang);
247
    virtual void onSortCtlChanged();
259
    virtual void onSortCtlChanged();