@@ -43,20 +43,23 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
4343
4444 // context menu actions
4545 QAction *copyURIAction = new QAction (tr (" Copy URI" ), this );
46+ QAction *copyAddressAction = new QAction (tr (" Copy address" ), this );
4647 QAction *copyLabelAction = new QAction (tr (" Copy label" ), this );
4748 QAction *copyMessageAction = new QAction (tr (" Copy message" ), this );
4849 QAction *copyAmountAction = new QAction (tr (" Copy amount" ), this );
4950
5051 // context menu
5152 contextMenu = new QMenu (this );
5253 contextMenu->addAction (copyURIAction);
54+ contextMenu->addAction (copyAddressAction);
5355 contextMenu->addAction (copyLabelAction);
5456 contextMenu->addAction (copyMessageAction);
5557 contextMenu->addAction (copyAmountAction);
5658
5759 // context menu signals
5860 connect (ui->recentRequestsView , &QWidget::customContextMenuRequested, this , &ReceiveCoinsDialog::showMenu);
5961 connect (copyURIAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyURI);
62+ connect (copyAddressAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAddress);
6063 connect (copyLabelAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyLabel);
6164 connect (copyMessageAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyMessage);
6265 connect (copyAmountAction, &QAction::triggered, this , &ReceiveCoinsDialog::copyAmount);
@@ -286,6 +289,19 @@ void ReceiveCoinsDialog::copyURI()
286289 GUIUtil::setClipboard (uri);
287290}
288291
292+ // context menu action: copy address
293+ void ReceiveCoinsDialog::copyAddress ()
294+ {
295+ 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+
289305// context menu action: copy label
290306void ReceiveCoinsDialog::copyLabel ()
291307{
0 commit comments