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