@@ -44,20 +44,23 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
4444
4545 // context menu actions
4646 QAction *copyURIAction = new QAction (tr (" Copy URI" ), this );
47+ QAction* copyAddressAction = new QAction (tr (" Copy address" ), this );
4748 QAction *copyLabelAction = new QAction (tr (" Copy label" ), this );
4849 QAction *copyMessageAction = new QAction (tr (" Copy message" ), this );
4950 QAction *copyAmountAction = new QAction (tr (" Copy amount" ), this );
5051
5152 // context menu
5253 contextMenu = new QMenu (this );
5354 contextMenu->addAction (copyURIAction);
55+ contextMenu->addAction (copyAddressAction);
5456 contextMenu->addAction (copyLabelAction);
5557 contextMenu->addAction (copyMessageAction);
5658 contextMenu->addAction (copyAmountAction);
5759
5860 // context menu signals
5961 connect (ui->recentRequestsView , &QWidget::customContextMenuRequested, this , &ReceiveCoinsDialog::showMenu);
6062 connect (copyURIAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyURI);
63+ connect (copyAddressAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAddress);
6164 connect (copyLabelAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyLabel);
6265 connect (copyMessageAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyMessage);
6366 connect (copyAmountAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAmount);
@@ -287,6 +290,19 @@ void ReceiveCoinsDialog::copyURI()
287290 GUIUtil::setClipboard (uri);
288291}
289292
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+
290306// context menu action: copy label
291307void ReceiveCoinsDialog::copyLabel ()
292308{
0 commit comments