forked from GokuMK/TSRE5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditFileNameDialog.cpp
45 lines (38 loc) · 1.22 KB
/
EditFileNameDialog.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
/* This file is part of TSRE5.
*
* TSRE5 - train sim game engine and MSTS/OR Editors.
* Copyright (C) 2016 Piotr Gadecki <[email protected]>
*
* Licensed under GNU General Public License 3.0 or later.
*
* See LICENSE.md or https://www.gnu.org/licenses/gpl.html
*/
#include "EditFileNameDialog.h"
EditFileNameDialog::EditFileNameDialog() : QDialog(){
//this->setFixedSize(200, 100);
this->setWindowTitle("Edit FileName");
this->setFixedWidth(350);
QPushButton* ok = new QPushButton("OK");
QPushButton* cancel = new QPushButton("Cancel");
connect(ok, SIGNAL (released()), this, SLOT (ok()));
connect(cancel, SIGNAL (released()), this, SLOT (cancel()));
QGridLayout *vlist = new QGridLayout;
vlist->setSpacing(2);
vlist->setContentsMargins(3,0,3,0);
int row = 0;
vlist->addWidget(&name,row++,0,1,2);
vlist->addWidget(ok,row, 0);
vlist->addWidget(cancel,row++, 1);
vlist->setContentsMargins(1,1,1,1);
this->setLayout(vlist);
}
EditFileNameDialog::~EditFileNameDialog() {
}
void EditFileNameDialog::cancel(){
this->isOk = false;
this->close();
}
void EditFileNameDialog::ok(){
this->isOk = true;
this->close();
}