From f8b87c35725576eacdad7ef1196834e710a00876 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sat, 6 Feb 2021 12:09:56 -0500 Subject: [PATCH 1/2] Refactor --- src/connection.cpp | 8 ++++---- src/connection.h | 2 +- src/rpc.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index 0051521..04b1bb0 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -71,7 +71,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { main->logger->write("Embedded hushd started up, trying autoconnect in 1 sec"); QTimer::singleShot(1000, [=]() { doAutoConnect(); } ); } else { - if (config->zcashDaemon) { + if (config->hushDaemon) { // hushd is configured to run as a daemon, so we must wait for a few seconds // to let it start up. main->logger->write("hushd is daemon=1. Waiting for it to start up"); @@ -89,7 +89,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { // We tried to start ehushd previously, and it didn't work. So, show the error. main->logger->write("Couldn't start embedded hushd for unknown reason"); QString explanation; - if (config->zcashDaemon) { + if (config->hushDaemon) { explanation = QString() % QObject::tr("You have hushd set to start as a daemon, which can cause problems " "with SilentDragon\n\n." "Please remove the following line from your HUSH3.conf and restart SilentDragon\n" @@ -655,7 +655,7 @@ std::shared_ptr ConnectionLoader::autoDetectZcashConf() { zcashconf->connType = ConnectionType::DetectedConfExternalHushD; zcashconf->usingZcashConf = true; zcashconf->zcashDir = QFileInfo(confLocation).absoluteDir().absolutePath(); - zcashconf->zcashDaemon = false; + zcashconf->hushDaemon = false; Settings::getInstance()->setUsingZcashConf(confLocation); @@ -675,7 +675,7 @@ std::shared_ptr ConnectionLoader::autoDetectZcashConf() { zcashconf->port = value; } if (name == "daemon" && value == "1") { - zcashconf->zcashDaemon = true; + zcashconf->hushDaemon = true; } if (name == "proxy") { zcashconf->proxy = value; diff --git a/src/connection.h b/src/connection.h index 12eb239..743e23a 100644 --- a/src/connection.h +++ b/src/connection.h @@ -21,7 +21,7 @@ struct ConnectionConfig { QString rpcuser; QString rpcpassword; bool usingZcashConf; - bool zcashDaemon; + bool hushDaemon; QString zcashDir; QString proxy; QString consolidation; diff --git a/src/rpc.cpp b/src/rpc.cpp index b65a9d4..62921cd 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1254,7 +1254,7 @@ void RPC::shutdownZcashd() { if ((ehushd->atEnd() && ehushd->processId() == 0) || ehushd->state() == QProcess::NotRunning || waitCount > 30 || - conn->config->zcashDaemon) { // If hushd is daemon, then we don't have to do anything else + conn->config->hushDaemon) { // If hushd is daemon, then we don't have to do anything else qDebug() << "Ended"; waiter.stop(); QTimer::singleShot(1000, [&]() { d.accept(); }); From 156930362013eb82a5bada4a72ea54dfa5bf2ac4 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sat, 6 Feb 2021 12:16:13 -0500 Subject: [PATCH 2/2] Refactor --- res/silentdragon_be.ts | 2 +- res/silentdragon_bg.ts | 2 +- res/silentdragon_de.qm | Bin 48460 -> 48452 bytes res/silentdragon_de.ts | 4 ++-- res/silentdragon_es.qm | Bin 40341 -> 40333 bytes res/silentdragon_es.ts | 4 ++-- res/silentdragon_fi.qm | Bin 39646 -> 39638 bytes res/silentdragon_fi.ts | 4 ++-- res/silentdragon_fil.qm | Bin 43773 -> 43765 bytes res/silentdragon_fil.ts | 2 +- res/silentdragon_fr.qm | Bin 45192 -> 45184 bytes res/silentdragon_fr.ts | 2 +- res/silentdragon_hr.qm | Bin 40190 -> 40182 bytes res/silentdragon_hr.ts | 2 +- res/silentdragon_id.qm | Bin 40137 -> 40129 bytes res/silentdragon_id.ts | 2 +- res/silentdragon_it.qm | Bin 40337 -> 40329 bytes res/silentdragon_it.ts | 2 +- res/silentdragon_nl.qm | Bin 40240 -> 40232 bytes res/silentdragon_nl.ts | 2 +- res/silentdragon_pt.qm | Bin 38799 -> 38791 bytes res/silentdragon_pt.ts | 4 ++-- res/silentdragon_ro.qm | Bin 39737 -> 39729 bytes res/silentdragon_ro.ts | 2 +- res/silentdragon_ru.qm | Bin 49218 -> 49210 bytes res/silentdragon_ru.ts | 2 +- res/silentdragon_sr.qm | Bin 40032 -> 40024 bytes res/silentdragon_sr.ts | 2 +- res/silentdragon_template.ts | 2 +- res/silentdragon_tr.qm | Bin 39657 -> 39649 bytes res/silentdragon_tr.ts | 2 +- res/silentdragon_uk.qm | Bin 33700 -> 33693 bytes res/silentdragon_uk.ts | 2 +- res/silentdragon_zh.qm | Bin 20817 -> 20810 bytes res/silentdragon_zh.ts | 2 +- src/connection.cpp | 38 +++++++++++++++---------------- src/connection.h | 12 +++++----- src/createzcashconfdialog.ui | 8 +++---- src/main.cpp | 4 ++-- src/mainwindow.cpp | 42 +++++++++++++++++------------------ src/mainwindow.h | 2 +- src/requestdialog.cpp | 4 ++-- src/rpc.cpp | 14 ++++++------ src/rpc.h | 4 ++-- src/settings.cpp | 10 ++++----- src/settings.h | 12 +++++----- 46 files changed, 98 insertions(+), 98 deletions(-) diff --git a/res/silentdragon_be.ts b/res/silentdragon_be.ts index 3d605bb..79a3a68 100644 --- a/res/silentdragon_be.ts +++ b/res/silentdragon_be.ts @@ -2692,7 +2692,7 @@ You either have unconfirmed funds or the balance is too low for an automatic mig - createZcashConf + createHushConf Show Advanced Configuration diff --git a/res/silentdragon_bg.ts b/res/silentdragon_bg.ts index b9b8077..e56dbd5 100644 --- a/res/silentdragon_bg.ts +++ b/res/silentdragon_bg.ts @@ -2117,7 +2117,7 @@ Would you like to visit the releases page? - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_de.qm b/res/silentdragon_de.qm index 28d0b32aaf6fa863dbac3a487ffcd51012b6542e..6fd1543a3060959ea33b3031d01836cfc022c498 100644 GIT binary patch delta 67 zcmX@}i|NQOrVZz}GI^9vzO*$NL|JSL1yK{W{R2{)CvKN!1aa5zr~pw~I~zgNx}Ez# KlKH#tG64WMLLSlp delta 85 zcmX@|i|NcSrVZz}GDjsRPQJJ`8BCjP3kB1?+x~&*&Ar>D8NmXpc2t0Am7R@XdilDie URI sollte folgendes Format haben: 'hush:<Adresse>?Betrag=x&Nachricht=y - Paste Zcash URI + Paste Hush URI Füge HUSH URI ein @@ -2412,7 +2412,7 @@ You either have unconfirmed funds or the balance is too low for an automatic mig - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_es.qm b/res/silentdragon_es.qm index 72c22e78b8d3a64549261a19fd4129dda5581876..75973468cecd0dafd8608c5d7c7481317b02ecfa 100644 GIT binary patch delta 87 zcmbQbo2hp<(}uojOdh3^Cr*p!@F*?LaL&(5o6J>bKiOis3`jhD`W+y(*=&X=BZ%ua avjRk&oS6=yjAyMwXgVLLvYBsoI}-r!#UeBS delta 75 zcmeC(%`|m4(}uoj%u&gSlP64z2h$&?C4%XY>32Z%W}_LRj9>xJnH6CA@XT~Dtut#K KSizlH8<_y3ogW_n diff --git a/res/silentdragon_es.ts b/res/silentdragon_es.ts index 47a8358..699a1c3 100644 --- a/res/silentdragon_es.ts +++ b/res/silentdragon_es.ts @@ -2347,7 +2347,7 @@ El saldo es insuficiente para una migración automática. - createZcashConf + createHushConf Configure HUSH3.conf @@ -2470,7 +2470,7 @@ El saldo es insuficiente para una migración automática. <html><head/><body><p>ZBoard: Fully anonymous and untraceable chat messages based on the ZCash blockchain. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> - <html><head/><body><p>ZBoard: Mensajes de chat totalmente anónimos e imposibles de rastrear basados en la cadena de bloques Zcash. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> + <html><head/><body><p>ZBoard: Mensajes de chat totalmente anónimos e imposibles de rastrear basados en la cadena de bloques Hush. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> Warning diff --git a/res/silentdragon_fi.qm b/res/silentdragon_fi.qm index b4eaf9a1ea5424aa7d40fc70a6d4aa5fc7032d02..2f106007dce2c36a81fcc355b1c36c387d6e6a19 100644 GIT binary patch delta 81 zcmcb&mFe16rVV>1GkKIwJ}@~FM9EA^22o8@egLV>wNv>SLEQdnNg(RWw0aO#Hhmq3 aM`>|}bADdhWPTBq$)YnQHfPQ#WdZ=1(jh+p delta 75 zcmcb%mFeDArVV>1Ge;#SPToH`5==`?Ne0vPQ+|Nx&6QL68NmWw(~`jSyJ_`cI)C~) KumbrR+nE5+s2`C4 diff --git a/res/silentdragon_fi.ts b/res/silentdragon_fi.ts index e839610..1a289d0 100644 --- a/res/silentdragon_fi.ts +++ b/res/silentdragon_fi.ts @@ -1461,7 +1461,7 @@ Aseta isäntä/portti ja käyttäjänimi/salasana Muokkaa-> Asetukset-valikos Osoitteen Formaatti Virhe - doesn't seem to be a valid Zcash address. + doesn't seem to be a valid Hush address. YOUR_TRANSLATION_HERE @@ -2367,7 +2367,7 @@ Sinulla on joko vahvistamattomia varoja tai saldo on liian pieni automaattiseen - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_fil.qm b/res/silentdragon_fil.qm index 2558a7d1a3b0906e4c0b6f54fe493d901c39cadc..2e0a71788ab4d3cfaac02bffb119ece382dc6f2d 100644 GIT binary patch delta 67 zcmex+mFeqMrVT-hnLJ7-hc3 - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_fr.qm b/res/silentdragon_fr.qm index 3b97737612e7a7155bec1c3abaa3c6abe3309de2..c82acb0ae9e89cae934e0c4cadfe69b169c5117e 100644 GIT binary patch delta 68 zcmeBp$kgzVX~XpuOdh3^Z>^{XQ4uSHfz;-8E14KU^yXEPAbRro)pZ~$U`;28y0hj4 KNOJkwhfDwn_8t@f delta 76 zcmZp8$kg$WX~Xpu%u&gSlW(r52Ge0HgF*D>)hn48!Ho5*B*Bcyr&ia2Rd}uG1k+d7 MoB%7BzxE*$0P@!%00000 diff --git a/res/silentdragon_fr.ts b/res/silentdragon_fr.ts index 1ec3577..d1fc928 100644 --- a/res/silentdragon_fr.ts +++ b/res/silentdragon_fr.ts @@ -2385,7 +2385,7 @@ Vous avez soit des fonds non confirmés soit le solde est trop petit pour une mi - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_hr.qm b/res/silentdragon_hr.qm index 77a98e5e7b8637ecdcc17eba75d9eeeb1d890b64..20946a3ac866631ff724377d07dde1cc9906d142 100644 GIT binary patch delta 77 zcmeyjlj++|rVY=gGI^9vemONAL&y)t W9;L+@&iQ$1lRt84Z_b=Gl?eb%Eg>=h delta 85 zcmeyilj+}1rVY=gGDjsRPJS^p9ZUyKiw4u{rab`Bn - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_id.qm b/res/silentdragon_id.qm index b8dc7f0445118ccaa58bac44e87e3a68f309b743..3cdc54da89d97215f7e7893fba7405453318794c 100644 GIT binary patch delta 77 zcmX@Plj-12rVR(DGI^9vJ~A~OMCnb71yOy|9ssG$h10niLEQQo6(H)@jA#%QF>?op WM`>|}bADdh - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_it.qm b/res/silentdragon_it.qm index 268646f608bfdfd5f47ff87f465a82888a58de37..ab3b503dadea444c423a15ab5a893456585a7892 100644 GIT binary patch delta 67 zcmbQZo2hd*(*}cSOdh3^ji<$esL9hJLDc(cH-OaUQ`2P`LEKj}DnL}~%ybZSe&!*N Jk9Tflo delta 79 zcmeC&%`|a0(*}cS%u&gSlP69Sp6oi!3(AfJ({HBT0MVO|O_yZ^3p|}s0jA?;ri1Ad NGY^3k^vwFp1OO(GA - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_nl.qm b/res/silentdragon_nl.qm index 7158058af4acf0d3998f6897b2208750b8cc9025..eda849cfc4556e8d12f510d381714edef9083a12 100644 GIT binary patch delta 87 zcmdn6i)qC!rVYQRGI^9v{x>y|&!e%{&B>%%63T2><|uBM$%o delta 89 zcmZ3ni)jN8{hrDkm7F;F@6<#voiHsJOmCg`3`B39J6)6!EU;xp3z)W=nGU8G&pgBl aR8XAZoS&CAc_Ekj - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_pt.qm b/res/silentdragon_pt.qm index acc25ca55070c11e434bee866e538c2dc764447d..71dfe1f5d81a6bafcdaf43418948cb69362035d1 100644 GIT binary patch delta 76 zcmeBQ&(yx2X@k@RCXdp|vJ;X)R5OHnIpG0_cV^;WFg2+RM7d5*2T|)MAK~yQEzWSx Q&r6&9QCM&Dswq#I0M`B?CIA2c delta 74 zcmZo)&(y!3X@k@R=BVVv$ubj?!E_^(em3C&n15p8Uod@qQW==GpPUY+S4=(vqBrMF Hkz@t{fi52B diff --git a/res/silentdragon_pt.ts b/res/silentdragon_pt.ts index 33a7b43..077afa6 100644 --- a/res/silentdragon_pt.ts +++ b/res/silentdragon_pt.ts @@ -2341,7 +2341,7 @@ Você possui fundos não confirmados ou o saldo é muito baixo para uma migraç - createZcashConf + createHushConf Configure HUSH3.conf @@ -2464,7 +2464,7 @@ Você possui fundos não confirmados ou o saldo é muito baixo para uma migraç <html><head/><body><p>ZBoard: Fully anonymous and untraceable chat messages based on the ZCash blockchain. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> - <html><head/><body><p>ZBoard: Chat de mensagens totalmente anônimas e irrastreáveis usando a blockchain da Zcash. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> + <html><head/><body><p>ZBoard: Chat de mensagens totalmente anônimas e irrastreáveis usando a blockchain da Hush. <a href="http://www.z-board.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.z-board.net/</span></a></p></body></html> Warning diff --git a/res/silentdragon_ro.qm b/res/silentdragon_ro.qm index 99b889639588bf780ff871b41ec9ff5edb9bf61c..7d3963da43b0c771304d490926abeca4acbd1341 100644 GIT binary patch delta 83 zcmdnFjcMaHrVX4^m^?}+^Gr$R^C&IOaL&(5V`OGvU{IU(DQ`gZ=Iv938NmW)rj>zdm+8e|dgt^t XoInM|8P556X_NbMH8xM3F^35N(A^^# diff --git a/res/silentdragon_ro.ts b/res/silentdragon_ro.ts index ffbdd61..01bbefd 100644 --- a/res/silentdragon_ro.ts +++ b/res/silentdragon_ro.ts @@ -2190,7 +2190,7 @@ Doriti sa vizitati pagina veriunii? - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_ru.qm b/res/silentdragon_ru.qm index 2e1a782c9a1a87876cf10a9c7732190903e4f6dc..8685ae19935d32c631fa919395faa3297039967d 100644 GIT binary patch delta 83 zcmX@qz`U!0dBd$8Odh3^@9sziQLa0q`8-OCGo17D(ioW;7#O-HFEo*!d}`-WpzP*J dyF?j5s#fi;15w(0DnZopJqJLNS$l6V0RWl#B6k1) delta 93 zcmdnhzYhr7f;|TW efeMNN-rT)+Jre*-a3u%; diff --git a/res/silentdragon_ru.ts b/res/silentdragon_ru.ts index 0757da2..b16f0c1 100644 --- a/res/silentdragon_ru.ts +++ b/res/silentdragon_ru.ts @@ -2693,7 +2693,7 @@ You either have unconfirmed funds or the balance is too low for an automatic mig - createZcashConf + createHushConf Show Advanced Configuration diff --git a/res/silentdragon_sr.qm b/res/silentdragon_sr.qm index 7bc7d8440e2c2ee6782446771cf11a65331b835e..34bdbedf8b933f022e11472e5c30b49909877645 100644 GIT binary patch delta 66 zcmaE`gXzW&rVT+;nLJ7-hfYldQ9GwbgDCN74}jF>U(=Wwf%K#q6(GUt8Mz?p^^6T5 Kxp^}WF#!OzryOPg delta 85 zcmcbygXzHzrVT+;nWK^uCx=W;1k>B6MuTaQX%9g3=5N!O8NmX-r&oaK(iyp6`pJw9 XoInM|8P556X_G&4X>UG0b0QM}8m}aB diff --git a/res/silentdragon_sr.ts b/res/silentdragon_sr.ts index 16d908e..53f5bef 100644 --- a/res/silentdragon_sr.ts +++ b/res/silentdragon_sr.ts @@ -2192,7 +2192,7 @@ Would you like to visit the releases page? - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_template.ts b/res/silentdragon_template.ts index a593740..1843608 100644 --- a/res/silentdragon_template.ts +++ b/res/silentdragon_template.ts @@ -1760,7 +1760,7 @@ Would you like to visit the releases page? - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_tr.qm b/res/silentdragon_tr.qm index 356d11215de0752997ff0df158b679ef3d0a2ee7..58f8f179f51ca10847348c0f42a01b53d8de5e6c 100644 GIT binary patch delta 77 zcmaF4mFeMDrVYuHnLJ7-r%f&gQ4c0Zf+(9QuYlBM&8e=8Aa3Eb3J~>XS}BN1nSO@D VqqI1~IX^FLa=ozH=J*+1OaKd2h;Z^M}ld~DX&2EX4R>#j9`JBX%%4l*|btH9XtID KSb_G8ZA<{cqaRfO diff --git a/res/silentdragon_tr.ts b/res/silentdragon_tr.ts index d16d024..e1b068b 100644 --- a/res/silentdragon_tr.ts +++ b/res/silentdragon_tr.ts @@ -2350,7 +2350,7 @@ Onaylanmamış fonunuz var veya otomatik geçiş için bakiye çok düşük. - createZcashConf + createHushConf Configure HUSH3.conf diff --git a/res/silentdragon_uk.qm b/res/silentdragon_uk.qm index 36b47ac11c8a3bba347b43011770ea462a7649ef..fc7102f886633a3ec5a0371f41c1cc3aa684b484 100644 GIT binary patch delta 60 zcmZ3|&NR23X@h7jlSk=fiP~fkRaYAgqVCjw0#chV*6}lfxR2|rKvY6QHAwVc!!afR D%hecZ delta 67 zcmbQ+&a|YRX@h7jb5wHTWbxW$FkMp{4W@6_ege^(&(`rXf(7o?SAprMhH9|H^@d|i E0Cig$`v3p{ diff --git a/res/silentdragon_uk.ts b/res/silentdragon_uk.ts index 94ea9cf..41d5d3d 100644 --- a/res/silentdragon_uk.ts +++ b/res/silentdragon_uk.ts @@ -2704,7 +2704,7 @@ You either have unconfirmed funds or the balance is too low for an automatic mig - createZcashConf + createHushConf Show Advanced Configuration diff --git a/res/silentdragon_zh.qm b/res/silentdragon_zh.qm index e1b5b92ce00cf90c9e3c3ca6783127f333f5e01d..c0aa8b03525d20260374e2e2914b30eb78c9d77a 100644 GIT binary patch delta 59 zcmcb(i1E}S#tqFrOdh3^+k9+6)G?n~AS&5+DTw0s^8is{e%>HziC-Cz+AQmD!UO=a Cg%xQ4 delta 76 zcmX@Li1Feg#tqFr%u&gSlUsdk!SoTISztQBcPW@=_wxYLfqvd#dY)eyCs2KHhI4*i O+T@8G@|&&w`I!J_0~@UX diff --git a/res/silentdragon_zh.ts b/res/silentdragon_zh.ts index b44de56..f606abe 100644 --- a/res/silentdragon_zh.ts +++ b/res/silentdragon_zh.ts @@ -2604,7 +2604,7 @@ You either have unconfirmed funds or the balance is too low for an automatic mig - createZcashConf + createHushConf Configure hush.conf 配置 hush.conf diff --git a/src/connection.cpp b/src/connection.cpp index 04b1bb0..1ef68c3 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -55,18 +55,18 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { } // Priority 2: Try to connect to detect HUSH3.conf and connect to it. - auto config = autoDetectZcashConf(); + auto config = autoDetectHushConf(); main->logger->write(QObject::tr("Attempting autoconnect")); if (config.get() != nullptr) { auto connection = makeConnection(config); - refreshZcashdState(connection, [=] () { + refreshHushdState(connection, [=] () { // Refused connection. So try and start embedded zcashd if (Settings::getInstance()->useEmbedded()) { if (tryEzcashdStart) { this->showInformation(QObject::tr("Starting embedded hushd")); - if (this->startEmbeddedZcashd()) { + if (this->startEmbeddedHushd()) { // Embedded hushd started up. Wait a second and then refresh the connection main->logger->write("Embedded hushd started up, trying autoconnect in 1 sec"); QTimer::singleShot(1000, [=]() { doAutoConnect(); } ); @@ -114,7 +114,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { } else { if (Settings::getInstance()->useEmbedded()) { // HUSH3.conf was not found, so create one - createZcashConf(); + createHushConf(); } else { // Fall back to manual connect doManualConnect(); @@ -142,14 +142,14 @@ QString randomPassword() { /** * This will create a new HUSH3.conf and download params if they cannot be found */ -void ConnectionLoader::createZcashConf() { - main->logger->write("createZcashConf"); +void ConnectionLoader::createHushConf() { + main->logger->write("createHushConf"); auto confLocation = zcashConfWritableLocation(); QFileInfo fi(confLocation); QDialog d(main); - Ui_createZcashConf ui; + Ui_createHushConf ui; ui.setupUi(&d); QPixmap logo(":/img/res/zcashdlogo.gif"); @@ -319,7 +319,7 @@ void ConnectionLoader::doNextDownload(std::function cb) { }); } -bool ConnectionLoader::startEmbeddedZcashd() { +bool ConnectionLoader::startEmbeddedHushd() { if (!Settings::getInstance()->useEmbedded()) return false; @@ -420,7 +420,7 @@ void ConnectionLoader::doManualConnect() { } auto connection = makeConnection(config); - refreshZcashdState(connection, [=] () { + refreshHushdState(connection, [=] () { QString explanation = QString() % QObject::tr("Could not connect to hushd configured in settings.\n\n" "Please set the host/port and user/password in the Edit->Settings menu."); @@ -433,7 +433,7 @@ void ConnectionLoader::doManualConnect() { } void ConnectionLoader::doRPCSetConnection(Connection* conn) { - rpc->setEZcashd(ehushd); + rpc->setEHushd(ehushd); rpc->setConnection(conn); d->accept(); @@ -460,7 +460,7 @@ Connection* ConnectionLoader::makeConnection(std::shared_ptr c return new Connection(main, client, request, config); } -void ConnectionLoader::refreshZcashdState(Connection* connection, std::function refused) { +void ConnectionLoader::refreshHushdState(Connection* connection, std::function refused) { main->logger->write("refreshing state"); QJsonObject payload = { @@ -503,7 +503,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection, std::function< this->showInformation(QObject::tr("Your hushd is starting up. Please wait."), status); main->logger->write("Waiting for hushd to come online."); // Refresh after one second - QTimer::singleShot(1000, [=]() { this->refreshZcashdState(connection, refused); }); + QTimer::singleShot(1000, [=]() { this->refreshHushdState(connection, refused); }); } } ); @@ -531,14 +531,14 @@ void ConnectionLoader::showInformation(QString info, QString detail) { * Show error will close the loading dialog and show an error. */ void ConnectionLoader::showError(QString explanation) { - rpc->setEZcashd(nullptr); + rpc->setEHushd(nullptr); rpc->noConnection(); QMessageBox::critical(main, QObject::tr("Connection Error"), explanation, QMessageBox::Ok); d->close(); } -QString ConnectionLoader::locateZcashConfFile() { +QString ConnectionLoader::locateHushConfFile() { #ifdef Q_OS_LINUX auto confLocation = QStandardPaths::locate(QStandardPaths::HomeLocation, ".komodo/HUSH3/HUSH3.conf"); #elif defined(Q_OS_DARWIN) @@ -634,11 +634,11 @@ bool ConnectionLoader::verifyParams() { /** * Try to automatically detect a HUSH3/HUSH3.conf file in the correct location and load parameters */ -std::shared_ptr ConnectionLoader::autoDetectZcashConf() { - auto confLocation = locateZcashConfFile(); +std::shared_ptr ConnectionLoader::autoDetectHushConf() { + auto confLocation = locateHushConfFile(); if (confLocation.isNull()) { - // No Zcash file, just return with nothing + // No file, just return with nothing return nullptr; } @@ -653,11 +653,11 @@ std::shared_ptr ConnectionLoader::autoDetectZcashConf() { auto zcashconf = new ConnectionConfig(); zcashconf->host = "127.0.0.1"; zcashconf->connType = ConnectionType::DetectedConfExternalHushD; - zcashconf->usingZcashConf = true; + zcashconf->usingHushConf = true; zcashconf->zcashDir = QFileInfo(confLocation).absoluteDir().absolutePath(); zcashconf->hushDaemon = false; - Settings::getInstance()->setUsingZcashConf(confLocation); + Settings::getInstance()->setUsingHushConf(confLocation); while (!in.atEnd()) { QString line = in.readLine(); diff --git a/src/connection.h b/src/connection.h index 743e23a..aadcf04 100644 --- a/src/connection.h +++ b/src/connection.h @@ -20,7 +20,7 @@ struct ConnectionConfig { QString port; QString rpcuser; QString rpcpassword; - bool usingZcashConf; + bool usingHushConf; bool hushDaemon; QString zcashDir; QString proxy; @@ -42,7 +42,7 @@ public: void loadConnection(); private: - std::shared_ptr autoDetectZcashConf(); + std::shared_ptr autoDetectHushConf(); std::shared_ptr loadFromSettings(); Connection* makeConnection(std::shared_ptr config); @@ -50,17 +50,17 @@ private: void doAutoConnect(bool tryEzcashdStart = true); void doManualConnect(); - void createZcashConf(); - QString locateZcashConfFile(); + void createHushConf(); + QString locateHushConfFile(); QString zcashConfWritableLocation(); QString zcashParamsDir(); bool verifyParams(); void downloadParams(std::function cb); void doNextDownload(std::function cb); - bool startEmbeddedZcashd(); + bool startEmbeddedHushd(); - void refreshZcashdState(Connection* connection, std::function refused); + void refreshHushdState(Connection* connection, std::function refused); void showError(QString explanation); void showInformation(QString info, QString detail = ""); diff --git a/src/createzcashconfdialog.ui b/src/createzcashconfdialog.ui index a73b78a..9306a67 100644 --- a/src/createzcashconfdialog.ui +++ b/src/createzcashconfdialog.ui @@ -1,7 +1,7 @@ - createZcashConf - + createHushConf + 0 @@ -179,7 +179,7 @@ buttonBox accepted() - createZcashConf + createHushConf accept() @@ -195,7 +195,7 @@ buttonBox rejected() - createZcashConf + createHushConf reject() diff --git a/src/main.cpp b/src/main.cpp index 084caae..03a22e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -222,7 +222,7 @@ public: // If there was a payment URI on the command line, pay it if (parser.positionalArguments().length() > 0) { - w->payZcashURI(parser.positionalArguments()[0]); + w->payHushURI(parser.positionalArguments()[0]); } // Listen for any secondary instances telling us about a Hush payment URI @@ -230,7 +230,7 @@ public: QString uri(msg); // We need to execute this async, otherwise the app seems to crash for some reason. - QTimer::singleShot(1, [=]() { w->payZcashURI(uri); }); + QTimer::singleShot(1, [=]() { w->payHushURI(uri); }); }); // For MacOS, we have an event filter diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 99badc5..1e1b93d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -68,7 +68,7 @@ MainWindow::MainWindow(QWidget *parent) : // Pay Hush URI QObject::connect(ui->actionPay_URI, &QAction::triggered, [=] () { - payZcashURI(); + payHushURI(); }); // Import Private Key @@ -195,7 +195,7 @@ void MainWindow::closeEvent(QCloseEvent* event) { s.sync(); // Let the RPC know to shut down any running service. - rpc->shutdownZcashd(); + rpc->shutdownHushd(); // Bubble up if (event) @@ -389,9 +389,9 @@ void MainWindow::setupSettingsModal() { settings.port->setValidator(&validator); // If values are coming from HUSH3.conf, then disable all the fields - auto zcashConfLocation = Settings::getInstance()->getZcashdConfLocation(); - if (!zcashConfLocation.isEmpty()) { - settings.confMsg->setText("Settings are being read from \n" + zcashConfLocation); + auto hushConfLocation = Settings::getInstance()->getHushdConfLocation(); + if (!hushConfLocation.isEmpty()) { + settings.confMsg->setText("Settings are being read from \n" + hushConfLocation); settings.hostname->setEnabled(false); settings.port->setEnabled(false); settings.rpcuser->setEnabled(false); @@ -450,7 +450,7 @@ void MainWindow::setupSettingsModal() { if (!isUsingTor && settings.chkTor->isChecked()) { // If "use tor" was previously unchecked and now checked - Settings::addToZcashConf(zcashConfLocation, "proxy=127.0.0.1:9050"); + Settings::addToHushConf(hushConfLocation, "proxy=127.0.0.1:9050"); rpc->getConnection()->config->proxy = "proxy=127.0.0.1:9050"; QMessageBox::information(this, tr("Enable Tor"), @@ -460,7 +460,7 @@ void MainWindow::setupSettingsModal() { if (isUsingTor && !settings.chkTor->isChecked()) { // If "use tor" was previously checked and now is unchecked - Settings::removeFromZcashConf(zcashConfLocation, "proxy"); + Settings::removeFromHushConf(hushConfLocation, "proxy"); rpc->getConnection()->config->proxy.clear(); QMessageBox::information(this, tr("Disable Tor"), @@ -468,7 +468,7 @@ void MainWindow::setupSettingsModal() { QMessageBox::Ok); } - if (zcashConfLocation.isEmpty()) { + if (hushConfLocation.isEmpty()) { // Save settings Settings::getInstance()->saveSettings( settings.hostname->text(), @@ -491,55 +491,55 @@ void MainWindow::setupSettingsModal() { bool showRestartInfo = false; bool showReindexInfo = false; if (settings.chkRescan->isChecked()) { - Settings::addToZcashConf(zcashConfLocation, "rescan=1"); + Settings::addToHushConf(hushConfLocation, "rescan=1"); showRestartInfo = true; } if (settings.chkReindex->isChecked()) { - Settings::addToZcashConf(zcashConfLocation, "reindex=1"); + Settings::addToHushConf(hushConfLocation, "reindex=1"); showRestartInfo = true; } if (!rpc->getConnection()->config->consolidation.isEmpty()==false) { if (settings.chkConso->isChecked()) { - Settings::addToZcashConf(zcashConfLocation, "consolidation=1"); + Settings::addToHushConf(hushConfLocation, "consolidation=1"); showRestartInfo = true; } } if (!rpc->getConnection()->config->consolidation.isEmpty()) { if (settings.chkConso->isChecked() == false) { - Settings::removeFromZcashConf(zcashConfLocation, "consolidation"); + Settings::removeFromHushConf(hushConfLocation, "consolidation"); showRestartInfo = true; } } if (!rpc->getConnection()->config->deletetx.isEmpty() == false) { if (settings.chkDeletetx->isChecked()) { - Settings::addToZcashConf(zcashConfLocation, "deletetx=1"); + Settings::addToHushConf(hushConfLocation, "deletetx=1"); showRestartInfo = true; } } if (!rpc->getConnection()->config->deletetx.isEmpty()) { if (settings.chkDeletetx->isChecked() == false) { - Settings::removeFromZcashConf(zcashConfLocation, "deletetx"); + Settings::removeFromHushConf(hushConfLocation, "deletetx"); showRestartInfo = true; } } if (!rpc->getConnection()->config->zindex.isEmpty() == false) { if (settings.chkzindex->isChecked()) { - Settings::addToZcashConf(zcashConfLocation, "zindex=1"); - Settings::addToZcashConf(zcashConfLocation, "reindex=1"); + Settings::addToHushConf(hushConfLocation, "zindex=1"); + Settings::addToHushConf(hushConfLocation, "reindex=1"); showReindexInfo = true; } } if (!rpc->getConnection()->config->zindex.isEmpty()) { if (settings.chkzindex->isChecked() == false) { - Settings::removeFromZcashConf(zcashConfLocation, "zindex"); - Settings::addToZcashConf(zcashConfLocation, "reindex=1"); + Settings::removeFromHushConf(hushConfLocation, "zindex"); + Settings::addToHushConf(hushConfLocation, "reindex=1"); showReindexInfo = true; } } @@ -692,7 +692,7 @@ void MainWindow::balancesReady() { // process it. if (!pendingURIPayment.isEmpty()) { qDebug() << "Paying hush URI"; - payZcashURI(pendingURIPayment); + payHushURI(pendingURIPayment); pendingURIPayment = ""; } @@ -703,7 +703,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::FileOpen) { QFileOpenEvent *fileEvent = static_cast(event); if (!fileEvent->url().isEmpty()) - payZcashURI(fileEvent->url().toString()); + payHushURI(fileEvent->url().toString()); return true; } @@ -715,7 +715,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) { // Pay the Hush URI by showing a confirmation window. If the URI parameter is empty, the UI // will prompt for one. If the myAddr is empty, then the default from address is used to send // the transaction. -void MainWindow::payZcashURI(QString uri, QString myAddr) { +void MainWindow::payHushURI(QString uri, QString myAddr) { // If the Payments UI is not ready (i.e, all balances have not loaded), defer the payment URI if (!uiPaymentsReady) { qDebug() << "Payment UI not ready, waiting for UI to pay URI"; diff --git a/src/mainwindow.h b/src/mainwindow.h index 0b033f4..afda5c6 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -55,7 +55,7 @@ public: void stopWebsocket(); void balancesReady(); - void payZcashURI(QString uri = "", QString myAddr = ""); + void payHushURI(QString uri = "", QString myAddr = ""); void validateAddress(); diff --git a/src/requestdialog.cpp b/src/requestdialog.cpp index 70a20f1..62d5eca 100644 --- a/src/requestdialog.cpp +++ b/src/requestdialog.cpp @@ -82,7 +82,7 @@ void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI req.lblHeader->setText(tr("You are paying a payment request. Your address will not be visible to the person requesting this payment.")); if (d.exec() == QDialog::Accepted) { - main->payZcashURI(paymentURI, req.cmbMyAddress->currentText()); + main->payHushURI(paymentURI, req.cmbMyAddress->currentText()); } } @@ -136,6 +136,6 @@ void RequestDialog::showRequestZcash(MainWindow* main) { // If the disclosed address in the memo doesn't have a balance, it will automatically fallback to the default // sapling address - main->payZcashURI(sendURI, req.cmbMyAddress->currentText()); + main->payHushURI(sendURI, req.cmbMyAddress->currentText()); } } diff --git a/src/rpc.cpp b/src/rpc.cpp index 62921cd..2ddd44f 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -68,7 +68,7 @@ RPC::~RPC() { delete conn; } -void RPC::setEZcashd(std::shared_ptr p) { +void RPC::setEHushd(std::shared_ptr p) { ehushd = p; if (ehushd && ui->tabWidget->widget(4) == nullptr) { @@ -86,9 +86,9 @@ void RPC::setConnection(Connection* c) { ui->statusBar->showMessage("Ready! Thank you for helping secure the Hush network by running a full node."); // See if we need to remove the reindex/rescan flags from the zcash.conf file - auto zcashConfLocation = Settings::getInstance()->getZcashdConfLocation(); - Settings::removeFromZcashConf(zcashConfLocation, "rescan"); - Settings::removeFromZcashConf(zcashConfLocation, "reindex"); + auto hushConfLocation = Settings::getInstance()->getHushdConfLocation(); + Settings::removeFromHushConf(hushConfLocation, "rescan"); + Settings::removeFromHushConf(hushConfLocation, "reindex"); // Refresh the UI refreshPrice(); @@ -579,7 +579,7 @@ void RPC::getInfoThenRefresh(bool force) { // Fuck The KYC Traitor named jl777 //QString kmdver = reply["KMDversion"].toString(); - Settings::getInstance()->setZcashdVersion(version); + Settings::getInstance()->setHushdVersion(version); ui->longestchain->setText(QString::number(longestchain)); ui->notarizedhashvalue->setText( ntzhash ); @@ -708,7 +708,7 @@ void RPC::getInfoThenRefresh(bool force) { else { tooltip = QObject::tr("hushd has no peer connections! Network issues?"); } - tooltip = tooltip % "(v" % QString::number(Settings::getInstance()->getZcashdVersion()) % ")"; + tooltip = tooltip % "(v" % QString::number(Settings::getInstance()->getHushdVersion()) % ")"; if (!hushPrice.isEmpty()) { tooltip = "1 HUSH = " % hushPrice % "\n" % tooltip; @@ -1210,7 +1210,7 @@ void RPC::refreshPrice() { }); } -void RPC::shutdownZcashd() { +void RPC::shutdownHushd() { // Shutdown embedded hushd if it was started if (ehushd == nullptr || ehushd->processId() == 0 || conn == nullptr) { // No hushd running internally, just return diff --git a/src/rpc.h b/src/rpc.h index f420dd0..06c1ae8 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -38,7 +38,7 @@ public: ~RPC(); void setConnection(Connection* c); - void setEZcashd(std::shared_ptr p); + void setEHushd(std::shared_ptr p); const QProcess* getEHushD() { return ehushd.get(); } void refresh(bool force = false); @@ -78,7 +78,7 @@ public: void importTPrivKey(QString addr, bool rescan, const std::function& cb); void validateAddress(QString address, const std::function& cb); - void shutdownZcashd(); + void shutdownHushd(); void noConnection(); bool isEmbedded() { return ehushd != nullptr; } diff --git a/src/settings.cpp b/src/settings.cpp index 5df9428..cfad6af 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -89,7 +89,7 @@ void Settings::saveRestoreTableHeader(QTableView* table, QDialog* d, QString tab }); } -void Settings::setUsingZcashConf(QString confLocation) { +void Settings::setUsingHushConf(QString confLocation) { if (!confLocation.isEmpty()) _confLocation = confLocation; } @@ -131,11 +131,11 @@ bool Settings::isTAddress(QString addr) { return addr.startsWith("R"); } -int Settings::getZcashdVersion() { +int Settings::getHushdVersion() { return _zcashdVersion; } -void Settings::setZcashdVersion(int version) { +void Settings::setHushdVersion(int version) { _zcashdVersion = version; } @@ -329,7 +329,7 @@ QString Settings::getDonationAddr() { return "zs1aq4xnrkjlnxx0zesqye7jz3dfrf3rjh7q5z6u8l6mwyqqaam3gx3j2fkqakp33v93yavq46j83q"; } -bool Settings::addToZcashConf(QString confLocation, QString line) { +bool Settings::addToHushConf(QString confLocation, QString line) { QFile file(confLocation); if (!file.open(QIODevice::ReadWrite | QIODevice::Append)) return false; @@ -352,7 +352,7 @@ void Settings::set_currency_name(QString currency_name) { } -bool Settings::removeFromZcashConf(QString confLocation, QString option) { +bool Settings::removeFromHushConf(QString confLocation, QString option) { if (confLocation.isEmpty()) return false; diff --git a/src/settings.h b/src/settings.h index 5aba2e2..16d9ca4 100644 --- a/src/settings.h +++ b/src/settings.h @@ -54,8 +54,8 @@ public: bool isSyncing(); void setSyncing(bool syncing); - int getZcashdVersion(); - void setZcashdVersion(int version); + int getHushdVersion(); + void setHushdVersion(int version); void setUseEmbedded(bool r) { _useEmbedded = r; } bool useEmbedded() { return _useEmbedded; } @@ -89,8 +89,8 @@ public: QString get_currency_name(); void set_currency_name(QString currency_name); - void setUsingZcashConf(QString confLocation); - const QString& getZcashdConfLocation() { return _confLocation; } + void setUsingHushConf(QString confLocation); + const QString& getHushdConfLocation() { return _confLocation; } void setHUSHPrice(double p) { hushPrice = p; } void set_fiat_price(double p) { fiat_price = p; } @@ -136,8 +136,8 @@ public: static bool isValidAddress(QString addr); - static bool addToZcashConf(QString confLocation, QString line); - static bool removeFromZcashConf(QString confLocation, QString option); + static bool addToHushConf(QString confLocation, QString line); + static bool removeFromHushConf(QString confLocation, QString option); static const QString labelRegExp;