From 427c960546d17c3fb8580ee7dcd1a6b449a8fe04 Mon Sep 17 00:00:00 2001 From: fekt Date: Sat, 26 Aug 2023 03:29:07 -0400 Subject: [PATCH] Require int for block height --- src/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 71c9d62..e715178 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -911,12 +911,13 @@ void MainWindow::getBlock() { // First thing is ask the user for a block height bool ok; - auto blockheight = QInputDialog::getText(this, tr("Enter Block Height"), - QString(" ").repeated(140), // Pad the label so the dialog box is wide enough - QLineEdit::Normal, "", &ok); + int i = QInputDialog::getInt(this, tr("Get Block Info"), + tr("Enter Block Height:"), 1, 1, 2147483647, 1, &ok); if (!ok) return; + auto blockheight = QString::number(i); + getRPC()->getBlock(blockheight, [=] (QJsonValue props) { QDialog d(this); Ui_GetBlock gb;