-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.cpp
83 lines (68 loc) · 1.91 KB
/
mainwindow.cpp
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle("EmmcHaccGui");
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_buttonBox_rejected()
{
this->close();
}
void MainWindow::on_buttonBox_accepted()
{
std::string cmd = "..\\emmchaccgen.exe --fw " + fw + " --keys " + keys + " "
+ exfat + verbose + nca + autorcm + mariko;
system(cmd.c_str());
this->close();
}
void MainWindow::on_checkBox_stateChanged(int arg1)
{
arg1 == 2 ? exfat = " " : exfat = " --no-exfat ";
}
void MainWindow::on_checkBox_2_stateChanged(int arg1)
{
arg1 == 2 ? mariko = " --mariko " : mariko = " ";
}
void MainWindow::on_checkBox_3_stateChanged(int arg1)
{
if(mariko == " ") {
arg1 == 2 ? autorcm = " " : autorcm = " --no-autorcm ";
} else {
autorcm = " --no-autorcm ";
}
}
void MainWindow::on_checkBox_4_stateChanged(int arg1)
{
arg1 == 2 ? hashes = " --fix-hashes " : hashes = " ";
}
void MainWindow::on_checkBox_5_stateChanged(int arg1)
{
arg1 == 2 ? verbose = " --verbose " : verbose = " ";
}
void MainWindow::on_checkBox_6_stateChanged(int arg1)
{
arg1 == 2 ? nca = " --show-nca-index " : nca = " ";
}
void MainWindow::on_toolButton_clicked()
{
QFileDialog dialog;
dialog.setFileMode(QFileDialog::DirectoryOnly);
QString path = QFileDialog::getExistingDirectory(this, tr("Choose folder"), QDir::currentPath(), QFileDialog::ReadOnly);
fw = path.toStdString();
ui->plainTextEdit->setPlainText(path);
}
void MainWindow::on_toolButton_2_clicked()
{
QFileDialog dialog;
dialog.setFileMode(QFileDialog::ExistingFile);
QString path = QFileDialog::getOpenFileName(this, tr("Choose folder"), QDir::currentPath());
keys = path.toStdString();
ui->plainTextEdit_2->setPlainText(path);
}