Skip to content

Commit

Permalink
UI: use json_spirit for formatting showDetails()
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras-crypto committed May 17, 2015
1 parent 55b309d commit 32b445f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/qt/tradehistorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
9 changes: 2 additions & 7 deletions src/qt/txhistorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
}
}
Expand Down

0 comments on commit 32b445f

Please sign in to comment.