Browse Source

Render valuePools json and each tx in their own property

This means a user can copy + paste individual txids which is much
better than the previous behavior. And now we render something
useful for valuePools in case anybody wants to see that.
custom_themes
Duke 5 months ago
parent
commit
a18014b6d4
  1. 29
      src/mainwindow.cpp

29
src/mainwindow.cpp

@ -943,18 +943,33 @@ void MainWindow::getBlock() {
property_value = props.toObject()[property_name].toBool() ? "true" : "false" ; property_value = props.toObject()[property_name].toBool() ? "true" : "false" ;
} else if (props.toObject()[property_name].isArray()) { } else if (props.toObject()[property_name].isArray()) {
DEBUG( property_name << " is an array"); DEBUG( property_name << " is an array");
auto txs = props.toObject()[property_name].toArray(); if( property_name == "tx") {
for (const auto& tx : txs) { auto txs = props.toObject()[property_name].toArray();
property_value += tx.toString() + " , "; int index = 0;
// create a property for each tx in the block so it renders in a more useful way
for (const auto& tx : txs) {
QString this_property_name = "tx " + QString::number(index);
propsList.append(
QPair<QString, QString>( this_property_name, tx.toString() )
);
index++;
}
} else if (property_name == "valuePools") {
auto stuff = props.toObject()[property_name].toArray();
property_value = QJsonDocument(stuff).toJson();
property_value.remove("\n");
property_value.remove(" ");
} }
// property_value = QJsonDocument(txs).toJson();
} else if (props.toObject()[property_name].isObject()) { } else if (props.toObject()[property_name].isObject()) {
DEBUG( property_name << " is an object"); DEBUG( property_name << " is an object");
} }
propsList.append( // tx properties are added in their own special way above
QPair<QString, QString>( property_name, property_value ) if (property_name != "tx") {
); propsList.append(
QPair<QString, QString>( property_name, property_value )
);
}
} }
ValidateAddressesModel model(gb.tblProps, propsList); ValidateAddressesModel model(gb.tblProps, propsList);

Loading…
Cancel
Save