-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.hpp
More file actions
56 lines (46 loc) · 1.29 KB
/
MainWindow.hpp
File metadata and controls
56 lines (46 loc) · 1.29 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
#pragma once
#include <QMainWindow>
#include <QCryptographicHash>
#include <QStateMachine>
#include "HashCalculator.hpp"
namespace Ui
{
class MainWindow;
}
class ResultModel;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget* parent = nullptr);
~MainWindow();
private slots:
void onOpenDirectoryDialog();
void onFindDuplicates();
void onProcessing(const QString& filePath, qint64 bytesRead, qint64 bytesLeft);
void onDuplicateFound(const QString& hashString, const QString& filePath);
void onFinished();
void onFailure(const QString& filePath, HashCalculator::ErrorType error);
void onDataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>& roles);
void onRefresh();
void deleteSelected();
void onAbout();
signals:
void inputReady();
void inputIncomplete();
private:
void initMenuBar();
void initHashCalculator();
void initStateMachine();
void processCommandLine();
void populateTree(const QString& directory);
void updateSelectedLabel();
void createFileContextMenu(const QPoint& pos);
void openFileWithDefaultAssociation(const QString& filePath);
void openParentDirectory(const QString& filePath);
bool removeFile(const QString& filePath);
Ui::MainWindow* ui;
HashCalculator* _hashCalculator;
ResultModel* _model;
QStateMachine _machine;
};