Browse Source

Merge branch 'duke' into chat

Conflicts:
	src/mainwindow.cpp
chat
Duke Leto 4 years ago
parent
commit
efa3a04c88
  1. 10
      .travis.yml
  2. 8
      application.qrc
  3. 139
      res/css/midnight.css
  4. BIN
      res/silentdragon-animated-dark.gif
  5. BIN
      res/silentdragon-animated-startup-dark.gif
  6. BIN
      res/silentdragon-animated-startup.gif
  7. BIN
      res/silentdragon-animated.gif
  8. 2208
      res/silentdragon_bg.ts
  9. BIN
      res/silentdragon_de.qm
  10. 856
      res/silentdragon_de.ts
  11. BIN
      res/silentdragon_es.qm
  12. 724
      res/silentdragon_es.ts
  13. BIN
      res/silentdragon_fi.qm
  14. 718
      res/silentdragon_fi.ts
  15. 2256
      res/silentdragon_fil.ts
  16. BIN
      res/silentdragon_fr.qm
  17. 718
      res/silentdragon_fr.ts
  18. BIN
      res/silentdragon_hr.qm
  19. 718
      res/silentdragon_hr.ts
  20. 2251
      res/silentdragon_id.ts
  21. BIN
      res/silentdragon_it.qm
  22. 718
      res/silentdragon_it.ts
  23. BIN
      res/silentdragon_nl.qm
  24. 718
      res/silentdragon_nl.ts
  25. BIN
      res/silentdragon_pt.qm
  26. 718
      res/silentdragon_pt.ts
  27. BIN
      res/silentdragon_ru.qm
  28. 718
      res/silentdragon_ru.ts
  29. BIN
      res/silentdragon_sr.qm
  30. 718
      res/silentdragon_sr.ts
  31. BIN
      res/silentdragon_tr.qm
  32. 718
      res/silentdragon_tr.ts
  33. BIN
      res/silentdragon_uk.qm
  34. 718
      res/silentdragon_uk.ts
  35. BIN
      res/silentdragon_zh.qm
  36. 718
      res/silentdragon_zh.ts
  37. BIN
      res/zec_qt_wallet_fi.qm
  38. BIN
      res/zec_qt_wallet_hr.qm
  39. 7
      silentdragon.pro
  40. 36
      src/connection.cpp
  41. 3
      src/connection.h
  42. 2
      src/connection.ui
  43. 10
      src/main.cpp
  44. 103
      src/mainwindow.cpp
  45. 2
      src/mainwindow.ui
  46. 25
      src/rpc.cpp
  47. 16
      src/scripts/make-deb.sh
  48. 2
      src/scripts/make-only-deb.sh
  49. 177
      src/scripts/mkrelease.sh
  50. 19
      src/sendtab.cpp
  51. 2
      src/settings.cpp
  52. 807
      src/settings.ui
  53. 2
      src/version.h
  54. 78
      src/viewkey.ui
  55. 8
      src/websockets.cpp
  56. 2055
      zec_qt_wallet_pt.ts

10
.travis.yml

@ -1,3 +1,5 @@
dist: trusty
matrix:
include:
# works on Precise and Trusty
@ -9,10 +11,12 @@ matrix:
packages: ['clang-3.7', 'g++-8']
before_install:
# TODO: I usually make builds with 5.14 - Duke
- sudo add-apt-repository ppa:beineri/opt-qt591-trusty -y
- sudo apt-get update -qq
- sudo apt-get install qt59base qt59websockets
- source /opt/qt59/bin/qt59-env.sh
- chmod +x res/libsodium/buildlibsodium.sh
script:
- qmake -v
@ -22,6 +26,10 @@ script:
- make CC=clang CXX=clang++ -j2
- make distclean
- qmake silentdragon.pro CONFIG+=release -spec linux-g++
# These next 2 lines test that translation source files can be compiled
# correctly and will hopefully catch syntax errors earlier
# We want the build to fail if we can't compile translations.
- lupdate silentdragon.pro
- lrelease silentdragon.pro
- res/libsodium/buildlibsodium.sh
- make CC=gcc-8 CXX=g++-8 -j2

8
application.qrc

@ -11,14 +11,21 @@
<qresource prefix="/img">
<file>res/zcashdlogo.gif</file>
<file>res/logobig.gif</file>
<file>res/silentdragon-animated.gif</file>
<file>res/silentdragon-animated-dark.gif</file>
<file>res/silentdragon-animated-startup.gif</file>
<file>res/silentdragon-animated-startup-dark.gif</file>
</qresource>
<qresource prefix="/translations">
<file>res/silentdragon_bg.qm</file>
<file>res/silentdragon_de.qm</file>
<file>res/silentdragon_es.qm</file>
<file>res/silentdragon_fi.qm</file>
<file>res/silentdragon_fil.qm</file>
<file>res/silentdragon_fr.qm</file>
<file>res/silentdragon_hr.qm</file>
<file>res/silentdragon_it.qm</file>
<file>res/silentdragon_id.qm</file>
<file>res/silentdragon_nl.qm</file>
<file>res/silentdragon_pt.qm</file>
<file>res/silentdragon_ru.qm</file>
@ -32,6 +39,7 @@
<file>res/css/dark.css</file>
<file>res/css/default.css</file>
<file>res/css/light.css</file>
<file>res/css/midnight.css</file>
</qresource>
<qresource prefix="/images/blue">
<file>res/images/blue/unchecked.png</file>

139
res/css/midnight.css

