Changeset View
Changeset View
Standalone View
Standalone View
src/qt/receiverequestdialog.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | #endif | ||||
connect(ui->btnSaveAs, SIGNAL(clicked()), ui->lblQRCode, SLOT(saveImage())); | connect(ui->btnSaveAs, SIGNAL(clicked()), ui->lblQRCode, SLOT(saveImage())); | ||||
} | } | ||||
ReceiveRequestDialog::~ReceiveRequestDialog() { | ReceiveRequestDialog::~ReceiveRequestDialog() { | ||||
delete ui; | delete ui; | ||||
} | } | ||||
void ReceiveRequestDialog::setModel(OptionsModel *_model) { | void ReceiveRequestDialog::setModel(WalletModel *_model) { | ||||
this->model = _model; | this->model = _model; | ||||
if (_model) | if (_model) | ||||
connect(_model, SIGNAL(displayUnitChanged(int)), this, SLOT(update())); | connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), | ||||
this, SLOT(update())); | |||||
// update the display unit if necessary | // update the display unit if necessary | ||||
update(); | update(); | ||||
} | } | ||||
void ReceiveRequestDialog::setInfo(const SendCoinsRecipient &_info) { | void ReceiveRequestDialog::setInfo(const SendCoinsRecipient &_info) { | ||||
this->info = _info; | this->info = _info; | ||||
// Display addresses with currently configured encoding. | // Display addresses with currently configured encoding. | ||||
Show All 13 Lines | void ReceiveRequestDialog::update() { | ||||
QString html; | QString html; | ||||
html += "<html><font face='verdana, arial, helvetica, sans-serif'>"; | html += "<html><font face='verdana, arial, helvetica, sans-serif'>"; | ||||
html += "<b>" + tr("Payment information") + "</b><br>"; | html += "<b>" + tr("Payment information") + "</b><br>"; | ||||
html += "<b>" + tr("URI") + "</b>: "; | html += "<b>" + tr("URI") + "</b>: "; | ||||
html += "<a href=\"" + uri + "\">" + GUIUtil::HtmlEscape(uri) + "</a><br>"; | html += "<a href=\"" + uri + "\">" + GUIUtil::HtmlEscape(uri) + "</a><br>"; | ||||
html += "<b>" + tr("Address") + | html += "<b>" + tr("Address") + | ||||
"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>"; | "</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>"; | ||||
if (info.amount != Amount::zero()) | if (info.amount != Amount::zero()) | ||||
html += "<b>" + tr("Amount") + | html += "<b>" + tr("Amount") + "</b>: " + | ||||
"</b>: " + BitcoinUnits::formatHtmlWithUnit( | BitcoinUnits::formatHtmlWithUnit( | ||||
model->getDisplayUnit(), info.amount) + | model->getOptionsModel()->getDisplayUnit(), info.amount) + | ||||
"<br>"; | "<br>"; | ||||
if (!info.label.isEmpty()) | if (!info.label.isEmpty()) | ||||
html += "<b>" + tr("Label") + | html += "<b>" + tr("Label") + | ||||
"</b>: " + GUIUtil::HtmlEscape(info.label) + "<br>"; | "</b>: " + GUIUtil::HtmlEscape(info.label) + "<br>"; | ||||
if (!info.message.isEmpty()) | if (!info.message.isEmpty()) | ||||
html += "<b>" + tr("Message") + | html += "<b>" + tr("Message") + | ||||
"</b>: " + GUIUtil::HtmlEscape(info.message) + "<br>"; | "</b>: " + GUIUtil::HtmlEscape(info.message) + "<br>"; | ||||
if (model->isMultiwallet()) { | |||||
html += "<b>" + tr("Wallet") + | |||||
"</b>: " + GUIUtil::HtmlEscape(model->getWalletName()) + "<br>"; | |||||
} | |||||
ui->outUri->setText(html); | ui->outUri->setText(html); | ||||
#ifdef USE_QRCODE | #ifdef USE_QRCODE | ||||
int fontSize = config->UseCashAddrEncoding() ? 10 : 12; | int fontSize = config->UseCashAddrEncoding() ? 10 : 12; | ||||
ui->lblQRCode->setText(""); | ui->lblQRCode->setText(""); | ||||
if (!uri.isEmpty()) { | if (!uri.isEmpty()) { | ||||
// limit URI length | // limit URI length | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |