forked from AdrianTM/mx-boot-options
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdialog.cpp
37 lines (28 loc) · 1.03 KB
/
dialog.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
#include "dialog.h"
#include <QLabel>
#include <QLayout>
#include <QPushButton>
CustomDialog::CustomDialog(const QStringList &items, QDialog *parent)
: QDialog(parent)
{
auto *layout = new QGridLayout();
setLayout(layout);
box = new QComboBox;
box->addItems(items);
auto *label = new QLabel(tr("Live environment detected. Please select the root partition of the\n"
" system you want to modify (only Linux partitions are displayed)"));
layout->addWidget(label, 0, 0, 1, 3);
layout->addWidget(box, 1, 0, 1, 3);
auto *ok = new QPushButton(tr("OK"));
auto *cancel = new QPushButton(tr("Cancel"));
ok->setIcon(QIcon::fromTheme("dialog-ok"));
cancel->setIcon(QIcon::fromTheme("window-close"));
layout->addWidget(ok, 2, 1, 1, 1);
layout->addWidget(cancel, 2, 2, 1, 1);
connect(ok, &QPushButton::clicked, this, &CustomDialog::accept);
connect(cancel, &QPushButton::clicked, this, &CustomDialog::reject);
}
QComboBox *CustomDialog::comboBox()
{
return box;
}