2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2024-01-01 17:07:58 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2024 The Monero Project
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-06-27 11:46:32 +00:00
|
|
|
#include "ui_ContactsDialog.h"
|
|
|
|
#include "ContactsDialog.h"
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2020-12-23 04:54:57 +00:00
|
|
|
ContactsDialog::ContactsDialog(QWidget *parent, const QString &address, const QString &name)
|
2021-10-22 17:19:56 +00:00
|
|
|
: WindowModalDialog(parent)
|
2021-06-27 14:33:18 +00:00
|
|
|
, ui(new Ui::ContactsDialog)
|
2020-10-07 10:36:04 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
setMinimumWidth(400);
|
|
|
|
|
2020-12-23 04:54:57 +00:00
|
|
|
ui->lineEdit_address->setText(address);
|
|
|
|
ui->lineEdit_name->setText(name);
|
|
|
|
if (!name.isEmpty()) {
|
|
|
|
ui->lineEdit_name->setFocus();
|
|
|
|
}
|
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
connect(ui->buttonBox, &QDialogButtonBox::accepted, [&](){
|
|
|
|
m_address = ui->lineEdit_address->text();
|
|
|
|
m_name = ui->lineEdit_name->text();
|
|
|
|
});
|
|
|
|
|
|
|
|
this->adjustSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString ContactsDialog::getAddress() {
|
|
|
|
return m_address;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString ContactsDialog::getName() {
|
|
|
|
return m_name;
|
2021-06-27 12:25:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ContactsDialog::~ContactsDialog() = default;
|