forked from kambala-decapitator/QTblEditor
/
findreplacedialog.h
53 lines (40 loc) · 1.29 KB
/
findreplacedialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef FINDREPLACEDIALOG_H
#define FINDREPLACEDIALOG_H
#include "ui_findreplacedialog.h"
class QDialog;
class QTableWidgetItem;
class QCloseEvent;
class FindReplaceDialog : public QDialog
{
Q_OBJECT
public:
FindReplaceDialog(QWidget *parent = 0);
void show(bool isTwoTablesOpened);
public slots:
void getFoundStrings(const QList<QTableWidgetItem *> &foundItems);
void needsRefind() { _findConditionChanged = true; _currentStringIterator = QList<QTableWidgetItem *>::iterator(); }
private slots:
void enableButtons();
void getNextString(bool isPrevious);
void findNext();
void findPrevious();
void replaceNext();
void replaceAll();
signals:
void getStrings(const QString &query, bool isCaseSensitive, bool isExactString, bool isSearchBothTables);
void currentItemChanged(QTableWidgetItem *newItem);
protected:
void closeEvent(QCloseEvent *e);
private:
Ui::FindReplaceDialogClass ui;
QString _query;
bool _findConditionChanged, _searchFailed;
QList<QTableWidgetItem *> _foundTableItems;
QList<QTableWidgetItem *>::iterator _currentStringIterator;
void readSettings();
void writeSettings();
bool areResultsObsolete();
void replaceInCurrentString();
void changeCurrentTableCell();
};
#endif // FINDREPLACEDIALOG_H