aboutsummaryrefslogtreecommitdiff
path: root/src/qt/receivecoinsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/receivecoinsdialog.cpp')
-rw-r--r--src/qt/receivecoinsdialog.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index 7539645b47..2af3949ae4 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -19,6 +19,7 @@
#include <QMessageBox>
#include <QTextDocument>
#include <QScrollBar>
+#include <QItemSelection>
ReceiveCoinsDialog::ReceiveCoinsDialog(QWidget *parent) :
QDialog(parent),
@@ -77,6 +78,11 @@ void ReceiveCoinsDialog::setModel(WalletModel *model)
ui->recentRequestsView->horizontalHeader()->resizeSection(RecentRequestsTableModel::Amount, 100);
model->getRecentRequestsTableModel()->sort(RecentRequestsTableModel::Date, Qt::DescendingOrder);
+
+ connect(ui->recentRequestsView->selectionModel(),
+ SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this,
+ SLOT(on_recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));
}
}
@@ -161,6 +167,15 @@ void ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(const QModelIndex &
dialog->show();
}
+void ReceiveCoinsDialog::on_recentRequestsView_selectionChanged(const QItemSelection &selected,
+ const QItemSelection &deselected)
+{
+ // Enable Show/Remove buttons only if anything is selected.
+ bool enable = !ui->recentRequestsView->selectionModel()->selectedRows().isEmpty();
+ ui->showRequestButton->setEnabled(enable);
+ ui->removeRequestButton->setEnabled(enable);
+}
+
void ReceiveCoinsDialog::on_showRequestButton_clicked()
{
if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())