@ -0,0 +1,139 @@
/*
Theme: Midnight Qt
Version: 1.0.2
Reference: https://doc.qt.io/qt-5/stylesheet-reference.html
Author: Charles Sharpe
Date: Apr. 23, 2020
Website: https://www.csharpe.me
License: https://opensource.org/licenses/MIT
*/
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
background-color: #111;
color: #fff;
}
QPushButton {
padding: 10px 15px;
}
QPushButton:hover {
background: #222;
}
QLineEdit, QRadioButton::indicator::unchecked, QCheckBox::indicator::unchecked {
background: #222;
border: 1px solid #333;
border-radius: 3px;
}
QLineEdit {
font-size: 12px;
}
QLineEdit:focus {
border: 1px solid #9d8400;
}
QWidget QLabel {
font-size: 11pt;
}
QWidget QCheckBox {
font-weight: bold;
}
QTabWidget QTabBar::tab {
min-height: 15px;
padding: 15px 25px;
border: 1px ridge #222;
left: 1px; /* Fix 1px alignment */
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #333, stop: 1 #111);
}
QTabWidget QTabBar::tab:selected {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #555, stop: 1 #111);
color:#fff;
border: 1px ridge #222;
border-bottom: 0px; /* Overwrites border-bottom */
}
QTabWidget QTabBar::tab:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #555, stop: 1 #111);
}
QHeaderView { /* Table Header */
background-color:#111;
}
QHeaderView::section { /* Table Header Sections */
qproperty-alignment:center;
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #333, stop: 1 #111);
color:#fff;
min-height:25px;
font-weight:bold;
font-size:12px;
outline:0;
border:1px ridge #222;
padding: 2px 5px;
}
QHeaderView::section:last {
border-right: 0px ridge #222;
}
QScrollArea {
background:transparent;
border:0px;
}
QTableView { /* Table - has to be selected as a class otherwise it throws off QCalendarWidget */
background:#111;
}
QTableView::item { /* Table Item */
background-color:#111;
border:1px solid #222;
font-size:12px;
}
QTableView::item:selected { /* Table Item Selected */
background-color:#fff;
color:#000;
}
QMenuBar {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #222, stop: 1 #111);
color: #fff;
}
QMenuBar::item {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #222, stop: 1 #111);
color: #fff;
padding: 5px 7px;
margin: 0px;
}
QMenuBar::item:selected {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #333, stop: 1 #111);
}
QMenu {
border:1px solid #222;
}
QMenu::item {
padding: 7px 15px;
}
QMenu::item:selected {
background: #222;
}
QMenu::separator {
height: 1px;
margin: 3px 7px 3px 7px; /* space at ends of separator */
background: #222;
}

BIN
res/silentdragon-animated-dark.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
res/silentdragon-animated-startup-dark.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 MiB

BIN
res/silentdragon-animated-startup.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 MiB

BIN
res/silentdragon-animated.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

2208
res/silentdragon_bg.ts

File diff suppressed because it is too large

BIN
res/silentdragon_de.qm

Binary file not shown.

856
res/silentdragon_de.ts

File diff suppressed because it is too large

BIN
res/silentdragon_es.qm

Binary file not shown.

724
res/silentdragon_es.ts

File diff suppressed because it is too large

BIN
res/silentdragon_fi.qm

Binary file not shown.

718
res/silentdragon_fi.ts

File diff suppressed because it is too large

2256
res/silentdragon_fil.ts

File diff suppressed because it is too large

BIN
res/silentdragon_fr.qm

Binary file not shown.

718
res/silentdragon_fr.ts

File diff suppressed because it is too large

BIN
res/silentdragon_hr.qm

Binary file not shown.

718
res/silentdragon_hr.ts

File diff suppressed because it is too large

2251
res/silentdragon_id.ts

File diff suppressed because it is too large

BIN
res/silentdragon_it.qm

Binary file not shown.

718
res/silentdragon_it.ts

File diff suppressed because it is too large

BIN
res/silentdragon_nl.qm

Binary file not shown.

718
res/silentdragon_nl.ts

File diff suppressed because it is too large

BIN
res/silentdragon_pt.qm

Binary file not shown.

718
res/silentdragon_pt.ts

File diff suppressed because it is too large

BIN
res/silentdragon_ru.qm

Binary file not shown.

718
res/silentdragon_ru.ts

File diff suppressed because it is too large

BIN
res/silentdragon_sr.qm

Binary file not shown.

718
res/silentdragon_sr.ts

File diff suppressed because it is too large

BIN
res/silentdragon_tr.qm

Binary file not shown.

718
res/silentdragon_tr.ts

File diff suppressed because it is too large

BIN
res/silentdragon_uk.qm

Binary file not shown.

718
res/silentdragon_uk.ts

File diff suppressed because it is too large

BIN
res/silentdragon_zh.qm

Binary file not shown.

718
res/silentdragon_zh.ts

File diff suppressed because it is too large

BIN
res/zec_qt_wallet_fi.qm

Binary file not shown.

BIN
res/zec_qt_wallet_hr.qm

Binary file not shown.

7
silentdragon.pro

