forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplace_page_dialog_common.cpp
56 lines (49 loc) · 1.77 KB
/
place_page_dialog_common.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
50
51
52
53
54
55
56
#include "qt/place_page_dialog_common.hpp"
#include <QtWidgets/QPushButton>
namespace place_page_dialog
{
void addCommonButtons(QDialog * this_, QDialogButtonBox * dbb, bool shouldShowEditPlace)
{
dbb->setCenterButtons(true);
QPushButton * fromButton = new QPushButton("Route From");
fromButton->setIcon(QIcon(":/navig64/point-start.png"));
fromButton->setAutoDefault(false);
this_->connect(fromButton, &QAbstractButton::clicked, this_, [this_]
{
this_->done(RouteFrom);
});
dbb->addButton(fromButton, QDialogButtonBox::ActionRole);
QPushButton * addStopButton = new QPushButton("Add Stop");
addStopButton->setIcon(QIcon(":/navig64/point-intermediate.png"));
addStopButton->setAutoDefault(false);
this_->connect(addStopButton, &QAbstractButton::clicked, this_, [this_]
{
this_->done(AddStop);
});
dbb->addButton(addStopButton, QDialogButtonBox::ActionRole);
QPushButton * routeToButton = new QPushButton("Route To");
routeToButton->setIcon(QIcon(":/navig64/point-finish.png"));
routeToButton->setAutoDefault(false);
this_->connect(routeToButton, &QAbstractButton::clicked, this_, [this_]
{
this_->done(RouteTo);
});
dbb->addButton(routeToButton, QDialogButtonBox::ActionRole);
QPushButton * closeButton = new QPushButton("Close");
closeButton->setDefault(true);
this_->connect(closeButton, &QAbstractButton::clicked, this_, [this_]
{
this_->done(place_page_dialog::Close);
});
dbb->addButton(closeButton, QDialogButtonBox::RejectRole);
if (shouldShowEditPlace)
{
QPushButton * editButton = new QPushButton("Edit Place");
this_->connect(editButton, &QAbstractButton::clicked, this_, [this_]
{
this_->done(place_page_dialog::EditPlace);
});
dbb->addButton(editButton, QDialogButtonBox::AcceptRole);
}
}
}