-
Notifications
You must be signed in to change notification settings - Fork 1
/
wgtfilessearch.h
136 lines (113 loc) · 2.92 KB
/
wgtfilessearch.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef WGTFILESSEARCH_H
#define WGTFILESSEARCH_H
#include <QDialog>
#include <QMutex>
#include <QWaitCondition>
class QTabWidget;
class QLabel;
class QHBoxLayout;
class QLineEdit;
class QGridLayout;
class QCheckBox;
class QPushButton;
class QVBoxLayout;
class QListWidget;
class QString;
class QThread;
class filesSearchEngine;
class QCalendarWidget;
class QComboBox;
class wgtFilesSearch : public QDialog
{
Q_OBJECT
public:
explicit wgtFilesSearch(const QString &path, QWidget *parent = 0);
~wgtFilesSearch();
private slots:
void startSearchFiles();
void stopSearchFiles();
void listOfFilesClicked();
void addItemToStrList(QString);
void resultToList();
void enableBtn();
void setOptions();
bool viewFile();
void newSearch();
signals:
void foundFileClicked(QString);
private:
//GUI start
QLabel *m_pSearchFileLbl;
QLabel *m_pPathToFileLbl;
QLabel *m_pWithTextLbl;
QLabel *m_pSearchPathLbl;
QLabel *m_pOptionsDateLbl;
QLabel *m_pOptionsFromLbl;
QLabel *m_pOptionsToLbl;
QLabel *m_pOptionsSizeLbl;
QLabel *m_pOptionsNote;
//combo box
QComboBox *m_pOptionsEqual;
QComboBox *m_pOptionsParams;
QLineEdit *m_pSearchFileEdit;
QLineEdit *m_pPathToFileEdit;
QLineEdit *m_pWithTextEdit;
QLineEdit *m_pOptionsSizeLEdit;
QCheckBox *m_pWithTextOption;
QCheckBox *m_pOptionsDateCBox;
QCheckBox *m_pOptionsSizeCBox;
QTabWidget *m_pTabWgt;
QListWidget *m_pFoundFileList;
//tab pages
QWidget *m_pGeneralTab;
QWidget *m_pOptionsTab;
QWidget *m_pTopWidget;
//calendars for options tab
QCalendarWidget *m_pOptionsCalendar_1;
QCalendarWidget *m_pOptionsCalendar_2;
//layouts
QGridLayout *m_pUpGridLayout;
QHBoxLayout *m_pOptionsHLayout_1;
QHBoxLayout *m_pOptionsHLayout_2;
QVBoxLayout *m_pOptionsVBox;
QHBoxLayout *m_pUpTopLayout;
QVBoxLayout *m_pRightBtnLayout;
QVBoxLayout *m_pMainBoxLayout;
QHBoxLayout *m_pBottomBtnLayout;
//buttons
QPushButton *m_pBtnSearch;
QPushButton *m_pBtnStop;
QPushButton *m_pBtnCancel;
QPushButton *m_pBtnViewFile;
QPushButton *m_pBtnGotoFile;
QPushButton *m_pBtnNewSearch;
//GUI end
QString m_dirPath;
QThread *m_pFileSearchThread;
filesSearchEngine *m_pSearchEngine;
//options tab variables
bool m_optionsSizeBool;
bool m_optionsDateBool;
bool m_optionsWithTextBool;
};
#endif // WGTFILESSEARCH_H
class filesSearchEngine : public QObject
{
Q_OBJECT
public:
explicit filesSearchEngine(QWidget *parent = 0);
void loadSearchData(const QString&, const QString&);
bool m_threadStop;
void setStop() { m_threadStop = true; }
~filesSearchEngine();
public slots:
void process();
signals:
void currentSearchPatch(QString);
void foundFilePatch(QString);
void finished();
private:
QString m_strFileNames;
QString m_dirPath;
QStringList m_strListNames;
};