@ -111,11 +111,14 @@ FORMS += \
src/requestdialog.ui
TRANSLATIONS = res/silentdragon_de.ts \
TRANSLATIONS = res/silentdragon_bg.ts \
res/silentdragon_de.ts \
res/silentdragon_es.ts \
res/silentdragon_fi.ts \
res/silentdragon_fil.ts \
res/silentdragon_fr.ts \
res/silentdragon_hr.ts \
res/silentdragon_id.ts \
res/silentdragon_it.ts \
res/silentdragon_nl.ts \
res/silentdragon_pt.ts \
@ -126,7 +129,7 @@ TRANSLATIONS = res/silentdragon_de.ts \
res/silentdragon_zh.ts
include(singleapplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication
DEFINES += QAPPLICATION_CLASS=QApplication _FORTIFY_SOURCE=2
QMAKE_INFO_PLIST = res/Info.plist

36
src/connection.cpp

@ -19,15 +19,28 @@ ConnectionLoader::ConnectionLoader(MainWindow* main, RPC* rpc) {
d->setWindowFlags(d->windowFlags() & ~(Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint));
connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QPixmap logo(":/img/res/logobig.gif");
connD->topIcon->setBasePixmap(logo.scaled(512, 512, Qt::KeepAspectRatio, Qt::SmoothTransformation));
//main->logger->write("set topIcon");
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated-startup.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-startup-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
auto size = QSize(512,512);
if (theme == "dark" || "midnight") {
movie2->setScaledSize(size);
connD->topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(size);
connD->topIcon->setMovie(movie1);
movie1->start();
}
main->logger->write("set animation");
qDebug() << "set animation";
}
ConnectionLoader::~ConnectionLoader() {
delete d;
delete connD;
main->logger->write("ConnectionLoader done");
qDebug() << "connection loader done";
}
void ConnectionLoader::loadConnection() {
@ -656,7 +669,7 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectZcashConf() {
zcashconf->usingZcashConf = true;
zcashconf->zcashDir = QFileInfo(confLocation).absoluteDir().absolutePath();
zcashconf->zcashDaemon = false;
Settings::getInstance()->setUsingZcashConf(confLocation);
while (!in.atEnd()) {
@ -679,6 +692,15 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectZcashConf() {
}
if (name == "proxy") {
zcashconf->proxy = value;
}
if (name == "consolidation") {
zcashconf->consolidation = value;
}
if (name == "deletetx") {
zcashconf->deletetx = value;
}
if (name == "zindex") {
zcashconf->zindex = value;
}
if (name == "testnet" &&
value == "1" &&
@ -706,12 +728,12 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::loadFromSettings() {
auto host = s.value("connection/host").toString();
auto port = s.value("connection/port").toString();
auto username = s.value("connection/rpcuser").toString();
auto password = s.value("connection/rpcpassword").toString();
auto password = s.value("connection/rpcpassword").toString();
if (username.isEmpty() || password.isEmpty())
return nullptr;
auto uiConfig = new ConnectionConfig{ host, port, username, password, false, false, "", "", ConnectionType::UISettingsZCashD};
auto uiConfig = new ConnectionConfig{ host, port, username, password, false, false,"","", "", "","", ConnectionType::UISettingsZCashD};
return std::shared_ptr<ConnectionConfig>(uiConfig);
}

3
src/connection.h

@ -24,6 +24,9 @@ struct ConnectionConfig {
bool zcashDaemon;
QString zcashDir;
QString proxy;
QString consolidation;
QString deletetx;
QString zindex;
ConnectionType connType;
};

2
src/connection.ui

@ -33,7 +33,7 @@
<number>0</number>
</property>
<item>
<widget class="FilledIconLabel" name="topIcon">
<widget class="QLabel" name="topIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>

10
src/main.cpp

@ -1,3 +1,5 @@
// Copyright 2019-2020 The Hush developers
// GPLv3
#include <singleapplication.h>
#include "precompiled.h"
@ -154,16 +156,16 @@ public:
QCommandLineOption headlessOption(QStringList() << "headless", "Running it via GUI.");
parser.addOption(headlessOption);
// No embedded will disable the embedded zcashd node
// No embedded will disable the embedded hushd node
QCommandLineOption noembeddedOption(QStringList() << "no-embedded", "Disable embedded hushd");
parser.addOption(noembeddedOption);
// Positional argument will specify a zcash payment URI
// Positional argument will specify a Hush payment URI
parser.addPositionalArgument("hushURI", "An optional HUSH URI to pay");
parser.process(a);
// Check for a positional argument indicating a zcash payment URI
// Check for a positional argument indicating a Hush payment URI
if (a.isSecondary()) {
if (parser.positionalArguments().length() > 0) {
a.sendMessage(parser.positionalArguments()[0].toUtf8());
@ -225,7 +227,7 @@ public:
w->payZcashURI(parser.positionalArguments()[0]);
}
// Listen for any secondary instances telling us about a zcash payment URI
// Listen for any secondary instances telling us about a Hush payment URI
QObject::connect(&a, &SingleApplication::receivedMessage, [=] (quint32, QByteArray msg) {
QString uri(msg);

103
src/mainwindow.cpp

@ -464,7 +464,6 @@ void MainWindow::setupSettingsModal() {
int theme_index = settings.comboBoxTheme->findText(Settings::getInstance()->get_theme_name(), Qt::MatchExactly);
settings.comboBoxTheme->setCurrentIndex(theme_index);
QObject::connect(settings.comboBoxTheme, SIGNAL(currentIndexChanged(QString)), this, SLOT(slot_change_theme(QString)));
QObject::connect(settings.comboBoxTheme, &QComboBox::currentTextChanged, [=] (QString theme_name) {
this->slot_change_theme(theme_name);
QMessageBox::information(this, tr("Theme Change"), tr("This change can take a few seconds."), QMessageBox::Ok);
@ -474,7 +473,6 @@ void MainWindow::setupSettingsModal() {
QString ticker = QString::fromStdString( Settings::getInstance()->get_currency_name() );
int currency_index = settings.comboBoxCurrency->findText(ticker, Qt::MatchExactly);
settings.comboBoxCurrency->setCurrentIndex(currency_index);
QObject::connect(settings.comboBoxCurrency, SIGNAL(currentIndexChanged(QString)), this, SLOT(slot_change_currency(QString)));
QObject::connect(settings.comboBoxCurrency, &QComboBox::currentTextChanged, [=] (QString ticker) {
this->slot_change_currency(ticker.toStdString());
rpc->refresh(true);
@ -510,6 +508,48 @@ void MainWindow::setupSettingsModal() {
settings.lblTor->setToolTip(tooltip);
}
//Use Consolidation
bool isUsingConsolidation = false;
int size = 0;
QDir zcashdir(rpc->getConnection()->config->zcashDir);
QFile WalletSize(zcashdir.filePath("wallet.dat"));
if (WalletSize.open(QIODevice::ReadOnly)){
size = WalletSize.size() / 1000000; //when file does open.
//QString size1 = QString::number(size) ;
settings.WalletSize->setText(QString::number(size));
WalletSize.close();
}
if (rpc->getConnection() != nullptr) {
isUsingConsolidation = !rpc->getConnection()->config->consolidation.isEmpty() == true;
}
settings.chkConso->setChecked(isUsingConsolidation);
if (rpc->getEZcashD() == nullptr) {
settings.chkConso->setEnabled(false);
}
//Use Deletetx
bool isUsingDeletetx = false;
if (rpc->getConnection() != nullptr) {
isUsingDeletetx = !rpc->getConnection()->config->deletetx.isEmpty() == true;
}
settings.chkDeletetx->setChecked(isUsingDeletetx);
if (rpc->getEZcashD() == nullptr) {
settings.chkDeletetx->setEnabled(false);
}
//Use Zindex
bool isUsingZindex = false;
if (rpc->getConnection() != nullptr) {
isUsingZindex = !rpc->getConnection()->config->zindex.isEmpty() == true;
}
settings.chkzindex->setChecked(isUsingZindex);
if (rpc->getEZcashD() == nullptr) {
settings.chkzindex->setEnabled(false);
}
// Connection Settings
QIntValidator validator(0, 65535);
settings.port->setValidator(&validator);
@ -521,16 +561,15 @@ void MainWindow::setupSettingsModal() {
settings.hostname->setEnabled(false);
settings.port->setEnabled(false);
settings.rpcuser->setEnabled(false);
settings.rpcpassword->setEnabled(false);
settings.rpcpassword->setEnabled(false);
} else {
settings.confMsg->setText("No local HUSH3.conf found. Please configure connection manually.");
settings.hostname->setEnabled(true);
settings.port->setEnabled(true);
settings.rpcuser->setEnabled(true);
settings.rpcpassword->setEnabled(true);
settings.rpcpassword->setEnabled(true);
}
// Load current values into the dialog
// Load current values into the dialog
auto conf = Settings::getInstance()->getSettings();
settings.hostname->setText(conf.host);
@ -616,6 +655,7 @@ void MainWindow::setupSettingsModal() {
// Check to see if rescan or reindex have been enabled
bool showRestartInfo = false;
bool showReindexInfo = false;
if (settings.chkRescan->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "rescan=1");
showRestartInfo = true;
@ -626,8 +666,58 @@ void MainWindow::setupSettingsModal() {
showRestartInfo = true;
}
if (!rpc->getConnection()->config->consolidation.isEmpty()==false) {
if (settings.chkConso->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "consolidation=1");
showRestartInfo = true;
}
}
if (!rpc->getConnection()->config->consolidation.isEmpty()) {
if (settings.chkConso->isChecked() == false) {
Settings::removeFromZcashConf(zcashConfLocation, "consolidation");
showRestartInfo = true;
}
}
if (!rpc->getConnection()->config->deletetx.isEmpty() == false) {
if (settings.chkDeletetx->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "deletetx=1");
showRestartInfo = true;
}
}
if (!rpc->getConnection()->config->deletetx.isEmpty()) {
if (settings.chkDeletetx->isChecked() == false) {
Settings::removeFromZcashConf(zcashConfLocation, "deletetx");
showRestartInfo = true;
}
}
if (!rpc->getConnection()->config->zindex.isEmpty() == false) {
if (settings.chkzindex->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "zindex=1");
Settings::addToZcashConf(zcashConfLocation, "reindex=1");
showReindexInfo = true;
}
}
if (!rpc->getConnection()->config->zindex.isEmpty()) {
if (settings.chkzindex->isChecked() == false) {
Settings::removeFromZcashConf(zcashConfLocation, "zindex");
Settings::addToZcashConf(zcashConfLocation, "reindex=1");
showReindexInfo = true;
}
}
if (showRestartInfo) {
auto desc = tr("SilentDragon needs to restart to rescan/reindex. SilentDragon will now close, please restart SilentDragon to continue");
auto desc = tr("SilentDragon needs to restart to rescan,reindex,consolidation or deletetx. SilentDragon will now close, please restart SilentDragon to continue");
QMessageBox::information(this, tr("Restart SilentDragon"), desc, QMessageBox::Ok);
QTimer::singleShot(1, [=]() { this->close(); });
}
if (showReindexInfo) {
auto desc = tr("SilentDragon needs to reindex for zindex. SilentDragon will now close, please restart SilentDragon to continue");
QMessageBox::information(this, tr("Restart SilentDragon"), desc, QMessageBox::Ok);
QTimer::singleShot(1, [=]() { this->close(); });
@ -1213,7 +1303,6 @@ void MainWindow::setupHushTab() {
ui->hushlogo->setBasePixmap(QPixmap(":/img/res/zcashdlogo.gif"));
}
void MainWindow::setupChatTab() {
qDebug() << __FUNCTION__;
QList<QList<QString>> addressLabels = AddressBook::getInstance()->getAllAddressLabels();

2
src/mainwindow.ui

@ -1014,6 +1014,7 @@
</item>
</layout>
</widget>
<!--
<widget class="QWidget" name="chat_tab">
<attribute name="title">
<string>Chat</string>
@ -1088,6 +1089,7 @@
</item>
</layout>
</widget>
-->
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>hushd</string>

25
src/rpc.cpp

@ -1092,8 +1092,8 @@ void RPC::checkForUpdate(bool silent) {
}
}
} catch (const std::exception& e) {
// If anything at all goes wrong, just set the price to 0 and move on.
qDebug() << QString("Caught something nasty: ") << e.what();
// If anything at all goes wrong, move on
qDebug() << QString("Exception checking for updates!");
}
});
}
@ -1110,11 +1110,14 @@ void RPC::refreshPrice() {
QNetworkReply *reply = conn->restclient->get(req);
auto s = Settings::getInstance();
qDebug() << "Requesting price feed data via " << price_feed;
QObject::connect(reply, &QNetworkReply::finished, [=] {
reply->deleteLater();
try {
if (reply->error() != QNetworkReply::NoError) {
qDebug() << "Parsing price feed response";
auto parsed = json::parse(reply->readAll(), nullptr, false);
if (!parsed.is_discarded() && !parsed["error"]["message"].is_null()) {
qDebug() << QString::fromStdString(parsed["error"]["message"]);
@ -1190,7 +1193,7 @@ void RPC::refreshPrice() {
}
} catch (const std::exception& e) {
// If anything at all goes wrong, just set the price to 0 and move on.
qDebug() << QString("Caught something nasty: ") << e.what();
qDebug() << QString("Price feed update failure : ") << e.what();
}
// If nothing, then set the price to 0;
@ -1214,7 +1217,21 @@ void RPC::shutdownZcashd() {
d.setWindowFlags(d.windowFlags() & ~(Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint));
Ui_ConnectionDialog connD;
connD.setupUi(&d);
connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));
//connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "dark" || "midnight") {
movie2->setScaledSize(QSize(512,512));
connD.topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(QSize(512,512));
connD.topIcon->setMovie(movie1);
movie1->start();
}
connD.status->setText(QObject::tr("Please enhance your calm and wait for SilentDragon to exit"));
connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit, y'all"));

16
src/scripts/make-deb.sh

@ -1,5 +1,6 @@
#!/bin/bash
# Copyright (c) 2019-2020 The Hush developers
# Thanks to Zecwallet for the original code
# Released under the GPLv3
DEBLOG=deb.log.$$
@ -18,13 +19,18 @@ if [ -z $HUSH_DIR ]; then
exit 1;
fi
if [ ! -f $HUSH_DIR/artifacts/komodod ]; then
echo "Couldn't find komodod in $HUSH_DIR/artifacts/. Please build komodod."
if [ ! -f $HUSH_DIR/komodod ]; then
echo "Couldn't find komodod in $HUSH_DIR . Please build komodod."
exit 1;
fi
if [ ! -f $HUSH_DIR/artifacts/komodo-cli ]; then
echo "Couldn't find komodo-cli in $HUSH_DIR/artifacts/. Please build komodod."
if [ ! -f $HUSH_DIR/komodo-cli ]; then
echo "Couldn't find komodo-cli in $HUSH_DIR . Please build komodo-cli."
exit 1;
fi
if [ ! -f $HUSH_DIR/komodo-tx ]; then
echo "Couldn't find komodo-tx in $HUSH_DIR . Please build komodo-tx."
exit 1;
fi
@ -45,7 +51,7 @@ echo "[OK]"
echo -n "Building..............."
rm -rf bin/silentdragon* > /dev/null
rm -rf silentdragon
make clean > /dev/null
./build.sh release > /dev/null
echo "[OK]"

2
src/scripts/make-only-deb.sh

@ -13,7 +13,7 @@ if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
# This assumes we already have a staticly compiled SD
echo "Building Debian package for $APP_VERSION-$ARCH..."
debdir=deb-SilentDragon-v$APP_VERSION-$ARCH
debdir=SilentDragon-v$APP_VERSION-$ARCH
if [ -e $debdir ]; then
mv $debdir $debdir-backup.$(perl -e 'print time')
fi

177
src/scripts/mkrelease.sh

@ -1,61 +1,54 @@
#!/bin/bash
# Copyright (c) 2019-2020 The Hush developers
# Thanks to Zecwallet for the original code
# Released under the GPLv3
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi
#if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi
if [ -z $HUSH_DIR ]; then
echo "HUSH_DIR is not set. Please set it to the base directory of a Zcash project with built Zcash binaries."
echo "HUSH_DIR is not set. Please set it to the base directory of a Hush project with built Hush binaries."
exit 1;
fi
if [ ! -f $HUSH_DIR/artifacts/komodod ]; then
echo "Couldn't find komodod in $HUSH_DIR/artifacts/. Please build komodod."
if [ -z $HUSH_DIR ]; then
echo "HUSH_DIR is not set. Please set it to the base directory of hush3.git"
exit 1;
fi
if [ ! -f $HUSH_DIR/artifacts/hush-cli ]; then
echo "Couldn't find hush-cli in $HUSH_DIR/artifacts/. Please build komodod."
if [ ! -f $HUSH_DIR/komodod ]; then
echo "Couldn't find komodod in $HUSH_DIR . Please build komodod."
exit 1;
fi
# Ensure that komodod is the right build
#echo -n "komodod version........."
#if grep -q "zqwMagicBean" $HUSH_DIR/artifacts/komodod && ! readelf -s $HUSH_DIR/artifacts/komodod | grep -q "GLIBC_2\.25"; then
# echo "[OK]"
#else
# echo "[ERROR]"
## echo "komodod doesn't seem to be a zqwMagicBean build or komodod is built with libc 2.25"
# exit 1
#fi
#echo -n "komodod.exe version....."
#if grep -q "zqwMagicBean" $HUSH_DIR/artifacts/komodod.exe; then
# echo "[OK]"
#else
# echo "[ERROR]"
# echo "komodod doesn't seem to be a zqwMagicBean build"
# exit 1
#fi
echo -n "Version files.........."
# Replace the version number in the .pro file so it gets picked up everywhere
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" silentdragon.pro > /dev/null
# Also update it in the README.md
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" README.md > /dev/null
echo "[OK]"
if [ ! -f $HUSH_DIR/komodo-cli ]; then
echo "Couldn't find komodo-cli in $HUSH_DIR . Please build komodo-cli."
exit 1;
fi
if [ ! -f $HUSH_DIR/komodo-tx ]; then
echo "Couldn't find komodo-tx in $HUSH_DIR . Please build komodo-tx."
exit 1;
fi
#echo -n "Version files.........."
## Replace the version number in the .pro file so it gets picked up everywhere
#sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" silentdragon.pro > /dev/null
#
## Also update it in the README.md
#sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" README.md > /dev/null
#echo "[OK]"
echo -n "Cleaning..............."
rm -rf bin/*
rm -rf artifacts/*
#rm -rf artifacts/*
make distclean >/dev/null 2>&1
echo "[OK]"
echo ""
echo "[Building on" `lsb_release -r`"]"
echo -n "Configuring............"
@ -65,57 +58,115 @@ echo "[OK]"
echo -n "Building..............."
rm -rf bin/silentdragon* > /dev/null
rm -rf bin/silentdragon* bin/SilentDragon* > /dev/null
make clean > /dev/null
./build.sh release > /dev/null
PATH=$QT_STATIC/bin:$PATH ./build.sh release > /dev/null
echo "[OK]"
# Test for Qt
echo -n "Static link............"
if [[ $(ldd silentdragon | grep -i "Qt") ]]; then
echo "FOUND QT; ABORT";
echo "FOUND QT dynamicly linked in binary, aborting!";
exit 1
fi
echo "[OK]"
echo -n "Packaging.............."
mkdir bin/silentdragon-v$APP_VERSION > /dev/null
#TODO: support armv8
OS=linux
ARCH=x86_64
RELEASEDIR=SilentDragon-v$APP_VERSION
RELEASEFILE1=$RELEASEDIR-$OS-$ARCH-no-params.tar.gz
RELEASEFILE2=$RELEASEDIR-$OS-$ARCH.tar.gz
# this is equal to the number of files we package plus 1, for the directory
# that is created
NUM_FILES1=10
NUM_FILES2=12 # 2 additional param files
echo "Packaging.............."
mkdir bin/$RELEASEDIR
echo "Created bin/$RELEASEDIR"
ls -la silentdragon
echo "Stripping............."
strip silentdragon
ls -la silentdragon
cp silentdragon bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/komodod bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/komodo-cli bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/komodo-tx bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/hushd bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/hush-cli bin/$RELEASEDIR > /dev/null
cp $HUSH_DIR/hush-tx bin/$RELEASEDIR > /dev/null
cp README.md bin/$RELEASEDIR > /dev/null
cp LICENSE bin/$RELEASEDIR > /dev/null
cd bin && tar czf $RELEASEFILE1 $RELEASEDIR/ #> /dev/null
#ls -la $RELEASEDIR/
echo "Created $RELEASEFILE1 [OK]"
cd ..
# Now copy params in so we can make another zip with params
# for first-time users
#ls -la *.params
# This assumes we have these 2 files symlinked to where they live in hush3.git
# or copied to this dir
cp -Lp sapling-*.params bin/$RELEASEDIR/
if [ $? -eq 0 ]; then
echo "[OK] Copied Sapling params"
else
echo "[ERROR] Failed to copy Sapling params!"
exit 1
fi
cp silentdragon bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodod bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodo-cli bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodo-tx bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hushd bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hush-cli bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hush-tx bin/silentdragon-v$APP_VERSION > /dev/null
cp README.md bin/silentdragon-v$APP_VERSION > /dev/null
cp LICENSE bin/silentdragon-v$APP_VERSION > /dev/null
cd bin && tar czf linux-silentdragon-v$APP_VERSION.tar.gz silentdragon-v$APP_VERSION/ > /dev/null
cd bin && tar czf $RELEASEFILE2 $RELEASEDIR/
#ls -la $RELEASEDIR/
echo "Created $RELEASEFILE2 [OK]"
cd ..
mkdir artifacts >/dev/null 2>&1
cp bin/linux-silentdragon-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz
echo "[OK]"
#mkdir artifacts >/dev/null 2>&1
#cp bin/linux-silentdragon-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz
if [ -f bin/$RELEASEFILE1 ] ; then
echo -n "Package contents for $RELEASEFILE1 ......."
# Test if the package is built OK
if tar tf "bin/$RELEASEFILE1" | wc -l | grep -q "$NUM_FILES1"; then
echo "[OK] $RELEASEFILE1 has correct number of files"
else
echo "[ERROR] Wrong number of files in $RELEASEFILE1 ! Should be $NUM_FILES1"
exit 1
fi
else
echo "[ERROR] bin/$RELEASEFILE1 does not exist!"
exit 1
fi
if [ -f artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz ] ; then
echo -n "Package contents......."
if [ -f bin/$RELEASEFILE2 ] ; then
echo -n "Package contents for $RELEASEFILE2 ......."
# Test if the package is built OK
if tar tf "artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz" | wc -l | grep -q "6"; then
echo "[OK]"
if tar tf "bin/$RELEASEFILE2" | wc -l | grep -q "$NUM_FILES2"; then
echo "[OK] $RELEASEFILE2 has correct number of files"
else
echo "[ERROR]"
echo "[ERROR] Wrong number of files in $RELEASEFILE2 ! Should be $NUM_FILES2"
exit 1
fi
else
echo "[ERROR]"
echo "[ERROR] bin/$RELEASEFILE2 does not exist!"
exit 1
fi
cd bin
echo "DONE! Checksums:"
sha256sum $RELEASEFILE1
sha256sum $RELEASEFILE2
cd ..
echo "Speak And Transact Freely!"
exit
echo "Skipping deb, use make-deb.sh instead"
echo -n "Building deb..........."
debdir=bin/deb/silentdragon-v$APP_VERSION
mkdir -p $debdir > /dev/null
@ -139,6 +190,8 @@ cp $debdir.deb artifacts/linux-deb-silentdragon-v$APP_VERSION.de
echo "[OK]"
echo "Skipping windows"
exit
echo ""
echo "[Windows]"

19
src/sendtab.cpp

@ -708,12 +708,25 @@ void MainWindow::sendButton() {
// Show a dialog to confirm the Tx
if (confirmTx(tx)) {
// Create a new Dialog to show that we are computing/sending the Tx
// Create a new Dialog to show that we are computing/sending the Tx
auto d = new QDialog(this);
auto connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QPixmap logo(":/img/res/logobig.gif");
connD->topIcon->setBasePixmap(logo.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation));
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "dark" || "midnight") {
movie2->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie1);
movie1->start();
}
//connD->topIcon->setBasePixmap(logo.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation));
connD->status->setText(tr("Please wait..."));
connD->statusDetail->setText(tr("Computing your transaction"));

2
src/settings.cpp

@ -62,7 +62,7 @@ Config Settings::getSettings() {
auto port = s.value("connection/port").toString();
auto username = s.value("connection/rpcuser").toString();
auto password = s.value("connection/rpcpassword").toString();
return Config{host, port, username, password};
}

807
src/settings.ui

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>504</height>
<width>623</width>
<height>653</height>
</rect>
</property>
<property name="minimumSize">
@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -161,7 +161,6 @@
</property>
</widget>
</item>
<item row="16" column="0">
<widget class="QLabel" name="label_20">
<property name="sizePolicy">
@ -178,241 +177,231 @@
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QComboBox" name="comboBoxCurrency">
<property name="geometry">
<rect>
<x>80</x>
<y>150</y>
<width>80</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>AED</string>
</property>
</item>
<item>
<property name="text">
<string>ARS</string>
</property>
</item>
<item>
<property name="text">
<string>AUD</string>
</property>
</item>
<item>
<property name="text">
<string>BDT</string>
</property>
</item>
<item>
<property name="text">
<string>BHD</string>
</property>
</item>
<item>
<property name="text">
<string>BMD</string>
</property>
</item>
<item>
<property name="text">
<string>BRL</string>
</property>
</item>
<item>
<property name="text">
<string>BTC</string>
</property>
</item>
<item>
<property name="text">
<string>CAD</string>
</property>
</item>
<item>
<property name="text">
<string>CHF</string>
</property>
</item>
<item>
<property name="text">
<string>CLP</string>
</property>
</item>
<item>
<property name="text">
<string>CNY</string>
</property>
</item>
<item>
<property name="text">
<string>CZK</string>
</property>
</item>
<item>
<property name="text">
<string>DKK</string>
</property>
</item>
<item>
<property name="text">
<string>EUR</string>
</property>
</item>
<item>
<property name="text">
<string>GBP</string>
</property>
</item>
<item>
<property name="text">
<string>HKD</string>
</property>
</item>
<item>
<property name="text">
<string>HUF</string>
</property>
</item>
<item>
<property name="text">
<string>IDR</string>
</property>
</item>
<item>
<property name="text">
<string>ILS</string>
</property>
</item>
<item>
<property name="text">
<string>INR</string>
</property>
</item>
<item>
<property name="text">
<string>JPY</string>
</property>
</item>
<item>
<property name="text">
<string>KRW</string>
</property>
</item>
<item>
<property name="text">
<string>KWD</string>
</property>
</item>
<item>
<property name="text">
<string>LKR</string>
</property>
</item>
<item>
<property name="text">
<string>PKR</string>
</property>
</item>
<item>
<property name="text">
<string>MXN</string>
</property>
</item>
<item>
<property name="text">
<string>NOK</string>
</property>
</item>
<item>
<property name="text">
<string>NZD</string>
</property>
</item>
<item>
<property name="text">
<string>RUB</string>
</property>
</item>
<item>
<property name="text">
<string>SAR</string>
</property>
</item>
<item>
<property name="text">
<string>SEK</string>
</property>
</item>
<item>
<property name="text">
<string>SGD</string>
</property>
</item>
<item>
<property name="text">
<string>THB</string>
</property>
</item>
<item>
<property name="text">
<string>TRY</string>
</property>
</item>
<item>
<property name="text">
<string>TWD</string>
</property>
</item>
<item>
<property name="text">
<string>UAH</string>
</property>
</item>
<item>
<property name="text">
<string>USD</string>
</property>
</item>
<item>
<property name="text">
<string>VEF</string>
</property>
</item>
<item>
<property name="text">
<string>VND</string>
</property>
</item>
<item>
<property name="text">
<string>XAG</string>
</property>
</item>
<item>
<property name="text">
<string>XAU</string>
</property>
</item>
<item>
<property name="text">
<string>ZAR</string>
</property>
<widget class="QComboBox" name="comboBoxCurrency">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>AED</string>
</property>
</item>
<item>
<property name="text">
<string>ARS</string>
</property>
</item>
<item>
<property name="text">
<string>AUD</string>
</property>
</item>
<item>
<property name="text">
<string>BDT</string>
</property>
</item>
<item>
<property name="text">
<string>BHD</string>
</property>
</item>
<item>
<property name="text">
<string>BMD</string>
</property>
</item>
<item>
<property name="text">
<string>BRL</string>
</property>
</item>
<item>
<property name="text">
<string>BTC</string>
</property>
</item>
<item>
<property name="text">
<string>CAD</string>
</property>
</item>
<item>
<property name="text">
<string>CHF</string>
</property>
</item>
<item>
<property name="text">
<string>CLP</string>
</property>
</item>
<item>
<property name="text">
<string>CNY</string>
</property>
</item>
<item>
<property name="text">
<string>CZK</string>
</property>
</item>
<item>
<property name="text">
<string>DKK</string>
</property>
</item>
<item>
<property name="text">
<string>EUR</string>
</property>
</item>
<item>
<property name="text">
<string>GBP</string>
</property>
</item>
<item>
<property name="text">
<string>HKD</string>
</property>
</item>
<item>
<property name="text">
<string>HUF</string>
</property>
</item>
<item>
<property name="text">
<string>IDR</string>
</property>
</item>
<item>
<property name="text">
<string>ILS</string>
</property>
</item>
<item>
<property name="text">
<string>INR</string>
</property>
</item>
<item>
<property name="text">
<string>JPY</string>
</property>
</item>
<item>
<property name="text">
<string>KRW</string>
</property>
</item>
<item>
<property name="text">
<string>KWD</string>
</property>
</item>
<item>
<property name="text">
<string>LKR</string>
</property>
</item>
<item>
<property name="text">
<string>PKR</string>
</property>
</item>
<item>
<property name="text">
<string>MXN</string>
</property>
</item>
<item>
<property name="text">
<string>NOK</string>
</property>
</item>
<item>
<property name="text">
<string>NZD</string>
</property>
</item>
<item>
<property name="text">
<string>RUB</string>
</property>
</item>
<item>
<property name="text">
<string>SAR</string>
</property>
</item>
<item>
<property name="text">
<string>SEK</string>
</property>
</item>
<item>
<property name="text">
<string>SGD</string>
</property>
</item>
<item>
<property name="text">
<string>THB</string>
</property>
</item>
<item>
<property name="text">
<string>TRY</string>
</property>
</item>
<item>
<property name="text">
<string>TWD</string>
</property>
</item>
<item>
<property name="text">
<string>UAH</string>
</property>
</item>
<item>
<property name="text">
<string>USD</string>
</property>
</item>
<item>
<property name="text">
<string>VEF</string>
</property>
</item>
<item>
<property name="text">
<string>VND</string>
</property>
</item>
<item>
<property name="text">
<string>XAG</string>
</property>
</item>
<item>
<property name="text">
<string>XAU</string>
</property>
</item>
<item>
<property name="text">
<string>ZAR</string>
</property>
</item>
</widget>
</item>
</widget>
</item>
<item row="15" column="1">
<widget class="QComboBox" name="comboBoxTheme">
<property name="sizePolicy">
@ -441,6 +430,11 @@
<string>dark</string>
</property>
</item>
<item>
<property name="text">
<string>midnight</string>
</property>
</item>
</widget>
</item>
<item row="14" column="0" colspan="2">
@ -707,83 +701,268 @@
<attribute name="title">
<string>Troubleshooting</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="0">
<widget class="QCheckBox" name="chkReindex">
<property name="text">
<string>Reindex</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Rescan the blockchain for any missing wallet transactions and to correct your wallet balance. This may take several hours. You need to restart SilentDragon for this to take effect</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkRescan">
<property name="text">
<string>Rescan</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="9" 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="2" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Rebuild the entire blockchain from the genesis block, by rescanning all the block files. This may take several hours to days, depending on your hardware. You need to restart SilentDragon for this to take effect</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
<widget class="QCheckBox" name="chkReindex">
<property name="geometry">
<rect>
<x>9</x>
<y>118</y>
<width>81</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Reindex</string>
</property>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>9</x>
<y>38</y>
<width>583</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>Rescan the blockchain for any missing wallet transactions and to correct your wallet balance. This may take several hours. You need to restart SilentDragon for this to take effect</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="chkRescan">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>73</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Rescan</string>
</property>
</widget>
<widget class="Line" name="line_3">
<property name="geometry">
<rect>
<x>9</x>
<y>102</y>
<width>583</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="label_12">
<property name="geometry">
<rect>
<x>9</x>
<y>95</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>9</x>
<y>147</y>
<width>583</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>Rebuild the entire blockchain from the genesis block, by rescanning all the block files. This may take several hours to days, depending on your hardware. You need to restart SilentDragon for this to take effect</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="Line" name="line_4">
<property name="geometry">
<rect>
<x>10</x>
<y>210</y>
<width>583</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="label_13">
<property name="geometry">
<rect>
<x>9</x>
<y>204</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_18">
<property name="geometry">
<rect>
<x>10</x>
<y>260</y>
<width>583</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>This code can greatly reduce the size of wallets and increase performance for service providers. It's designed mostly for exchanges and mining pools but anybody with a large wallet will benefit.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_19">
<property name="geometry">
<rect>
<x>10</x>
<y>369</y>
<width>583</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>Enable Old Transaction Deletion</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="Line" name="line_6">
<property name="geometry">
<rect>
<x>10</x>
<y>324</y>
<width>583</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QCheckBox" name="chkConso">
<property name="geometry">
<rect>
<x>10</x>
<y>230</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Consolidation</string>
</property>
</widget>
<widget class="QCheckBox" name="chkDeletetx">
<property name="geometry">
<rect>
<x>10</x>
<y>340</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Deletetx</string>
</property>
</widget>
<widget class="Line" name="line_7">
<property name="geometry">
<rect>
<x>10</x>
<y>410</y>
<width>583</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="label_21">
<property name="geometry">
<rect>
<x>10</x>
<y>460</y>
<width>583</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>The new experimental Shielded Index (-zindex) which keeps track of many stats that can be seen via the new getchaintxstats RPC. These include shielded payments, anonymity set size and many other things.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="chkzindex">
<property name="geometry">
<rect>
<x>10</x>
<y>430</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Zindex </string>
</property>
</widget>
<widget class="QLabel" name="WalletSize">
<property name="geometry">
<rect>
<x>330</x>
<y>550</y>
<width>51</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>100</string>
</property>
</widget>
<widget class="QLabel" name="label_22">
<property name="geometry">
<rect>
<x>210</x>
<y>550</y>
<width>111</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Wallet.dat Size :</string>
</property>
</widget>
<widget class="QLabel" name="label_46">
<property name="geometry">
<rect>
<x>370</x>
<y>550</y>
<width>41</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>MB</string>
</property>
</widget>
</widget>
</widget>
</item>

2
src/version.h

@ -1 +1 @@
#define APP_VERSION "0.9.0"
#define APP_VERSION "0.9.1"

78
src/viewkey.ui

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ViewKey</class>
<widget class="QDialog" name="ViewKey">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>461</width>
<height>389</height>
</rect>
</property>
<property name="windowTitle">
<string>Viewing Key</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QPlainTextEdit" name="viewKeyTxt">
<property name="plainText">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok|QDialogButtonBox::Save</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="helpLbl">
<property name="text">
<string notr="true">Viewing Keys. Keep Secure!</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ViewKey</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ViewKey</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

8
src/websockets.cpp

@ -538,7 +538,7 @@ QString AppDataServer::encryptOutgoing(QString msg) {
/**
Attempt to decrypt a message. If the decryption fails, it returns the string "error", the decrypted message otherwise.
It will use the given secret to attempt decryption. In addition, it will enforce that the nonce is greater than the last seen nonce,
unless the skipNonceCheck = true, which is used when attempting decrtption with a temp secret key.
unless the skipNonceCheck = true, which is used when attempting decrytption with a temp secret key.
*/
QString AppDataServer::decryptMessage(QJsonDocument msg, QString secretHex, QString lastRemoteNonceHex) {
qDebug() << "Decrypting message";
@ -547,8 +547,9 @@ QString AppDataServer::decryptMessage(QJsonDocument msg, QString secretHex, QStr
QString encryptedhex = msg.object().value("payload").toString();
// Enforce limits on the size of the message
if (noncehex.length() > ((int)crypto_secretbox_NONCEBYTES * 2) ||
encryptedhex.length() > 2 * 50 * 1024 /*50kb*/) {
int MAX_LENGTH = 2*50*1024; // 50kb
if (noncehex.length() > ((int)crypto_secretbox_NONCEBYTES * 2) || encryptedhex.length() > MAX_LENGTH) {
qDebug() << "Encrypted hex size of " << encryptedhex.length() << " bytes is too large!";
return "error";
}
@ -566,6 +567,7 @@ QString AppDataServer::decryptMessage(QJsonDocument msg, QString secretHex, QStr
// Refuse to accept a lower nonce, return an error
delete[] lastRemoteBin;
delete[] noncebin;
qDebug() << "Repeated nonce detected, potential attack or misconfiguration! Bailing out.";
return "error";
}

2055
zec_qt_wallet_pt.ts

File diff suppressed because it is too large
Loading…
Cancel
Save