forked from H-uru/MoulKI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFetchDialog.cpp
More file actions
39 lines (35 loc) · 799 Bytes
/
Copy pathFetchDialog.cpp
File metadata and controls
39 lines (35 loc) · 799 Bytes
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
#include "FetchDialog.h"
#include "ui_FetchDialog.h"
FetchDialog::FetchDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::FetchDialog)
{
m_ui->setupUi(this);
QIntValidator* val = new QIntValidator(this);
val->setBottom(0);
m_ui->nodeIdBox->setValidator(val);
connect(this, SIGNAL(accepted()), this, SLOT(fetchSlot()));
}
FetchDialog::~FetchDialog()
{
delete m_ui;
}
void FetchDialog::changeEvent(QEvent *e)
{
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
void FetchDialog::fetchSlot() {
bool ok;
uint32_t idx = m_ui->nodeIdBox->text().toUInt(&ok, 10);
if(!ok) {
qWarning("Invalid Node Id");
return;
}
emit fetchNode(idx);
}