@@ -44,20 +44,23 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
44
44
45
45
// context menu actions
46
46
QAction *copyURIAction = new QAction (tr (" Copy URI" ), this );
47
+ QAction* copyAddressAction = new QAction (tr (" Copy address" ), this );
47
48
QAction *copyLabelAction = new QAction (tr (" Copy label" ), this );
48
49
QAction *copyMessageAction = new QAction (tr (" Copy message" ), this );
49
50
QAction *copyAmountAction = new QAction (tr (" Copy amount" ), this );
50
51
51
52
// context menu
52
53
contextMenu = new QMenu (this );
53
54
contextMenu->addAction (copyURIAction);
55
+ contextMenu->addAction (copyAddressAction);
54
56
contextMenu->addAction (copyLabelAction);
55
57
contextMenu->addAction (copyMessageAction);
56
58
contextMenu->addAction (copyAmountAction);
57
59
58
60
// context menu signals
59
61
connect (ui->recentRequestsView , &QWidget::customContextMenuRequested, this , &ReceiveCoinsDialog::showMenu);
60
62
connect (copyURIAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyURI);
63
+ connect (copyAddressAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAddress);
61
64
connect (copyLabelAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyLabel);
62
65
connect (copyMessageAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyMessage);
63
66
connect (copyAmountAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAmount);
@@ -287,6 +290,19 @@ void ReceiveCoinsDialog::copyURI()
287
290
GUIUtil::setClipboard (uri);
288
291
}
289
292
293
+ // context menu action: copy address
294
+ void ReceiveCoinsDialog::copyAddress ()
295
+ {
296
+ const QModelIndex sel = selectedRow ();
297
+ if (!sel.isValid ()) {
298
+ return ;
299
+ }
300
+
301
+ const RecentRequestsTableModel* const submodel = model->getRecentRequestsTableModel ();
302
+ const QString address = submodel->entry (sel.row ()).recipient .address ;
303
+ GUIUtil::setClipboard (address);
304
+ }
305
+
290
306
// context menu action: copy label
291
307
void ReceiveCoinsDialog::copyLabel ()
292
308
{
0 commit comments