|
|
@ -14,6 +14,7 @@ |
|
|
|
#include "ui_viewalladdresses.h" |
|
|
|
#include "ui_validateaddress.h" |
|
|
|
#include "ui_rescandialog.h" |
|
|
|
#include "ui_getblock.h" |
|
|
|
#include "rpc.h" |
|
|
|
#include "balancestablemodel.h" |
|
|
|
#include "settings.h" |
|
|
@ -96,7 +97,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
QObject::connect(ui->actionValidate_Address, &QAction::triggered, this, &MainWindow::validateAddress); |
|
|
|
|
|
|
|
// Get Block
|
|
|
|
//QObject::connect(ui->actionGet_Block, &QAction::triggered, this, &MainWindow::getBlock);
|
|
|
|
QObject::connect(ui->actionGet_Block, &QAction::triggered, this, &MainWindow::getBlock); |
|
|
|
|
|
|
|
// Address Book
|
|
|
|
QObject::connect(ui->action_Address_Book, &QAction::triggered, this, &MainWindow::addressBook); |
|
|
@ -903,27 +904,28 @@ void MainWindow::validateAddress() { |
|
|
|
} |
|
|
|
|
|
|
|
// Get block info
|
|
|
|
/*
|
|
|
|
void MainWindow::getBlock() { |
|
|
|
// Make sure everything is up and running
|
|
|
|
if (!getRPC() || !getRPC()->getConnection()) |
|
|
|
return; |
|
|
|
|
|
|
|
// First thing is ask the user for a blocj height
|
|
|
|
// First thing is ask the user for a block height
|
|
|
|
bool ok; |
|
|
|
auto blockheight = QInputDialog::getText(this, tr("Enter Block Height"), QLineEdit::Normal, "", &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); |
|
|
|
if (!ok) |
|
|
|
return; |
|
|
|
|
|
|
|
getRPC()->validateAddress(address, [=] (QJsonValue props) { |
|
|
|
getRPC()->getBlock(blockheight, [=] (QJsonValue props) { |
|
|
|
QDialog d(this); |
|
|
|
Ui_ValidateAddress va; |
|
|
|
va.setupUi(&d); |
|
|
|
Ui_GetBlock gb; |
|
|
|
gb.setupUi(&d); |
|
|
|
Settings::saveRestore(&d); |
|
|
|
Settings::saveRestoreTableHeader(va.tblProps, &d, "validateaddressprops"); |
|
|
|
va.tblProps->horizontalHeader()->setStretchLastSection(true); |
|
|
|
Settings::saveRestoreTableHeader(gb.tblProps, &d, "getblockprops"); |
|
|
|
gb.tblProps->horizontalHeader()->setStretchLastSection(true); |
|
|
|
|
|
|
|
va.lblAddress->setText(address); |
|
|
|
gb.lblHeight->setText(blockheight); |
|
|
|
|
|
|
|
QList<QPair<QString, QString>> propsList; |
|
|
|
|
|
|
@ -942,13 +944,12 @@ void MainWindow::getBlock() { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
ValidateAddressesModel model(va.tblProps, propsList); |
|
|
|
va.tblProps->setModel(&model); |
|
|
|
ValidateAddressesModel model(gb.tblProps, propsList); |
|
|
|
gb.tblProps->setModel(&model); |
|
|
|
|
|
|
|
d.exec(); |
|
|
|
}); |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
void MainWindow::doImport(QList<QString>* keys) { |
|
|
|
if (rpc->getConnection() == nullptr) { |
|
|
|