-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
88 lines (66 loc) · 1.96 KB
/
mainwindow.h
File metadata and controls
88 lines (66 loc) · 1.96 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "convert.h"
#include <QMainWindow>
#include <QFileDialog>
#include <QRegularExpression>
#include <QSettings>
#include <QtConcurrent/QtConcurrentRun>
#include <QDragEnterEvent>
#include <QMimeData>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
Convert *converter;
QSettings settings;
QThread thread;
public slots:
/**
* @brief clearFileList clears selected files, and changes gui display
*/
void clearFileList();
/**
* @brief getJpegOptions Slot to open a jpegOptions Pane
* @param sizes 0-100 sizes per jpeg quality
* @param isChecked default state of keepQuality checkbox
*/
void getJpegOptions(std::vector<uint> sizes, bool isChecked);
signals:
void requestConvert(QStringList files, QString outType);
private slots:
/**
* @brief selectFiles function to handle selectFiles button
*/
void selectFiles();
/**
* @brief convertSelectedFiles function to handle convert button
*/
void convertSelectedFiles();
private:
Ui::MainWindow *ui;
QStringList selectedFiles;
/**
* @brief displayFileNames displays the filenames selected by the user
* @param files a list of filenames| D:/pth/image.png, test.png
*/
void displayFileNames(QStringList files);
/**
* @brief clearFileNames clears displayed filenames
*/
void clearFileNames();
/**
* @brief sanitizeFileName Removes the path from the filename
* @param file Path to file| D:/pth/to/file.png
* @return File name without path| file.png
*/
QString sanitizeFileName(QString file);
void dragEnterEvent(QDragEnterEvent *e);
void dropEvent(QDropEvent *e);
};
#endif // MAINWINDOW_H