-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (43 loc) · 2.6 KB
/
main.cpp
File metadata and controls
50 lines (43 loc) · 2.6 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
#include "appgui.h"
#include <QApplication>
#include "a51.h"
#include "cryptodirmanip.h"
#include "cryptodispatcher.h"
#include "cryptoqueue.h"
#include "cryptowatcher.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// CryptoDirManip dirManip;
CryptoQueue queue;
CryptoWatcher watcher;
CryptoDispatcher dispatcher(&queue);
appGui w(&queue);
QObject::connect(&w, SIGNAL(inDirLoad(QString)), &watcher, SLOT(setInputDir(QString)));
QObject::connect(&w, SIGNAL(outDirLoad(QString)), &watcher, SLOT(setOutputDir(QString)));
QObject::connect(&w, SIGNAL(watchModeChanged(bool)), &watcher, SLOT(watchModeChange(bool)));
QObject::connect(&w, SIGNAL(keyLoad(QString)), &dispatcher, SLOT(setKey(QString)));
QObject::connect(&w, SIGNAL(startAlgo(const bool)), &dispatcher, SLOT(run(const bool)));
QObject::connect(&w, SIGNAL(outDirLoad(QString)), &dispatcher, SLOT(setOutDir(QString)));
// QObject::connect(&w, SIGNAL(simulationChanged(bool)), &dirManip, SLOT(simulationMode(bool)));
// QObject::connect(&w, SIGNAL(nextStep()), &dirManip, SLOT(stepNext()));
QObject::connect(&watcher, SIGNAL(newFile(const QString&)), &queue, SLOT(insertFile(const QString&)));
QObject::connect(&watcher, SIGNAL(modifiedFile(const QString&)), &queue, SLOT(updateFile(const QString&)));
QObject::connect(&watcher, SIGNAL(removedFile(const QString&)), &queue, SLOT(removeFile(const QString&)));
watcher.start();
dispatcher.start();
// QObject::connect(&dirManip, SIGNAL(changeRegX(QString)), &w, SLOT(drawRegisterX(QString)));
// QObject::connect(&dirManip, SIGNAL(changeRegY(QString)), &w, SLOT(drawRegisterY(QString)));
// QObject::connect(&dirManip, SIGNAL(changeRegZ(QString)), &w, SLOT(drawRegisterZ(QString)));
// QObject::connect(&dirManip, SIGNAL(inDirFile(const QString &)), &w, SLOT(inDirFile(const QString &)));
// QObject::connect(&dirManip, SIGNAL(outDirFile(const QString &)), &w, SLOT(outDirFile(const QString &)));
// QObject::connect(&dirManip, SIGNAL(keyFile(const QString &)), &w, SLOT(keyFile(const QString &)));
// QObject::connect(&dirManip, SIGNAL(encryptionFile(const bool)), &w, SLOT(encryptionFile(bool)));
// QObject::connect(&dirManip, SIGNAL(runningFile(const bool)), &w, SLOT(runningFile(bool)));
// QObject::connect(&dirManip, SIGNAL(watchFile(const bool)), &w, SLOT(watchFile(bool)));
// QObject::connect(&dirManip, SIGNAL(changeDst(QString)), &w, SLOT(drawDst(QString)));
// QObject::connect(&dirManip, SIGNAL(changeSrc(QString)), &w, SLOT(drawSrc(QString)));
//dirManip.loadConfigFile();
w.show();
return a.exec();
}