@@ -34,9 +34,9 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(QWidget* parent) :
3434 // context menu actions
3535 QAction *copyURIAction = new QAction (tr (" Copy URI" ), this );
3636 QAction* copyAddressAction = new QAction (tr (" Copy address" ), this );
37- QAction * copyLabelAction = new QAction (tr (" Copy label" ), this );
38- QAction * copyMessageAction = new QAction (tr (" Copy message" ), this );
39- QAction * copyAmountAction = new QAction (tr (" Copy amount" ), this );
37+ copyLabelAction = new QAction (tr (" Copy label" ), this );
38+ copyMessageAction = new QAction (tr (" Copy message" ), this );
39+ copyAmountAction = new QAction (tr (" Copy amount" ), this );
4040
4141 // context menu
4242 contextMenu = new QMenu (this );
@@ -239,9 +239,18 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column)
239239// context menu
240240void ReceiveCoinsDialog::showMenu (const QPoint &point)
241241{
242- if (!selectedRow ().isValid ()) {
242+ const QModelIndex sel = selectedRow ();
243+ if (!sel.isValid ()) {
243244 return ;
244245 }
246+
247+ // disable context menu actions when appropriate
248+ const RecentRequestsTableModel* const submodel = model->getRecentRequestsTableModel ();
249+ const RecentRequestEntry& req = submodel->entry (sel.row ());
250+ copyLabelAction->setDisabled (req.recipient .label .isEmpty ());
251+ copyMessageAction->setDisabled (req.recipient .message .isEmpty ());
252+ copyAmountAction->setDisabled (req.recipient .amount == 0 );
253+
245254 contextMenu->exec (QCursor::pos ());
246255}
247256
0 commit comments