Browse Source

Merge pull request #2 from MyHush/denio

pull
pull/54/head
Denio 5 years ago
committed by GitHub
parent
commit
25317b753d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      application.qrc
  2. 6
      lib/Cargo.lock
  3. 2
      lib/Cargo.toml
  4. 1614
      res/SilentDragonLite.xpm
  5. BIN
      res/logo.icns
  6. 0
      res/silentdragonlite_de.qm
  7. 0
      res/silentdragonlite_de.ts
  8. 0
      res/silentdragonlite_es.qm
  9. 0
      res/silentdragonlite_es.ts
  10. 0
      res/silentdragonlite_fr.qm
  11. 0
      res/silentdragonlite_fr.ts
  12. 0
      res/silentdragonlite_hr.qm
  13. 0
      res/silentdragonlite_hr.ts
  14. 0
      res/silentdragonlite_it.qm
  15. 0
      res/silentdragonlite_it.ts
  16. 0
      res/silentdragonlite_pot.ts
  17. 0
      res/silentdragonlite_pt.qm
  18. 0
      res/silentdragonlite_pt.ts
  19. 0
      res/silentdragonlite_sr.qm
  20. 0
      res/silentdragonlite_sr.ts
  21. 0
      res/silentdragonlite_template.qm
  22. 0
      res/silentdragonlite_template.ts
  23. 0
      res/silentdragonlite_tr.qm
  24. 0
      res/silentdragonlite_tr.ts
  25. 0
      res/silentdragonlite_zh.qm
  26. 0
      res/silentdragonlite_zh.ts
  27. 18
      silentdragon-lite.pro
  28. 243
      src/controller.cpp
  29. 22
      src/controller.h
  30. 111
      src/createhushconfdialog.ui
  31. 10
      src/mainwindow.cpp
  32. 438
      src/mainwindow.ui
  33. 0
      src/scripts/SilentDragonLite.wxs
  34. 2
      src/scripts/control
  35. 8
      src/scripts/desktopentry
  36. 4
      src/scripts/dotranslations.sh
  37. 6
      src/scripts/mkmacdmg.sh
  38. 58
      src/scripts/mkrelease.sh
  39. 2
      src/scripts/signbinaries.sh
  40. 105
      src/settings.cpp
  41. 67
      src/settings.h
  42. 2
      src/txtablemodel.cpp
  43. 2
      src/version.h

12
application.qrc

@ -13,12 +13,12 @@
<file>res/logobig.gif</file>
</qresource>
<qresource prefix="/translations">
<file>res/zec_qt_wallet_de.qm</file>
<file>res/zec_qt_wallet_es.qm</file>
<file>res/zec_qt_wallet_fr.qm</file>
<file>res/zec_qt_wallet_pt.qm</file>
<file>res/zec_qt_wallet_it.qm</file>
<file>res/zec_qt_wallet_hr.qm</file>
<file>res/silentdragonlite_de.qm</file>
<file>res/silentdragonlite_es.qm</file>
<file>res/silentdragonlite_fr.qm</file>
<file>res/silentdragonlite_pt.qm</file>
<file>res/silentdragonlite_it.qm</file>
<file>res/silentdragonlite_hr.qm</file>
</qresource>
<qresource prefix="/css">
<file>res/css/blue.css</file>

6
lib/Cargo.lock

