From 76c4cfc0de4302c1dcfe0dfb61e623422b8117d2 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 26 Jul 2015 18:43:22 +0200 Subject: [PATCH] UI: Limit display of Sendcoins-popup to 10 entries. --- src/qt/sendcoinsdialog.cpp | 16 ++++++++++++++++ src/qt/sendcoinsdialog.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 297574145..f85a71977 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -380,6 +380,22 @@ void SendCoinsDialog::send(QList recipients, QString strFee, .arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)) .arg("
" + alternativeUnits.join(" " + tr("or") + "
"))); + // Limit number of displayed entries + int messageEntries = formatted.size(); + int displayedEntries = 0; + for(int i = 0; i < formatted.size(); i++){ + if(i >= MAX_SEND_POPUP_ENTRIES){ + formatted.removeLast(); + i--; + } + else{ + displayedEntries = i+1; + } + } + questionString.append("
"); + questionString.append(tr("(%1 of %2 entries displayed)").arg(displayedEntries).arg(messageEntries)); + + // Display message box QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"), questionString.arg(formatted.join("
")), QMessageBox::Yes | QMessageBox::Cancel, diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 826e29ae9..8b87b2548 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -10,6 +10,8 @@ #include #include +static const int MAX_SEND_POPUP_ENTRIES = 10; + class ClientModel; class OptionsModel; class SendCoinsEntry;