-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
68 lines (62 loc) · 1.74 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifndef WINVER
#define WINVER 0x0601
#endif
#include <QtWidgets>
#include <windows.h>
//#include <memory>
#include "ui_mainwindow.h"
class QClipboard;
class ElapsedTimer;
class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT
public:
static MainWindow* getInstance() {
// !NOT thread safe - first call from main only
if (!instance)
instance = new MainWindow();
return instance;
}
~MainWindow();
void closeEvent(QCloseEvent *event);
enum Status {STATUS_IDLE=0, STATUS_READING, STATUS_WRITING, STATUS_VERIFYING, STATUS_EXIT, STATUS_CANCELED};
bool nativeEvent(const QByteArray &type, void *vMsg, long *result);
protected:
MainWindow(QWidget* = NULL);
private:
static MainWindow* instance;
void getLogicalDrives();
void setReadWriteButtonState();
void saveSettings();
void loadSettings();
void initializeHomeDir();
HANDLE hVolume;
HANDLE hFile;
HANDLE hRawDisk;
static const unsigned short ONE_SEC_IN_MS = 1000;
unsigned long long sectorsize;
int status;
char *sectorData;
char *sectorData2; //for verify
QTime update_timer;
ElapsedTimer *elapsed_timer = NULL;
QClipboard *clipboard;
void generateHash(char *filename, int hashish);
QString myHomeDir;
protected slots:
void on_tbBrowse_clicked();
void on_bCancel_clicked();
void on_bWrite_clicked();
void on_bRead_clicked();
void on_bVerify_clicked();
void on_leFile_editingFinished();
void on_bHashCopy_clicked();
private slots:
void on_bHashGen_clicked();
void on_cboxHashType_currentIndexChanged(int);
void updateHashControls();
void on_bExit_clicked();
};
#endif // MAINWINDOW_H