@ -1051,7 +1051,7 @@ version = "0.1.0"
dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=ce987b373505c19784f6482fd900fa1bb988cbce)",
"silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=ded8a41fa886a3bfb6e0cefd69c3aedac2abd2a4)",
]
[[package]]
@ -1467,7 +1467,7 @@ dependencies = [
[[package]]
name = "silentdragonlitelib"
version = "0.1.0"
source = "git+https://github.com/MyHush/silentdragonlite-cli?rev=ce987b373505c19784f6482fd900fa1bb988cbce#ce987b373505c19784f6482fd900fa1bb988cbce"
source = "git+https://github.com/MyHush/silentdragonlite-cli?rev=ded8a41fa886a3bfb6e0cefd69c3aedac2abd2a4#ded8a41fa886a3bfb6e0cefd69c3aedac2abd2a4"
dependencies = [
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bellman 0.1.0 (git+https://github.com/DenioD/librustzcash.git?rev=caaee693c47c2ee9ecd1e1546b8fe3c714f342bc)",
@ -2481,7 +2481,7 @@ dependencies = [
"checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2"
"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d"
"checksum silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=ce987b373505c19784f6482fd900fa1bb988cbce)" = "<none>"
"checksum silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=ded8a41fa886a3bfb6e0cefd69c3aedac2abd2a4)" = "<none>"
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
"checksum sodiumoxide 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585232e78a4fc18133eef9946d3080befdf68b906c51b621531c37e91787fa2b"

2
lib/Cargo.toml

@ -11,4 +11,4 @@ crate-type = ["staticlib"]
[dependencies]
libc = "0.2.58"
lazy_static = "1.4.0"
silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "ce987b373505c19784f6482fd900fa1bb988cbce" }
silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "ded8a41fa886a3bfb6e0cefd69c3aedac2abd2a4" }

1614
res/SilentDragonLite.xpm

File diff suppressed because it is too large

BIN
res/logo.icns

Binary file not shown.

0
res/zec_qt_wallet_de.qm → res/silentdragonlite_de.qm

0
res/zec_qt_wallet_de.ts → res/silentdragonlite_de.ts

0
res/zec_qt_wallet_es.qm → res/silentdragonlite_es.qm

0
res/zec_qt_wallet_es.ts → res/silentdragonlite_es.ts

0
res/zec_qt_wallet_fr.qm → res/silentdragonlite_fr.qm

0
res/zec_qt_wallet_fr.ts → res/silentdragonlite_fr.ts

0
res/zec_qt_wallet_hr.qm → res/silentdragonlite_hr.qm

0
res/zec_qt_wallet_hr.ts → res/silentdragonlite_hr.ts

0
res/zec_qt_wallet_it.qm → res/silentdragonlite_it.qm

0
res/zec_qt_wallet_it.ts → res/silentdragonlite_it.ts

0
res/zec_qt_wallet_pot.ts → res/silentdragonlite_pot.ts

0
res/zec_qt_wallet_pt.qm → res/silentdragonlite_pt.qm

0
res/zec_qt_wallet_pt.ts → res/silentdragonlite_pt.ts

0
res/zec_qt_wallet_sr.qm → res/silentdragonlite_sr.qm

0
res/zec_qt_wallet_sr.ts → res/silentdragonlite_sr.ts

0
res/zec_qt_wallet_template.qm → res/silentdragonlite_template.qm

0
res/zec_qt_wallet_template.ts → res/silentdragonlite_template.ts

0
res/zec_qt_wallet_tr.qm → res/silentdragonlite_tr.qm

0
res/zec_qt_wallet_tr.ts → res/silentdragonlite_tr.ts

0
res/zec_qt_wallet_zh.qm → res/silentdragonlite_zh.qm

0
res/zec_qt_wallet_zh.ts → res/silentdragonlite_zh.ts

18
silentdragon-lite.pro

@ -116,15 +116,15 @@ FORMS += \
src/recurringmultiple.ui
TRANSLATIONS = res/zec_qt_wallet_es.ts \
res/zec_qt_wallet_fr.ts \
res/zec_qt_wallet_de.ts \
res/zec_qt_wallet_pt.ts \
res/zec_qt_wallet_it.ts \
res/zec_qt_wallet_zh.ts \
res/zec_qt_wallet_hr.ts \
res/zec_qt_wallet_sr.ts \
res/zec_qt_wallet_tr.ts
TRANSLATIONS = res/silentdragonlite_es.ts \
res/silentdragonlite_fr.ts \
res/silentdragonlite_de.ts \
res/silentdragonlite_pt.ts \
res/silentdragonlite_it.ts \
res/silentdragonlite_zh.ts \
res/silentdragonlite_hr.ts \
res/silentdragonlite_sr.ts \
res/silentdragonlite_tr.ts
include(singleapplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication

243
src/controller.cpp

@ -162,11 +162,22 @@ void Controller::getInfoThenRefresh(bool force) {
prevCallSucceeded = true;
int curBlock = reply["latest_block_height"].get<json::number_integer_t>();
int longestchain = reply["longestchain"].get<json::number_integer_t>();
int notarized = reply["notarized"].get<json::number_integer_t>();
int difficulty = reply["difficulty"].get<json::number_integer_t>();
int blocks_until_halving= 340000 - curBlock;
char halving_days[8];
sprintf(halving_days, "%.2f", (double) (blocks_until_halving * 150) / (60*60*24) );
bool doUpdate = force || (model->getLatestBlock() != curBlock);
model->setLatestBlock(curBlock);
ui->blockHeight->setText(QString::number(curBlock));
ui->last_notarized->setText(QString::number(notarized));
ui->longestchain->setText(QString::number(longestchain));
ui->difficulty->setText(QString::number(difficulty));
ui->halvingTime->setText( QString::number(blocks_until_halving) % " blocks, " % QString::fromStdString(halving_days) % " days" );
ui->Version->setText(QString::fromStdString(reply["version"].get<json::string_t>()));
ui->Vendor->setText(QString::fromStdString(reply["vendor"].get<json::string_t>()));
ui->volumeExchange->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCVolume() ,'f',8));
main->logger->write(QString("Refresh. curblock ") % QString::number(curBlock) % ", update=" % (doUpdate ? "true" : "false") );
@ -181,29 +192,53 @@ void Controller::getInfoThenRefresh(bool force) {
if (Settings::getInstance()->get_currency_name() == "USD") {
main->statusLabel->setText(" HUSH/USD=$ " + QString::number( (double) Settings::getInstance()->getZECPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
main->statusLabel->setText(" HUSH/EUR=€ " + QString::number( (double) Settings::getInstance()->getEURPrice() ,'f',2));
main->statusLabel->setText(" HUSH/EUR= " + QString::number( (double) Settings::getInstance()->getEURPrice() ,'f',2) + "");
ui->volumeExchange->setText(QString::number((double) Settings::getInstance()->getEURVolume() ,'f',2) + "");
ui->marketcapTab->setText(QString::number((double) Settings::getInstance()->getEURCAP() ,'f',2)+ "");
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
main->statusLabel->setText(" HUSH/BTC=BTC " + QString::number((double) Settings::getInstance()->getBTCPrice() ,'f',8));
ui->volumeExchange->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCVolume() ,'f',8));
ui->marketcapTab->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCCAP() ,'f',8));
} else if (Settings::getInstance()->get_currency_name() == "CNY") {
main->statusLabel->setText(" HUSH/CNY=¥ /元 " + QString::number( (double) Settings::getInstance()->getCNYPrice() ,'f',2));
ui->volumeExchange->setText(" ¥ /元 " + QString::number((double) Settings::getInstance()->getCNYVolume() ,'f',2));
ui->marketcapTab->setText(" ¥ /元 " + QString::number((double) Settings::getInstance()->getCNYCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "RUB") {
main->statusLabel->setText(" HUSH/RUB=₽ " + QString::number((double) Settings::getInstance()->getRUBPrice() ,'f',2));
ui->volumeExchange->setText("" + QString::number((double) Settings::getInstance()->getRUBVolume() ,'f',2));
ui->marketcapTab->setText("" + QString::number((double) Settings::getInstance()->getRUBCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "CAD") {
main->statusLabel->setText(" HUSH/CAD=$ " + QString::number( (double) Settings::getInstance()->getCADPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getCADVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getCADCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "SGD") {
main->statusLabel->setText(" HUSH/SGD=$ " + QString::number((double) Settings::getInstance()->getSGDPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getSGDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getSGDCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "CHF") {
main->statusLabel->setText(" HUSH/CHF=CHF " + QString::number((double) Settings::getInstance()->getCHFPrice() ,'f',2));
ui->volumeExchange->setText(" CHF " + QString::number((double) Settings::getInstance()->getCHFVolume() ,'f',2));
ui->marketcapTab->setText(" CHF " + QString::number((double) Settings::getInstance()->getCHFCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "INR") {
main->statusLabel->setText(" HUSH/INR=₹ " + QString::number( (double) Settings::getInstance()->getINRPrice() ,'f',2));
ui->volumeExchange->setText("" + QString::number((double) Settings::getInstance()->getINRVolume() ,'f',2));
ui->marketcapTab->setText("" + QString::number((double) Settings::getInstance()->getINRCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "GBP") {
main->statusLabel->setText(" HUSH/GBP=£ " + QString::number((double) Settings::getInstance()->getGBPPrice() ,'f',2));
ui->volumeExchange->setText(" £ " + QString::number((double) Settings::getInstance()->getGBPVolume() ,'f',2));
ui->marketcapTab->setText(" £ " + QString::number((double) Settings::getInstance()->getRUBCAP() ,'f',2));
}else if (Settings::getInstance()->get_currency_name() == "AUD") {
main->statusLabel->setText(" HUSH/AUD=$ " + QString::number((double) Settings::getInstance()->getAUDPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getAUDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getAUDCAP() ,'f',2));
} else {
main->statusLabel->setText(" HUSH/USD=$" + QString::number(Settings::getInstance()->getZECPrice(),'f',2 ));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDCAP() ,'f',2));
}
main->statusLabel->setToolTip(tooltip);
main->statusIcon->setPixmap(i.pixmap(16, 16));
@ -336,6 +371,7 @@ void Controller::updateUIBalances() {
ui->balVerified ->setToolTip(balVerified.toDecimalEURString());
ui->balTransparent->setToolTip(balT.toDecimalEURString());
ui->balTotal ->setToolTip(balTotal.toDecimalEURString());
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
ui->balSheilded ->setToolTip(balZ.toDecimalBTCString());
@ -658,7 +694,7 @@ void Controller::checkForUpdate(bool silent) {
if (!zrpc->haveConnection())
return noConnection();
QUrl cmcURL("https://api.github.com/repos/DenioD/SilentDragonLite/releases");
QUrl cmcURL("https://api.github.com/repos/MyHush/SilentDragonLite/releases");
QNetworkRequest req;
req.setUrl(cmcURL);
@ -706,7 +742,7 @@ void Controller::checkForUpdate(bool silent) {
.arg(currentVersion.toString()),
QMessageBox::Yes, QMessageBox::Cancel);
if (ans == QMessageBox::Yes) {
QDesktopServices::openUrl(QUrl("https://github.com/DenioD/SilentDragonLite/releases"));
QDesktopServices::openUrl(QUrl("https://github.com/MyHush/SilentDragonLite/releases"));
} else {
// If the user selects cancel, don't bother them again for this version
s.setValue("update/lastversion", maxVersion.toString());
@ -764,6 +800,28 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
return;
}
@ -784,6 +842,28 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
return;
}
@ -857,8 +937,138 @@ void Controller::refreshZECPrice() {
qDebug() << "HUSH = AUD" << QString::number((double)hush["aud"]);
Settings::getInstance()->setAUDPrice( hush["aud"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = usd_24h_vol" << QString::number((double)hush["usd_24h_vol"]);
Settings::getInstance()->setUSDVolume( hush["usd_24h_vol"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = euro_24h_vol" << QString::number((double)hush["eur_24h_vol"]);
Settings::getInstance()->setEURVolume( hush["eur_24h_vol"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = btc_24h_vol" << QString::number((double)hush["btc_24h_vol"]);
Settings::getInstance()->setBTCVolume( hush["btc_24h_vol"]);
}
if (hush["cny_24h_vol"] >= 0)
{
qDebug() << "HUSH = cny_24h_vol" << QString::number((double)hush["cny_24h_vol"]);
Settings::getInstance()->setCNYVolume( hush["cny_24h_vol"]);
}
if (hush["rub_24h_vol"] >= 0)
{
qDebug() << "HUSH = rub_24h_vol" << QString::number((double)hush["rub_24h_vol"]);
Settings::getInstance()->setRUBVolume( hush["rub_24h_vol"]);
}
if (hush["cad_24h_vol"] >= 0)
{
qDebug() << "HUSH = cad_24h_vol" << QString::number((double)hush["cad_24h_vol"]);
Settings::getInstance()->setCADVolume( hush["cad_24h_vol"]);
}
if (hush["sgd_24h_vol"] >= 0)
{
qDebug() << "HUSH = sgd_24h_vol" << QString::number((double)hush["sgd_24h_vol"]);
Settings::getInstance()->setSGDVolume( hush["sgd_24h_vol"]);
}
if (hush["chf_24h_vol"] >= 0)
{
qDebug() << "HUSH = chf_24h_vol" << QString::number((double)hush["chf_24h_vol"]);
Settings::getInstance()->setCHFVolume( hush["chf_24h_vol"]);
}
if (hush["inr_24h_vol"] >= 0)
{
qDebug() << "HUSH = inr_24h_vol" << QString::number((double)hush["inr_24h_vol"]);
Settings::getInstance()->setINRVolume( hush["inr_24h_vol"]);
}
if (hush["gbp_24h_vol"] >= 0)
{
qDebug() << "HUSH = gbp_24h_vol" << QString::number((double)hush["gbp_24h_vol"]);
Settings::getInstance()->setGBPVolume( hush["gbp_24h_vol"]);
}
if (hush["aud_24h_vol"] >= 0)
{
qDebug() << "HUSH = aud_24h_vol" << QString::number((double)hush["aud_24h_vol"]);
Settings::getInstance()->setAUDVolume( hush["aud_24h_vol"]);
}
if (hush["usd_market_cap"] >= 0)
{
qDebug() << "HUSH = usd_market_cap" << QString::number((double)hush["usd_market_cap"]);
Settings::getInstance()->setUSDCAP( hush["usd_market_cap"]);
}
if (hush["eur_market_cap"] >= 0)
{
qDebug() << "HUSH = eur_market_cap" << QString::number((double)hush["eur_market_cap"]);
Settings::getInstance()->setEURCAP( hush["eur_market_cap"]);
}
if (hush["btc_market_cap"] >= 0)
{
qDebug() << "HUSH = btc_market_cap" << QString::number((double)hush["btc_market_cap"]);
Settings::getInstance()->setBTCCAP( hush["btc_market_cap"]);
}
if (hush["cny_market_cap"] >= 0)
{
qDebug() << "HUSH = cny_market_cap" << QString::number((double)hush["cny_market_cap"]);
Settings::getInstance()->setCNYCAP( hush["cny_market_cap"]);
}
if (hush["rub_market_cap"] >= 0)
{
qDebug() << "HUSH = rub_market_cap" << QString::number((double)hush["rub_market_cap"]);
Settings::getInstance()->setRUBCAP( hush["rub_market_cap"]);
}
if (hush["cad_market_cap"] >= 0)
{
qDebug() << "HUSH = cad_market_cap" << QString::number((double)hush["cad_market_cap"]);
Settings::getInstance()->setCADCAP( hush["cad_market_cap"]);
}
if (hush["sgd_market_cap"] >= 0)
{
qDebug() << "HUSH = sgd_market_cap" << QString::number((double)hush["sgd_market_cap"]);
Settings::getInstance()->setSGDCAP( hush["sgd_market_cap"]);
}
if (hush["chf_market_cap"] >= 0)
{
qDebug() << "HUSH = chf_market_cap" << QString::number((double)hush["chf_market_cap"]);
Settings::getInstance()->setCHFCAP( hush["chf_market_cap"]);
}
if (hush["inr_market_cap"] >= 0)
{
qDebug() << "HUSH = inr_market_cap" << QString::number((double)hush["inr_market_cap"]);
Settings::getInstance()->setINRCAP( hush["inr_market_cap"]);
}
if (hush["gbp_market_cap"] >= 0)
{
qDebug() << "HUSH = gbp_market_cap" << QString::number((double)hush["gbp_market_cap"]);
Settings::getInstance()->setGBPCAP( hush["gbp_market_cap"]);
}
if (hush["aud_market_cap"] >= 0)
{
qDebug() << "HUSH = aud_market_cap" << QString::number((double)hush["aud_market_cap"]);
Settings::getInstance()->setAUDCAP( hush["aud_market_cap"]);
}
return;
} catch (const std::exception& e) {
// If anything at all goes wrong, just set the price to 0 and move on.
@ -877,6 +1087,29 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
});
}

22
src/controller.h

@ -47,6 +47,28 @@ public:
void refreshINRPrice();
void refreshGBPPrice();
void refreshAUDPrice();
void refreshUSDVolume();
void refreshEURVolume();
void refreshBTCVolume();
void refreshCNYVolume();
void refreshRUBVolume();
void refreshCADVolume();
void refreshSGDVolume();
void refreshCHFVolume();
void refreshINRVolume();
void refreshGBPVolume();
void refreshAUDVolume();
void refreshUSDCAP();
void refreshEURCAP();
void refreshBTCCAP();
void refreshCNYCAP();
void refreshRUBCAP();
void refreshCADCAP();
void refreshSGDCAP();
void refreshCHFCAP();
void refreshINRCAP();
void refreshGBPCAP();
void refreshAUDCAP();
void executeStandardUITransaction(Tx tx);

111
src/createhushconfdialog.ui

@ -7,34 +7,14 @@
<x>0</x>
<y>0</y>
<width>596</width>
<height>352</height>
<height>471</height>
</rect>
</property>
<property name="windowTitle">
<string>Configure hush.conf</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Your hush node will be configured for you automatically</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="chkFastSync">
<property name="text">
<string>Enable Fast Sync</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="btnAdvancedConfig">
@ -61,39 +41,7 @@
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="FilledIconLabel" name="lblTopIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background: #fff;</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="5" column="1">
<widget class="QGroupBox" name="grpAdvanced">
<property name="title">
<string/>
@ -192,34 +140,57 @@
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="Line" name="line">
<item row="2" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Your hush node will be configured for you automatically</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skips the most expensive checks during the initial block download. &lt;a href=&quot;https://docs.silentdragon.co/using-silentdragon/#fastsync&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Learn More&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<item row="0" column="1">
<widget class="FilledIconLabel" name="lblTopIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<property name="styleSheet">
<string notr="true">background: #fff;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<property name="text">
<string notr="true"/>
</property>
<property name="openExternalLinks">
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</widget>
</item>
<item row="7" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Line" name="line_2">
<item row="1" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>

10
src/mainwindow.cpp

@ -59,7 +59,7 @@ MainWindow::MainWindow(QWidget *parent) :
// File a bug
QObject::connect(ui->actionFile_a_bug, &QAction::triggered, [=]() {
QDesktopServices::openUrl(QUrl("https://github.com/DenioD/SilentDragonLite/issues/new"));
QDesktopServices::openUrl(QUrl("https://github.com/MyHush/SilentDragonLite/issues/new"));
});
// Set up check for updates action
@ -458,7 +458,7 @@ void MainWindow::setupSettingsModal() {
// List of default servers
settings.cmbServer->addItem("https://hush-lightwallet.de:443");
settings.cmbServer->addItem("https://hush-lightwallet.de:443");
settings.cmbServer->addItem("https://lite.myhush.org:443");
// Load current values into the dialog
auto conf = Settings::getInstance()->getSettings();
@ -529,7 +529,7 @@ void MainWindow::donate() {
ui->Amount1->setText("0.00");
ui->MemoTxt1->setText(tr("Some feedback about SilentDragonlite or Hush..."));
ui->statusBar->showMessage(tr("Send Duke some private and shielded feedback about") % Settings::getTokenName() % tr(" or SilentDragonLite"));
ui->statusBar->showMessage(tr("Send DenioD some private and shielded feedback about") % Settings::getTokenName() % tr(" or SilentDragonLite"));
// And switch to the send tab.
ui->tabWidget->setCurrentIndex(1);
@ -886,6 +886,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
}
@ -934,6 +935,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
menu.addAction(tr("View Memo"), [=] () {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
});
@ -1168,7 +1170,7 @@ void MainWindow::setupReceiveTab() {
} else if (Settings::getInstance()->get_currency_name() == "AUD") {
ui->rcvBal->setText(rpc->getModel()->getAllBalances().value(addr).toDecimalhushAUDString());
}
ui->txtReceive->setPlainText(addr);
ui->qrcodeDisplay->setQrcodeString(addr);
if (rpc->getModel()->getUsedAddresses().value(addr, false)) {

438
src/mainwindow.ui

@ -22,7 +22,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>4</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -399,8 +399,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1162</width>
<height>344</height>
<width>1226</width>
<height>504</height>
</rect>
</property>
<layout class="QVBoxLayout" name="sendToLayout">
@ -950,138 +950,305 @@
<attribute name="title">
<string>Hush Daemon</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="FilledIconLabel" name="hushdlogo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="5" column="0" colspan="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>This is a Lightwallet, you cant mine with it!</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>blockHeight</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="Version">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
<widget class="FilledIconLabel" name="hushdlogo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Blockchain Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>BlockHeight</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="Version">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Next Halving</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="halvingTime">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Last Notarized Block</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="last_notarized">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Longestchain</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="longestchain">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Difficulty</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="difficulty">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<widget class="QLabel" name="label_24">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Market Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Market Cap</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="13" column="2">
<widget class="QLabel" name="marketcapTab">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Volume on Exchanges</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="14" column="2">
<widget class="QLabel" name="volumeExchange">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="15" column="0" colspan="3">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="16" column="0" colspan="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>This is a Lightwallet, you cant mine with it!</string>
</property>
</widget>
</item>
<item row="17" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
@ -1095,7 +1262,7 @@
<x>0</x>
<y>0</y>
<width>1274</width>
<height>39</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -1272,7 +1439,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>Address1</tabstop>
<tabstop>Amount1</tabstop>
<tabstop>Max1</tabstop>

0
src/scripts/zec-qt-wallet.wxs → src/scripts/SilentDragonLite.wxs

2
src/scripts/control

@ -1,4 +1,4 @@
Package: silentdragonlite
Package: SilentDragonLite
Version: RELEASE_VERSION
Section: base
Priority: optional

8
src/scripts/desktopentry

@ -2,12 +2,12 @@
Name=SilentDragonLite
Comment=Lightclient UI wallet for Hush
GenericName=Wallet
Exec=/usr/local/bin/silentdragonlite %u
Icon=silentdragonlite.xpm
Exec=/usr/local/bin/SilentDragonLite %u
Icon=SilentDragonLite.xpm
Type=Application
StartupNotify=true
StartupWMClass=silentdragonlite
StartupWMClass=SilentDragonLite
Categories=Utility;
MimeType=x-scheme-handler/hush;
Keywords=silentdragonlite;
Keywords=SilentDragonLite;

4
src/scripts/dotranslations.sh

@ -11,7 +11,7 @@ $QT_STATIC/bin/lrelease silentdragon-lite.pro
# Then update the qt base translations. First, get all languages
ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do
if [ -f $QT_STATIC/translations/qtbase_$language.qm ]; then
$QT_STATIC/bin/lconvert -o res/hush_$language.qm $QT_STATIC/translations/qtbase_$language.qm res/zec_qt_wallet_$language.qm
mv res/hush_$language.qm res/zec_qt_wallet_$language.qm
$QT_STATIC/bin/lconvert -o res/silentdragonlite_$language.qm $QT_STATIC/translations/qtbase_$language.qm res/silentdragonlite_$language.qm
mv res/silentdragonlite_$language.qm res/silentdragonlite_$language.qm
fi
done

6
src/scripts/mkmacdmg.sh

@ -55,7 +55,7 @@ export PATH=$PATH:/usr/local/bin
#Clean
echo -n "Cleaning..............."
make distclean >/dev/null 2>&1
rm -f artifacts/macOS-silentdragonlite-v$APP_VERSION.dmg
rm -f artifacts/macOS-SilentDragonLite-v$APP_VERSION.dmg
echo "[OK]"
@ -73,7 +73,7 @@ echo "[OK]"
#Qt deploy
echo -n "Deploying.............."
mkdir artifacts >/dev/null 2>&1
rm -f artifcats/Silentdragonlite.dmg >/dev/null 2>&1
rm -f artifcats/SilentDragonLite.dmg >/dev/null 2>&1
rm -f artifacts/rw* >/dev/null 2>&1
$QT_PATH/bin/macdeployqt SilentDragonLite.app
codesign --deep --force --verify --verbose -s "$CERTIFICATE" --options runtime --timestamp SilentDragonLite.app/
@ -81,7 +81,7 @@ echo "[OK]"
echo -n "Building dmg..........."
mv silentdragonlite.app Silentdragonlite.app
mv SilentDragonLite.app SilentDragonLite.app
create-dmg --volname "SilentDragonLite-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "SilentDragonLite.app" 200 190 --app-drop-link 600 185 --hide-extension "SilentDragonLite.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-SilentDragonLite-v$APP_VERSION.dmg SilentDragonLite.app >/dev/null 2>&1
if [ ! -f artifacts/macOS-SilentDragonLite-v$APP_VERSION.dmg ]; then

58
src/scripts/mkrelease.sh

@ -31,7 +31,7 @@ echo "[OK]"
echo -n "Building..............."
rm -rf bin/silentdragonlite* > /dev/null
rm -rf bin/SilentDragonLite* > /dev/null
# Build the lib first
cd lib && make release && cd ..
make -j$(nproc) > /dev/null
@ -40,7 +40,7 @@ echo "[OK]"
# Test for Qt
echo -n "Static link............"
if [[ $(ldd silentdragonlite | grep -i "Qt") ]]; then
if [[ $(ldd SilentDragonLite | grep -i "Qt") ]]; then
echo "FOUND QT; ABORT";
exit 1
fi
@ -48,25 +48,25 @@ echo "[OK]"
echo -n "Packaging.............."
mkdir bin/silentdragonlite-v$APP_VERSION > /dev/null
strip silentdragonlite
mkdir bin/SilentDragonLite-v$APP_VERSION > /dev/null
strip SilentDragonLite
cp silentdragonlite bin/silentdragonlite-v$APP_VERSION > /dev/null
cp README.md bin/silentdragonlite-v$APP_VERSION > /dev/null
cp LICENSE bin/silentdragonlite-v$APP_VERSION > /dev/null
cp SilentDragonLite bin/SilentDragonLite-v$APP_VERSION > /dev/null
cp README.md bin/SilentDragonLite-v$APP_VERSION > /dev/null
cp LICENSE bin/SilentDragonLite-v$APP_VERSION > /dev/null
cd bin && tar czf linux-silentdragonlite-v$APP_VERSION.tar.gz silentdragonlite-v$APP_VERSION/ > /dev/null
cd bin && tar czf linux-SilentDragonLite-v$APP_VERSION.tar.gz SilentDragonLite-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp bin/linux-silentdragonlite-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-silentdragonlite-v$APP_VERSION.tar.gz
cp bin/linux-SilentDragonLite-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-SilentDragonLite-v$APP_VERSION.tar.gz
echo "[OK]"
if [ -f artifacts/linux-binaries-silentdragonlite-v$APP_VERSION.tar.gz ] ; then
if [ -f artifacts/linux-binaries-SilentDragonLite-v$APP_VERSION.tar.gz ] ; then
echo -n "Package contents......."
# Test if the package is built OK
if tar tf "artifacts/linux-binaries-silentdragonlite-v$APP_VERSION.tar.gz" | wc -l | grep -q "4"; then
if tar tf "artifacts/linux-binaries-SilentDragonLite-v$APP_VERSION.tar.gz" | wc -l | grep -q "4"; then
echo "[OK]"
else
echo "[ERROR]"
@ -78,23 +78,23 @@ else
fi
echo -n "Building deb..........."
debdir=bin/deb/silentdragonlite-v$APP_VERSION
debdir=bin/deb/SilentDragonLite-v$APP_VERSION
mkdir -p $debdir > /dev/null
mkdir $debdir/DEBIAN
mkdir -p $debdir/usr/local/bin
cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control
cp silentdragonlite $debdir/usr/local/bin/
cp SilentDragonLite $debdir/usr/local/bin/
mkdir -p $debdir/usr/share/pixmaps/
cp res/silentdragonlite.xpm $debdir/usr/share/pixmaps/
cp res/SilentDragonLite.xpm $debdir/usr/share/pixmaps/
mkdir -p $debdir/usr/share/applications
cp src/scripts/desktopentry $debdir/usr/share/applications/silentdragonlite.desktop
cp src/scripts/desktopentry $debdir/usr/share/applications/SilentDragonLite.desktop
dpkg-deb --build $debdir >/dev/null
cp $debdir.deb artifacts/linux-deb-silentdragonlite-v$APP_VERSION.deb
cp $debdir.deb artifacts/linux-deb-SilentDragonLite-v$APP_VERSION.deb
echo "[OK]"
@ -112,36 +112,40 @@ export PATH=$MXE_PATH:$PATH
echo -n "Configuring............"
make clean > /dev/null
#rm -f silentdragonlite-mingw.pro
#rm -f SilentDragonLite-mingw.pro
rm -rf release/
cp src/precompiled.h release/
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
#cat silentdragon-lite.pro | sed "s/precompile_header/release/g" | sed "s/PRECOMPILED_HEADER.*//g" > silentdragonlite-mingw.pro
#cat silentdragon-lite.pro | sed "s/precompile_header/release/g" | sed "s/PRECOMPILED_HEADER.*//g" > SilentDragonLite-mingw.pro
echo "[OK]"
echo -n "Building..............."
cp src/precompiled.h release/
# Build the lib first
cd lib && make winrelease && cd ..
x86_64-w64-mingw32.static-qmake-qt5 silentdragonlite.pro CONFIG+=release > /dev/null
cp src/precompiled.h release/
x86_64-w64-mingw32.static-qmake-qt5 silentdragon-lite.pro CONFIG+=release > /dev/null
cp src/precompiled.h release/
make -j32 > /dev/null
echo "[OK]"
echo -n "Packaging.............."
mkdir release/silentdragonlite-v$APP_VERSION
cp release/silentdragonlite.exe release/silentdragonlite-v$APP_VERSION
cp README.md release/silentdragonlite-v$APP_VERSION
cp LICENSE release/silentdragonlite-v$APP_VERSION
cd release && zip -r Windows-binaries-silentdragonlite-v$APP_VERSION.zip silentdragonlite-v$APP_VERSION/ > /dev/null
mkdir release/SilentDragonLite-v$APP_VERSION
cp release/SilentDragonLite.exe release/SilentDragonLite-v$APP_VERSION
cp README.md release/SilentDragonLite-v$APP_VERSION
cp LICENSE release/SilentDragonLite-v$APP_VERSION
cd release && zip -r Windows-binaries-SilentDragonLite-v$APP_VERSION.zip SilentDragonLite-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp release/Windows-binaries-silentdragonlite-v$APP_VERSION.zip ./artifacts/
cp release/Windows-binaries-SilentDragonLite-v$APP_VERSION.zip ./artifacts/
echo "[OK]"
if [ -f artifacts/Windows-binaries-silentdragonlite-v$APP_VERSION.zip ] ; then
if [ -f artifacts/Windows-binaries-SilentDragonLite-v$APP_VERSION.zip ] ; then
echo -n "Package contents......."
if unzip -l "artifacts/Windows-binaries-silentdragonlite-v$APP_VERSION.zip" | wc -l | grep -q "9"; then
if unzip -l "artifacts/Windows-binaries-SilentDragonLite-v$APP_VERSION.zip" | wc -l | grep -q "9"; then
echo "[OK]"
else
echo "[ERROR]"

2
src/scripts/signbinaries.sh

@ -33,7 +33,7 @@ rm -f sha256sum-v$APP_VERSION.txt
rm -f signatures-v$APP_VERSION.tar.gz
# sha256sum the binaries
gsha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt
sha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt
for i in $( ls *SilentDragonLite-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do
echo "Signing" $i

105
src/settings.cpp

@ -135,6 +135,73 @@ double Settings::getGBPPrice() {
double Settings::getAUDPrice() {
return AUDPrice;
}
double Settings::getUSDVolume() {
return USDVolume;
}
double Settings::getEURVolume() {
return EURVolume;
}
double Settings::getBTCVolume() {
return BTCVolume;
}
double Settings::getCNYVolume() {
return CNYVolume;
}
double Settings::getRUBVolume() {
return RUBVolume;
}
double Settings::getCADVolume() {
return CADVolume;
}
double Settings::getSGDVolume() {
return SGDVolume;
}
double Settings::getCHFVolume() {
return CHFVolume;
}
double Settings::getINRVolume() {
return INRVolume;
}
double Settings::getGBPVolume() {
return GBPVolume;
}
double Settings::getAUDVolume() {
return AUDVolume;
}
double Settings::getUSDCAP() {
return USDCAP;
}
double Settings::getEURCAP() {
return EURCAP;
}
double Settings::getBTCCAP() {
return BTCCAP;
}
double Settings::getCNYCAP() {
return CNYCAP;
}
double Settings::getRUBCAP() {
return RUBCAP;
}
double Settings::getCADCAP() {
return CADCAP;
}
double Settings::getSGDCAP() {
return SGDCAP;
}
double Settings::getCHFCAP() {
return CHFCAP;
}
double Settings::getINRCAP() {
return INRCAP;
}
double Settings::getGBPCAP() {
return GBPCAP;
}
double Settings::getAUDCAP() {
return AUDCAP;
}
bool Settings::getCheckForUpdates() {
return QSettings().value("options/allowcheckupdates", true).toBool();
@ -292,27 +359,23 @@ PaymentURI Settings::parseURI(QString uri) {
ans.error = "Could not understand address";
return ans;
}
uri = uri.right(uri.length() - ans.addr.length());
if (!uri.isEmpty()) {
uri = uri.right(uri.length() - 1); // Eat the "?"
QStringList args = uri.split("&");
for (QString arg: args) {
QStringList kv = arg.split("=");
if (kv.length() != 2) {
ans.error = "No value argument was seen";
return ans;
}
if (kv[0].toLower() == "amt" || kv[0].toLower() == "amount") {
ans.amt = kv[1];
} else if (kv[0].toLower() == "memo" || kv[0].toLower() == "message" || kv[0].toLower() == "msg") {
ans.memo = QUrl::fromPercentEncoding(kv[1].toUtf8());
} else {
// Ignore unknown fields, since some developers use it to pass extra data.
}
}
uri = uri.right(uri.length() - ans.addr.length()-1); // swallow '?'
QUrlQuery query(uri);
// parse out amt / amount
if (query.hasQueryItem("amt")) {
ans.amt = query.queryItemValue("amt");
} else if (query.hasQueryItem("amount")) {
ans.amt = query.queryItemValue("amount");
}
// parse out memo / msg / message
if (query.hasQueryItem("memo")) {
ans.memo = query.queryItemValue("memo");
} else if (query.hasQueryItem("msg")) {
ans.memo = query.queryItemValue("msg");
} else if (query.hasQueryItem("message")) {
ans.memo = query.queryItemValue("message");
}
return ans;

67
src/settings.h

@ -80,6 +80,28 @@ public:
void setINRPrice(double p) { INRPrice = p; }
void setGBPPrice(double p) { GBPPrice = p; }
void setAUDPrice(double p) { AUDPrice = p; }
void setUSDVolume(double p) { USDVolume = p; }
void setEURVolume(double p) { EURVolume = p; }
void setBTCVolume(double p) { BTCVolume = p; }
void setCNYVolume(double p) { CNYVolume = p; }
void setRUBVolume(double p) { RUBVolume = p; }
void setCADVolume(double p) { CADVolume = p; }
void setSGDVolume(double p) { SGDVolume = p; }
void setCHFVolume(double p) { CHFVolume = p; }
void setINRVolume(double p) { INRVolume = p; }
void setGBPVolume(double p) { GBPVolume = p; }
void setAUDVolume(double p) { AUDVolume = p; }
void setUSDCAP(double p) { USDCAP = p; }
void setEURCAP(double p) { EURCAP = p; }
void setBTCCAP(double p) { BTCCAP = p; }
void setCNYCAP(double p) { CNYCAP = p; }
void setRUBCAP(double p) { RUBCAP = p; }
void setCADCAP(double p) { CADCAP = p; }
void setSGDCAP(double p) { SGDCAP = p; }
void setCHFCAP(double p) { CHFCAP = p; }
void setINRCAP(double p) { INRCAP = p; }
void setGBPCAP(double p) { GBPCAP = p; }
void setAUDCAP(double p) { AUDCAP = p; }
double getZECPrice();
double getEURPrice();
double getBTCPrice();
@ -91,6 +113,29 @@ public:
double getINRPrice();
double getGBPPrice();
double getAUDPrice();
double getUSDVolume();
double getEURVolume();
double getBTCVolume();
double getCNYVolume();
double getRUBVolume();
double getCADVolume();
double getSGDVolume();
double getCHFVolume();
double getINRVolume();
double getGBPVolume();
double getAUDVolume();
double getUSDCAP();
double getEURCAP();
double getBTCCAP();
double getCNYCAP();
double getRUBCAP();
double getCADCAP();
double getSGDCAP();
double getCHFCAP();
double getINRCAP();
double getGBPCAP();
double getAUDCAP();
// Static stuff
static const QString txidStatusMessage;
@ -153,6 +198,28 @@ private:
double INRPrice = 0.0;
double GBPPrice = 0.0;
double AUDPrice = 0.0;
double USDVolume = 0.0;
double EURVolume = 0.0;
double BTCVolume = 0.0;
double CNYVolume = 0.0;
double RUBVolume = 0.0;
double CADVolume = 0.0;
double SGDVolume = 0.0;
double CHFVolume = 0.0;
double INRVolume = 0.0;
double GBPVolume = 0.0;
double AUDVolume = 0.0;
double USDCAP = 0.0;
double EURCAP = 0.0;
double BTCCAP = 0.0;
double CNYCAP = 0.0;
double RUBCAP = 0.0;
double CADCAP = 0.0;
double SGDCAP = 0.0;
double CHFCAP = 0.0;
double INRCAP = 0.0;
double GBPCAP = 0.0;
double AUDCAP = 0.0;
};

2
src/txtablemodel.cpp

@ -137,7 +137,7 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
return Settings::paymentURIPretty(Settings::parseURI(memo));
} else {
return modeldata->at(index.row()).type +
(memo.isEmpty() ? "" : " tx memo: \"" + memo + "\"");
(memo.isEmpty() ? "" : " tx memo: \"" + memo.toHtmlEscaped() + "\"");
}
} else {
return concatMultipleMemos(dat);

2
src/version.h

@ -1 +1 @@
#define APP_VERSION "1.1.1"
#define APP_VERSION "1.1.2"

Loading…
Cancel
Save