Skip to content

Commit dc6f150

Browse files
committed
Qt: show wallet name in request dlg in case of multiwallet
1 parent 4826ca4 commit dc6f150

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/qt/receivecoinsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void ReceiveCoinsDialog::on_receiveButton_clicked()
153153
ui->reqAmount->value(), ui->reqMessage->text());
154154
ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);
155155
dialog->setAttribute(Qt::WA_DeleteOnClose);
156-
dialog->setModel(model->getOptionsModel());
156+
dialog->setModel(model);
157157
dialog->setInfo(info);
158158
dialog->show();
159159
clear();
@@ -166,7 +166,7 @@ void ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(const QModelIndex &
166166
{
167167
const RecentRequestsTableModel *submodel = model->getRecentRequestsTableModel();
168168
ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);
169-
dialog->setModel(model->getOptionsModel());
169+
dialog->setModel(model);
170170
dialog->setInfo(submodel->entry(index.row()).recipient);
171171
dialog->setAttribute(Qt::WA_DeleteOnClose);
172172
dialog->show();

src/qt/receiverequestdialog.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ ReceiveRequestDialog::~ReceiveRequestDialog()
108108
delete ui;
109109
}
110110

111-
void ReceiveRequestDialog::setModel(OptionsModel *_model)
111+
void ReceiveRequestDialog::setModel(WalletModel *_model)
112112
{
113113
this->model = _model;
114114

115115
if (_model)
116-
connect(_model, SIGNAL(displayUnitChanged(int)), this, SLOT(update()));
116+
connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(update()));
117117

118118
// update the display unit if necessary
119119
update();
@@ -143,11 +143,14 @@ void ReceiveRequestDialog::update()
143143
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
144144
html += "<b>"+tr("Address")+"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>";
145145
if(info.amount)
146-
html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatHtmlWithUnit(model->getDisplayUnit(), info.amount) + "<br>";
146+
html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), info.amount) + "<br>";
147147
if(!info.label.isEmpty())
148148
html += "<b>"+tr("Label")+"</b>: " + GUIUtil::HtmlEscape(info.label) + "<br>";
149149
if(!info.message.isEmpty())
150150
html += "<b>"+tr("Message")+"</b>: " + GUIUtil::HtmlEscape(info.message) + "<br>";
151+
if(model->isMultiwallet()) {
152+
html += "<b>"+tr("Wallet")+"</b>: " + GUIUtil::HtmlEscape(model->getWalletName()) + "<br>";
153+
}
151154
ui->outUri->setText(html);
152155

153156
#ifdef USE_QRCODE

src/qt/receiverequestdialog.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include <QLabel>
1313
#include <QPainter>
1414

15-
class OptionsModel;
16-
1715
namespace Ui {
1816
class ReceiveRequestDialog;
1917
}
@@ -53,7 +51,7 @@ class ReceiveRequestDialog : public QDialog
5351
explicit ReceiveRequestDialog(QWidget *parent = 0);
5452
~ReceiveRequestDialog();
5553

56-
void setModel(OptionsModel *model);
54+
void setModel(WalletModel *model);
5755
void setInfo(const SendCoinsRecipient &info);
5856

5957
private Q_SLOTS:
@@ -64,7 +62,7 @@ private Q_SLOTS:
6462

6563
private:
6664
Ui::ReceiveRequestDialog *ui;
67-
OptionsModel *model;
65+
WalletModel *model;
6866
SendCoinsRecipient info;
6967
};
7068

0 commit comments

Comments
 (0)