Switch to unified view

a/src/qtgui/preview_w.h b/src/qtgui/preview_w.h
...
...
49
class QLabel;
49
class QLabel;
50
class QPushButton;
50
class QPushButton;
51
class QCheckBox;
51
class QCheckBox;
52
class Preview;
52
class Preview;
53
class PlainToRichQtPreview;
53
class PlainToRichQtPreview;
54
class QUrl;
55
class RclMain;
54
56
55
class PreviewTextEdit : public PREVIEW_PARENTCLASS {
57
class PreviewTextEdit : public PREVIEW_PARENTCLASS {
56
    Q_OBJECT;
58
    Q_OBJECT;
57
public:
59
public:
58
    PreviewTextEdit(QWidget* parent, const char* name, Preview *pv);
60
    PreviewTextEdit(QWidget* parent, const char* name, Preview *pv);
...
...
63
    virtual void displayFields();
65
    virtual void displayFields();
64
    virtual void displayText();
66
    virtual void displayText();
65
    virtual void displayImage();
67
    virtual void displayImage();
66
    virtual void print();
68
    virtual void print();
67
    virtual void createPopupMenu(const QPoint& pos);
69
    virtual void createPopupMenu(const QPoint& pos);
70
    void onAnchorClicked(const QUrl& url);
68
71
69
    friend class Preview;
72
    friend class Preview;
70
73
71
protected:
74
protected:
72
    void mouseDoubleClickEvent(QMouseEvent *);
75
    void mouseDoubleClickEvent(QMouseEvent *);
...
...
102
    DspType m_curdsp;
105
    DspType m_curdsp;
103
};
106
};
104
107
105
108
106
class Preview : public QWidget {
109
class Preview : public QWidget {
110
    Q_OBJECT;
111
public:
107
112
108
    Q_OBJECT
109
110
    public:
111
112
    Preview(int sid, // Search Id
113
    Preview(RclMain *m, int sid, // Search Id
113
        const HighlightData& hdata) // Search terms etc. for highlighting
114
        const HighlightData& hdata) // Search terms etc. for highlighting
114
  : QWidget(0), m_searchId(sid), m_searchTextFromIndex(-1), m_hData(hdata)
115
  : QWidget(0), m_rclmain(m), m_searchId(sid), m_hData(hdata) {
115
    {
116
    init();
116
    init();
117
    }
117
    }
118
118
119
    virtual void closeEvent(QCloseEvent *e );
119
    virtual void closeEvent(QCloseEvent *e);
120
    virtual bool eventFilter(QObject *target, QEvent *event );
120
    virtual bool eventFilter(QObject *target, QEvent *event);
121
121
122
    /** 
122
    /** 
123
     * Arrange for the document to be displayed either by exposing the tab 
123
     * Arrange for the document to be displayed either by exposing the tab 
124
     * if already loaded, or by creating a new tab and loading it.
124
     * if already loaded, or by creating a new tab and loading it.
125
     * @para docnum is used to link back to the result list (to highlight 
125
     * @para docnum is used to link back to the result list (to highlight 
...
...
156
    void previewExposed(Preview *w, int sid, int docnum);
156
    void previewExposed(Preview *w, int sid, int docnum);
157
    void printCurrentPreviewRequest();
157
    void printCurrentPreviewRequest();
158
    void saveDocToFile(Rcl::Doc);
158
    void saveDocToFile(Rcl::Doc);
159
159
160
private:
160
private:
161
    RclMain *m_rclmain{0};
161
    // Identifier of search in main window. This is used to check that
162
    // Identifier of search in main window. This is used to check that
162
    // we make sense when requesting the next document when browsing
163
    // we make sense when requesting the next document when browsing
163
    // successive search results in a tab.
164
    // successive search results in a tab.
164
    int           m_searchId; 
165
    int           m_searchId; 
165
166
166
    bool          m_dynSearchActive;
167
    bool          m_dynSearchActive{false};
167
    // Index value the search text comes from. -1 if text was edited
168
    // Index value the search text comes from. -1 if text was edited
168
    int           m_searchTextFromIndex;
169
    int           m_searchTextFromIndex{-1};
169
170
170
    bool          m_canBeep;
171
    bool          m_canBeep{true};
171
    bool          m_loading;
172
    bool          m_loading{false};
172
    HighlightData m_hData;
173
    HighlightData m_hData;
173
    bool          m_justCreated; // First tab create is different
174
    bool          m_justCreated{true}; // First tab create is different
174
175
175
    QTabWidget* pvTab;
176
    QTabWidget* pvTab{0};
176
    QLabel* searchLabel;
177
    QLabel* searchLabel{0};
177
    QComboBox *searchTextCMB;
178
    QComboBox *searchTextCMB{0};
178
    QPushButton* nextButton;
179
    QPushButton* nextButton{0};
179
    QPushButton* prevButton;
180
    QPushButton* prevButton{0};
180
    QPushButton* clearPB;
181
    QPushButton* clearPB{0};
181
    QCheckBox* matchCheck;
182
    QCheckBox* matchCheck{0};
182
183
183
    void init();
184
    void init();
184
    virtual void setCurTabProps(const Rcl::Doc& doc, int docnum);
185
    virtual void setCurTabProps(const Rcl::Doc& doc, int docnum);
185
    virtual PreviewTextEdit *currentEditor();
186
    virtual PreviewTextEdit *currentEditor();
186
    virtual PreviewTextEdit *addEditorTab();
187
    virtual PreviewTextEdit *addEditorTab();