-
Notifications
You must be signed in to change notification settings - Fork 12
/
CreateNodeDialog.cpp
49 lines (42 loc) · 1.07 KB
/
CreateNodeDialog.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
#include "CreateNodeDialog.h"
#include "ui_CreateNodeDialog.h"
#include <QPushButton>
CreateNodeDialog::CreateNodeDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CreateNodeDialog)
{
ui->setupUi(this);
ui->nodeEditor->setNode(&node);
connect(this, SIGNAL(accepted()), this, SLOT(sendCreate()));
connect(ui->nodeEditor, SIGNAL(isDirty(bool)), ui->buttonBox->button(QDialogButtonBox::Ok), SLOT(setEnabled(bool)));
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
}
CreateNodeDialog::~CreateNodeDialog()
{
delete ui;
}
void CreateNodeDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void CreateNodeDialog::setActFind() {
setWindowTitle("Find Node");
act = 1;
}
void CreateNodeDialog::setParent(uint32_t idx) {
parentIdx = idx;
act = 0;
}
void CreateNodeDialog::sendCreate() {
if(act)
emit findSig(node);
else
emit createSig(node, parentIdx);
}