From 32b445f713bc3e66067cf6d6fe33486f8a0f72e0 Mon Sep 17 00:00:00 2001 From: zathras-crypto Date: Sat, 16 May 2015 21:32:44 -0700 Subject: [PATCH] UI: use json_spirit for formatting showDetails() --- src/qt/tradehistorydialog.cpp | 8 +------- src/qt/txhistorydialog.cpp | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/qt/tradehistorydialog.cpp b/src/qt/tradehistorydialog.cpp index 8a379d0f5ad2d..5a3def8843a6a 100755 --- a/src/qt/tradehistorydialog.cpp +++ b/src/qt/tradehistorydialog.cpp @@ -535,17 +535,11 @@ void TradeHistoryDialog::showDetails() txobj.push_back(Pair("cancelledtransactions", cancelArray)); } - strTXText = write_string(Value(txobj), false) + "\n"; + strTXText = write_string(Value(txobj), true); } } if (!strTXText.empty()) { - strTXText = ReplaceStr(",",",\n ",strTXText); - strTXText = ReplaceStr(":"," : ",strTXText); - strTXText = ReplaceStr("{","{\n ",strTXText); - strTXText = ReplaceStr("}","\n}",strTXText); - strTXText = ReplaceStr("[","[\n",strTXText); - strTXText = ReplaceStr("]","\n]",strTXText); PopulateSimpleDialog(strTXText, "Trade Information", "Trade Information"); } } diff --git a/src/qt/txhistorydialog.cpp b/src/qt/txhistorydialog.cpp index cd5d28cf9dd73..29ee3b70bfc33 100644 --- a/src/qt/txhistorydialog.cpp +++ b/src/qt/txhistorydialog.cpp @@ -551,7 +551,7 @@ void TXHistoryDialog::showDetails() // grab details usual way int pop = populateRPCTransactionObject(txid, &txobj, ""); if (0<=pop) { - strTXText = write_string(Value(txobj), false) + "\n"; + strTXText = write_string(Value(txobj), true); // manipulate for STO if needed size_t pos = strTXText.find("Send To Owners"); if (pos!=std::string::npos) { @@ -561,16 +561,11 @@ void TXHistoryDialog::showDetails() s_stolistdb->getRecipients(txid, "", &receiveArray, &tmpAmount, &tmpSTOFee); txobj.push_back(Pair("recipients", receiveArray)); //rewrite string - strTXText = write_string(Value(txobj), false) + "\n"; + strTXText = write_string(Value(txobj), true); } } } if (!strTXText.empty()) { - strTXText = ReplaceStr(",",",\n ",strTXText); - strTXText = ReplaceStr(":"," : ",strTXText); - strTXText = ReplaceStr("{","{\n ",strTXText); - strTXText = ReplaceStr("}","\n}",strTXText); - strTXText = ReplaceStr("[","[\n",strTXText); PopulateSimpleDialog(strTXText, "Transaction Information", "Transaction Information"); } }