-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.h
90 lines (78 loc) · 1.92 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QProcess>
#include <QElapsedTimer>
#include <QSet>
#include <QtGlobal> // for QT_VERSION
namespace Ui {
class MainWindow;
}
struct Settings {
QString path2Bin;
};
struct Options {
int dpi;
int threads;
int pagesPerDict;
int agression;
QString ext;
bool lossy;
bool clean;
bool match;
bool smooth;
bool protos;
bool averaging;
bool erosion;
bool report;
bool warnings;
bool verbose;
bool indirect;
bool unbuffered;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private Q_SLOTS:
void process_error(QProcess::ProcessError error);
void process_started();
void process_ready_read();
void process_finished(int exitCode);
private Q_SLOTS:
void on_btnOpenFolder_clicked();
void on_btnClearFiles_clicked();
void on_btnRemove_clicked();
void on_btnOpenFiles_clicked();
void on_btnSaveFile_clicked();
void on_cbLossy_stateChanged(int arg1);
void on_label_7_linkActivated(const QString &link);
void on_btnClearLog_clicked();
void on_tabWidget_currentChanged(int index);
void on_btnOptReset_clicked();
void on_cbProtos_stateChanged(int arg1);
void on_cbMatch_stateChanged(int arg1);
void on_edPath2Bin_textChanged(const QString &arg1);
void on_btnConvert_clicked();
private:
void addToLog(const QString &txt);
void filterSupportedOpts();
void displayOpts();
void displaySettings();
void updateOpts();
void updateSettings();
void displayStartProcessMode();
void getEncoderDetails();
private:
Ui::MainWindow *ui;
Settings m_set;
Options m_opt;
QProcess m_proc;
QElapsedTimer m_timer;
QSet<QChar> m_supportedOpts;
QWidget* m_ptrPreviousTab;
bool m_conversion_in_progress;
};
#endif // MAINWINDOW_H