|
|
@ -83,11 +83,9 @@ void Controller::setConnection(Connection* c) { |
|
|
|
|
|
|
|
// Create Sietch zdust addr at startup.
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
|
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -98,7 +96,6 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch1.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
@ -110,11 +107,11 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch2.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -125,7 +122,6 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch3.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
@ -137,11 +133,11 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch4.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -152,7 +148,6 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch5.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
@ -164,11 +159,11 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch6.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -179,7 +174,6 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch7.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
@ -191,11 +185,11 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch8.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -204,11 +198,11 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch9.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -235,20 +229,19 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx) { |
|
|
|
json dust7 = json::object(); |
|
|
|
json dust8 = json::object(); |
|
|
|
json dust9 = json::object(); |
|
|
|
|
|
|
|
// Create Sietch zdust addr again to not use it twice.
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch.txt"); |
|
|
|
QFile file(path); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
|
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
@ -262,13 +255,12 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch2.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
@ -289,20 +281,18 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch4.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
@ -322,14 +312,13 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch6.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
|
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
@ -343,41 +332,36 @@ if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch8.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
zrpc->createNewSietchZaddr( [=] (json reply) { |
|
|
|
|
|
|
|
QString path= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch9.txt"); |
|
|
|
QFile file(path); |
|
|
|
auto zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
QString zdust = QString::fromStdString(reply.get<json::array_t>()[0]); |
|
|
|
if(!file.open(QIODevice::WriteOnly)){ |
|
|
|
file.close(); |
|
|
|
} else { |
|
|
|
QTextStream out(&file); out << zdust.toUtf8(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
|
|
|
|
} ); |
|
|
|
|
|
|
|
// Set sietch zdust addr to json.
|
|
|
|
|
|
|
|
QString path= (QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)) + QString("/Sietch.txt"); |
|
|
|
QFile inputFile(path); |
|
|
|
|
|
|
|
|
|
|
|
if (inputFile.open(QIODevice::ReadOnly)) |
|
|
|
{ |
|
|
|
QTextStream in(&inputFile); |
|
|
@ -392,7 +376,6 @@ if (inputFile.open(QIODevice::ReadOnly)) |
|
|
|
|
|
|
|
QString path1= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch1.txt"); |
|
|
|
QFile inputFile1(path1); |
|
|
|
|
|
|
|
if (inputFile1.open(QIODevice::ReadOnly)) |
|
|
|
{ |
|
|
|
QTextStream in(&inputFile1); |
|
|
@ -431,6 +414,7 @@ if (inputFile3.open(QIODevice::ReadOnly)) |
|
|
|
} |
|
|
|
inputFile3.close(); |
|
|
|
} |
|
|
|
|
|
|
|
QString path4= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch4.txt"); |
|
|
|
QFile inputFile4(path4); |
|
|
|
if (inputFile4.open(QIODevice::ReadOnly)) |
|
|
@ -456,6 +440,7 @@ if (inputFile5.open(QIODevice::ReadOnly)) |
|
|
|
} |
|
|
|
inputFile5.close(); |
|
|
|
} |
|
|
|
|
|
|
|
QString path6= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch6.txt"); |
|
|
|
QFile inputFile6(path6); |
|
|
|
if (inputFile6.open(QIODevice::ReadOnly)) |
|
|
@ -481,6 +466,7 @@ if (inputFile7.open(QIODevice::ReadOnly)) |
|
|
|
} |
|
|
|
inputFile7.close(); |
|
|
|
} |
|
|
|
|
|
|
|
QString path8= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch8.txt"); |
|
|
|
QFile inputFile8(path8); |
|
|
|
if (inputFile8.open(QIODevice::ReadOnly)) |
|
|
@ -493,6 +479,7 @@ if (inputFile8.open(QIODevice::ReadOnly)) |
|
|
|
} |
|
|
|
inputFile.close(); |
|
|
|
} |
|
|
|
|
|
|
|
QString path9= QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QString("/Sietch9.txt"); |
|
|
|
QFile inputFile9(path9); |
|
|
|
if (inputFile9.open(QIODevice::ReadOnly)) |
|
|
@ -506,6 +493,7 @@ if (inputFile9.open(QIODevice::ReadOnly)) |
|
|
|
inputFile9.close(); |
|
|
|
} |
|
|
|
|
|
|
|
// Dust amt/memo, construct the JSON
|
|
|
|
dust["amount"] = 0; |
|
|
|
dust["memo"] = ""; |
|
|
|
dust1["amount"] = 0; |
|
|
@ -526,7 +514,9 @@ if (inputFile9.open(QIODevice::ReadOnly)) |
|
|
|
dust8["memo"] = ""; |
|
|
|
dust9["amount"] = 0; |
|
|
|
dust9["memo"] = ""; |
|
|
|
|
|
|
|
// For each addr/amt/memo, construct the JSON and also build the confirm dialog box
|
|
|
|
|
|
|
|
for (int i=0; i < tx.toAddrs.size(); i++) { |
|
|
|
auto toAddr = tx.toAddrs[i]; |
|
|
|
|
|
|
@ -555,8 +545,6 @@ if (inputFile9.open(QIODevice::ReadOnly)) |
|
|
|
allRecepients.push_back(rec) ; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Controller::noConnection() { |
|
|
|
QIcon i = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); |
|
|
|
main->statusIcon->setPixmap(i.pixmap(16, 16)); |
|
|
|