-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauwidgetmenu.cpp
More file actions
81 lines (72 loc) · 2.72 KB
/
lauwidgetmenu.cpp
File metadata and controls
81 lines (72 loc) · 2.72 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
#include "lauwidgetmenu.h"
#include "laucombineimagestopdfwidget.h"
#include "lausplitimagestotiffwidget.h"
#include "laufindgridbatchwidget.h"
#include "lauimagematchingwidget.h"
#include "lauapplydnnwidget.h"
LAUWidgetMenu::LAUWidgetMenu(QWidget *parent) : QWidget(parent)
{
this->setLayout(new QVBoxLayout());
this->layout()->setContentsMargins(6, 6, 6, 6);
this->layout()->setSpacing(6);
QPushButton *button = new QPushButton(QString("Set Directories"));
connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
this->layout()->addWidget(button);
buttons << button;
bool flag = LAUDefaultDirectoriesDialog::isValid();
button = new QPushButton(QString("Create Targets"));
button->setEnabled(flag);
connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
this->layout()->addWidget(button);
buttons << button;
button = new QPushButton(QString("Parse Scans"));
button->setEnabled(flag);
connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
this->layout()->addWidget(button);
buttons << button;
button = new QPushButton(QString("Match Images"));
button->setEnabled(flag);
connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
this->layout()->addWidget(button);
buttons << button;
button = new QPushButton(QString("Score Image"));
connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
this->layout()->addWidget(button);
buttons << button;
}
void LAUWidgetMenu::onButtonClicked()
{
QPushButton *button = qobject_cast<QPushButton *>(sender());
if (button != nullptr) {
QString string = button->text();
if (string == QString("Set Directories")) {
LAUDefaultDirectoriesDialog dialog;
if (dialog.exec()) {
bool flag = LAUDefaultDirectoriesDialog::isValid();
for (int n = 1; n < buttons.count() - 1; n++) {
buttons.at(n)->setEnabled(flag);
}
}
} else if (string == QString("Create Targets")) {
LAUCombineImagesToPDFDialog dialog;
if (dialog.isValid()) {
dialog.exec();
}
} else if (string == QString("Parse Scans")) {
LAUSplitImagesToTiffDialog dialog;
if (dialog.isValid()) {
dialog.exec();
}
} else if (string == QString("Match Images")) {
LAUImageMatchDialog dialog;
if (dialog.isValid()) {
dialog.exec();
}
} else if (string == QString("Score Image")) {
LAUApplyDNNDialog dialog;
if (dialog.isValid()) {
dialog.exec();
}
}
}
}