16 #include <QDialogButtonBox>
19 #include <QSizePolicy>
20 #include <QSpacerItem>
21 #include <QTextBrowser>
22 #include <QVBoxLayout>
23 #include "../util/btconnect.h"
24 #include "../util/cresmgr.h"
29 QString
const & inputLabel,
31 QString
const & inputText,
32 QString
const & infoMessage,
38 setWindowTitle(title);
39 QVBoxLayout * verticalLayout =
new QVBoxLayout(
this);
41 if (!infoMessage.isEmpty()) {
43 infoTextView->setPlainText(infoMessage);
44 infoTextView->setReadOnly(
true);
45 infoTextView->setOpenLinks(
false);
46 verticalLayout->addWidget(infoTextView);
50 QSpacerItem * verticalSpacer =
new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
51 verticalLayout->addItem(verticalSpacer);
53 QLabel * unlockTextLabel =
new QLabel(inputLabel,
this);
54 verticalLayout->addWidget(unlockTextLabel);
61 auto *
const passwordVisibilityAction =
63 QLineEdit::TrailingPosition);
64 passwordVisibilityAction->setText(tr(
"Show password"));
65 passwordVisibilityAction->setCheckable(
true);
66 BT_CONNECT(passwordVisibilityAction, &QAction::toggled,
67 [
this,passwordVisibilityAction](
bool enable) {
70 passwordVisibilityAction->setText(
74 passwordVisibilityAction->setText(
81 QDialogButtonBox * buttonBox =
new QDialogButtonBox(
this);
82 buttonBox->setOrientation(Qt::Horizontal);
83 buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
85 verticalLayout->addWidget(buttonBox);
87 BT_CONNECT(buttonBox, &QDialogButtonBox::accepted,
88 this, &BtMessageInputDialog::accept);
89 BT_CONNECT(buttonBox, &QDialogButtonBox::rejected,
90 this, &BtMessageInputDialog::reject);
void prepareDialogBox(QDialogButtonBox *box)