@@ -34,9 +34,9 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(QWidget* parent) :
34
34
// context menu actions
35
35
QAction *copyURIAction = new QAction (tr (" Copy URI" ), this );
36
36
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 );
40
40
41
41
// context menu
42
42
contextMenu = new QMenu (this );
@@ -239,9 +239,18 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column)
239
239
// context menu
240
240
void ReceiveCoinsDialog::showMenu (const QPoint &point)
241
241
{
242
- if (!selectedRow ().isValid ()) {
242
+ const QModelIndex sel = selectedRow ();
243
+ if (!sel.isValid ()) {
243
244
return ;
244
245
}
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
+
245
254
contextMenu->exec (QCursor::pos ());
246
255
}
247
256
0 commit comments