17 */ |
17 */ |
18 |
18 |
19 #include <QGridLayout> |
19 #include <QGridLayout> |
20 #include <QPushButton> |
20 #include <QPushButton> |
21 #include <QFileDialog> |
21 #include <QFileDialog> |
|
22 #include <QCheckBox> |
22 |
23 |
23 #include "pagedrawmap.h" |
24 #include "pagedrawmap.h" |
24 #include "drawmapwidget.h" |
25 #include "drawmapwidget.h" |
25 |
26 |
26 |
27 |
27 QLayout * PageDrawMap::bodyLayoutDefinition() |
28 QLayout * PageDrawMap::bodyLayoutDefinition() |
28 { |
29 { |
29 QGridLayout * pageLayout = new QGridLayout(); |
30 QGridLayout * pageLayout = new QGridLayout(); |
30 |
31 |
31 pbUndo = addButton(tr("Undo"), pageLayout, 0, 0); |
32 cbEraser = new QCheckBox(tr("Eraser"), this); |
32 pbClear = addButton(tr("Clear"), pageLayout, 1, 0); |
33 pageLayout->addWidget(cbEraser, 0, 0); |
33 pbLoad = addButton(tr("Load"), pageLayout, 2, 0); |
34 pbUndo = addButton(tr("Undo"), pageLayout, 1, 0); |
34 pbSave = addButton(tr("Save"), pageLayout, 3, 0); |
35 pbClear = addButton(tr("Clear"), pageLayout, 2, 0); |
|
36 pbLoad = addButton(tr("Load"), pageLayout, 3, 0); |
|
37 pbSave = addButton(tr("Save"), pageLayout, 4, 0); |
35 |
38 |
36 drawMapWidget = new DrawMapWidget(this); |
39 drawMapWidget = new DrawMapWidget(this); |
37 pageLayout->addWidget(drawMapWidget, 0, 1, 5, 1); |
40 pageLayout->addWidget(drawMapWidget, 0, 1, 6, 1); |
38 |
41 |
39 return pageLayout; |
42 return pageLayout; |
40 } |
43 } |
41 |
44 |
42 void PageDrawMap::connectSignals() |
45 void PageDrawMap::connectSignals() |
43 { |
46 { |
|
47 connect(cbEraser, SIGNAL(toggled(bool)), drawMapWidget, SLOT(setErasing(bool))); |
44 connect(pbUndo, SIGNAL(clicked()), drawMapWidget, SLOT(undo())); |
48 connect(pbUndo, SIGNAL(clicked()), drawMapWidget, SLOT(undo())); |
45 connect(pbClear, SIGNAL(clicked()), drawMapWidget, SLOT(clear())); |
49 connect(pbClear, SIGNAL(clicked()), drawMapWidget, SLOT(clear())); |
46 connect(pbLoad, SIGNAL(clicked()), this, SLOT(load())); |
50 connect(pbLoad, SIGNAL(clicked()), this, SLOT(load())); |
47 connect(pbSave, SIGNAL(clicked()), this, SLOT(save())); |
51 connect(pbSave, SIGNAL(clicked()), this, SLOT(save())); |
48 } |
52 } |