rebranding to SD

This commit is contained in:
DenioD
2019-10-22 00:46:02 +02:00
parent 2cad22d67e
commit 08a5e3ffca
52 changed files with 1486 additions and 1486 deletions

View File

@@ -132,7 +132,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target) {
// Test if address is valid.
if (!Settings::isValidAddress(addr)) {
QMessageBox::critical(parent, QObject::tr("Address Format Error"),
QObject::tr("%1 doesn't seem to be a valid Zcash address.")
QObject::tr("%1 doesn't seem to be a valid hush address.")
.arg(addr),
QMessageBox::Ok);
return;

View File

@@ -180,7 +180,7 @@
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>zcashd doesn't seem to have any peers. You might not be connected to the internet, so this transaction might not work.</string>
<string>hushd doesn't seem to have any peers. You might not be connected to the internet, so this transaction might not work.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@@ -2,7 +2,7 @@
#include "mainwindow.h"
#include "settings.h"
#include "ui_connection.h"
#include "ui_createzcashconfdialog.h"
#include "ui_createhushconfdialog.h"
#include "controller.h"
#include "../lib/silentdragonlitelib.h"
@@ -38,7 +38,7 @@ void ConnectionLoader::doAutoConnect() {
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
config->dangerous = true;
config->server = QString("https://127.0.0.1:9069");
config->server = QString("127.0.0.1:9069");
// Initialize the library
main->logger->write(QObject::tr("Attempting to initialize"));

View File

@@ -26,7 +26,7 @@ public:
void loadConnection();
private:
std::shared_ptr<ConnectionConfig> autoDetectZcashConf();
std::shared_ptr<ConnectionConfig> autoDetecthushConf();
std::shared_ptr<ConnectionConfig> loadFromSettings();
Connection* makeConnection(std::shared_ptr<ConnectionConfig> config);
@@ -95,7 +95,7 @@ private:
};
/**
* Represents a connection to a zcashd. It may even start a new zcashd if needed.
* Represents a connection to a hushd. It may even start a new hushd if needed.
* This is also a UI class, so it may show a dialog waiting for the connection.
*/
class Connection : public QObject {

View File

@@ -42,7 +42,7 @@ Controller::Controller(MainWindow* main) {
// Create the data model
model = new DataModel();
// Crate the ZcashdRPC
// Crate the hushdRPC
zrpc = new LiteInterface();
}
@@ -58,7 +58,7 @@ Controller::~Controller() {
}
// Called when a connection to zcashd is available.
// Called when a connection to hushd is available.
void Controller::setConnection(Connection* c) {
if (c == nullptr) return;
@@ -66,10 +66,10 @@ void Controller::setConnection(Connection* c) {
ui->statusBar->showMessage("Ready!");
// See if we need to remove the reindex/rescan flags from the zcash.conf file
auto zcashConfLocation = Settings::getInstance()->getZcashdConfLocation();
Settings::removeFromZcashConf(zcashConfLocation, "rescan");
Settings::removeFromZcashConf(zcashConfLocation, "reindex");
// See if we need to remove the reindex/rescan flags from the hush.conf file
auto hushConfLocation = Settings::getInstance()->gethushdConfLocation();
Settings::removeFromhushConf(hushConfLocation, "rescan");
Settings::removeFromhushConf(hushConfLocation, "reindex");
// If we're allowed to get the hush Price, get the prices
if (Settings::getInstance()->getAllowFetchPrices())
@@ -141,7 +141,7 @@ void Controller::noConnection() {
ui->inputsCombo->clear();
}
/// This will refresh all the balance data from zcashd
/// This will refresh all the balance data from hushd
void Controller::refresh(bool force) {
if (!zrpc->haveConnection())
return noConnection();
@@ -178,7 +178,7 @@ void Controller::getInfoThenRefresh(bool force) {
model->setLatestBlock(curBlock);
//int version = reply["version"].get<json::string_t>();
int version = 1;
Settings::getInstance()->setZcashdVersion(version);
Settings::getInstance()->sethushdVersion(version);
// See if recurring payments needs anything
Recurring::getInstance()->processPending(main);
@@ -192,14 +192,14 @@ void Controller::getInfoThenRefresh(bool force) {
refreshTransactions();
}
}, [=](QString err) {
// zcashd has probably disappeared.
// hushd has probably disappeared.
this->noConnection();
// Prevent multiple dialog boxes, because these are called async
static bool shown = false;
if (!shown && prevCallSucceeded) { // show error only first time
shown = true;
QMessageBox::critical(main, QObject::tr("Connection Error"), QObject::tr("There was an error connecting to zcashd. The error was") + ": \n\n"
QMessageBox::critical(main, QObject::tr("Connection Error"), QObject::tr("There was an error connecting to hushd. The error was") + ": \n\n"
+ err, QMessageBox::StandardButton::Ok);
shown = false;
}
@@ -434,7 +434,7 @@ void Controller::checkForUpdate(bool silent) {
if (!zrpc->haveConnection())
return noConnection();
QUrl cmcURL("https://api.github.com/repos/ZcashFoundation/silentdragon/releases");
QUrl cmcURL("https://api.github.com/repos/hushFoundation/silentdragon/releases");
QNetworkRequest req;
req.setUrl(cmcURL);
@@ -482,7 +482,7 @@ void Controller::checkForUpdate(bool silent) {
.arg(currentVersion.toString()),
QMessageBox::Yes, QMessageBox::Cancel);
if (ans == QMessageBox::Yes) {
QDesktopServices::openUrl(QUrl("https://github.com/ZcashFoundation/silentdragon/releases"));
QDesktopServices::openUrl(QUrl("https://github.com/hushFoundation/silentdragon/releases"));
} else {
// If the user selects cancel, don't bother them again for this version
s.setValue("update/lastversion", maxVersion.toString());
@@ -559,10 +559,10 @@ void Controller::refreshhushPrice() {
});
}
void Controller::shutdownZcashd() {
// Shutdown embedded zcashd if it was started
if (ezcashd == nullptr || ezcashd->processId() == 0 || !zrpc->haveConnection()) {
// No zcashd running internally, just return
void Controller::shutdownhushd() {
// Shutdown embedded hushd if it was started
if (ehushd == nullptr || ehushd->processId() == 0 || !zrpc->haveConnection()) {
// No hushd running internally, just return
return;
}
@@ -580,7 +580,7 @@ void Controller::shutdownZcashd() {
// connD.setupUi(&d);
// connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));
// connD.status->setText(QObject::tr("Please wait for silentdragon to exit"));
// connD.statusDetail->setText(QObject::tr("Waiting for zcashd to exit"));
// connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit"));
// QTimer waiter(main);
@@ -590,9 +590,9 @@ void Controller::shutdownZcashd() {
// QObject::connect(&waiter, &QTimer::timeout, [&] () {
// waitCount++;
// if ((ezcashd->atEnd() && ezcashd->processId() == 0) ||
// if ((ehushd->atEnd() && ehushd->processId() == 0) ||
// waitCount > 30 ||
// getConnection()->config->zcashDaemon) { // If zcashd is daemon, then we don't have to do anything else
// getConnection()->config->hushDaemon) { // If hushd is daemon, then we don't have to do anything else
// qDebug() << "Ended";
// waiter.stop();
// QTimer::singleShot(1000, [&]() { d.accept(); });
@@ -602,7 +602,7 @@ void Controller::shutdownZcashd() {
// });
// waiter.start(1000);
// // Wait for the zcash process to exit.
// // Wait for the hush process to exit.
// if (!Settings::getInstance()->isHeadless()) {
// d.exec();
// } else {

View File

@@ -21,7 +21,7 @@ struct WatchedTx {
};
struct MigrationStatus {
bool available; // Whether the underlying zcashd supports migration?
bool available; // Whether the underlying hushd supports migration?
bool enabled;
QString saplingAddress;
double unmigrated;
@@ -57,9 +57,9 @@ public:
const TxTableModel* getTransactionsModel() { return transactionsTableModel; }
void shutdownZcashd();
void shutdownhushd();
void noConnection();
bool isEmbedded() { return ezcashd != nullptr; }
bool isEmbedded() { return ehushd != nullptr; }
void createNewZaddr(bool sapling, const std::function<void(json)>& cb) { zrpc->createNewZaddr(sapling, cb); }
void createNewTaddr(const std::function<void(json)>& cb) { zrpc->createNewTaddr(cb); }
@@ -83,7 +83,7 @@ private:
void getInfoThenRefresh(bool force);
QProcess* ezcashd = nullptr;
QProcess* ehushd = nullptr;
TxTableModel* transactionsTableModel = nullptr;
BalancesTableModel* balancesTableModel = nullptr;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>createZcashConf</class>
<widget class="QDialog" name="createZcashConf">
<class>createhushConf</class>
<widget class="QDialog" name="createhushConf">
<property name="geometry">
<rect>
<x>0</x>
@@ -11,13 +11,13 @@
</rect>
</property>
<property name="windowTitle">
<string>Configure zcash.conf</string>
<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 zcash node will be configured for you automatically</string>
<string>Your hush node will be configured for you automatically</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -239,7 +239,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>createZcashConf</receiver>
<receiver>createhushConf</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -255,7 +255,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>createZcashConf</receiver>
<receiver>createhushConf</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">

View File

@@ -1,5 +1,5 @@
#ifndef ZCASHDRPC_H
#define ZCASHDRPC_H
#ifndef hushDRPC_H
#define hushDRPC_H
#include "precompiled.h"
@@ -61,4 +61,4 @@ private:
Connection* conn = nullptr;
};
#endif // ZCASHDRPC_H
#endif // hushDRPC_H

View File

@@ -147,20 +147,20 @@ public:
// Command line parser
QCommandLineParser parser;
parser.setApplicationDescription("Shielded desktop light wallet for Zcash");
parser.setApplicationDescription("Shielded desktop light wallet for hush");
parser.addHelpOption();
// Add an option to specify the conf file
QCommandLineOption confOption(QStringList() << "conf", "Use the zcash.conf specified instead of looking for the default one.",
QCommandLineOption confOption(QStringList() << "conf", "Use the hush.conf specified instead of looking for the default one.",
"confFile");
parser.addOption(confOption);
// Positional argument will specify a zcash payment URI
parser.addPositionalArgument("zcashURI", "An optional zcash URI to pay");
// 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());
@@ -210,7 +210,7 @@ public:
// Check to see if a conf location was specified
if (parser.isSet(confOption)) {
Settings::getInstance()->setUsingZcashConf(parser.value(confOption));
Settings::getInstance()->setUsinghushConf(parser.value(confOption));
}
w = new MainWindow();
@@ -218,15 +218,15 @@ public:
// If there was a payment URI on the command line, pay it
if (parser.positionalArguments().length() > 0) {
w->payZcashURI(parser.positionalArguments()[0]);
w->payhushURI(parser.positionalArguments()[0]);
}
// Listen for any secondary instances telling us about a 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);
// We need to execute this async, otherwise the app seems to crash for some reason.
QTimer::singleShot(1, [=]() { w->payZcashURI(uri); });
QTimer::singleShot(1, [=]() { w->payhushURI(uri); });
});
// For MacOS, we have an event filter

View File

@@ -55,7 +55,7 @@ MainWindow::MainWindow(QWidget *parent) :
// File a bug
QObject::connect(ui->actionFile_a_bug, &QAction::triggered, [=]() {
QDesktopServices::openUrl(QUrl("https://github.com/zcashfoundation/silentdragon/issues/new"));
QDesktopServices::openUrl(QUrl("https://github.com/hushfoundation/silentdragon/issues/new"));
});
// Set up check for updates action
@@ -69,14 +69,14 @@ MainWindow::MainWindow(QWidget *parent) :
Recurring::getInstance()->showRecurringDialog(this);
});
// Request zcash
QObject::connect(ui->actionRequest_zcash, &QAction::triggered, [=]() {
RequestDialog::showRequestZcash(this);
// Request hush
QObject::connect(ui->actionRequest_hush, &QAction::triggered, [=]() {
RequestDialog::showRequesthush(this);
});
// Pay Zcash URI
// Pay hush URI
QObject::connect(ui->actionPay_URI, &QAction::triggered, [=] () {
payZcashURI();
payhushURI();
});
// Export All Private Keys
@@ -116,15 +116,15 @@ MainWindow::MainWindow(QWidget *parent) :
ui->tabWidget->setCurrentIndex(0);
// The zcashd tab is hidden by default, and only later added in if the embedded zcashd is started
zcashdtab = ui->tabWidget->widget(4);
// The hushd tab is hidden by default, and only later added in if the embedded hushd is started
hushdtab = ui->tabWidget->widget(4);
ui->tabWidget->removeTab(4);
setupSendTab();
setupTransactionsTab();
setupReceiveTab();
setupBalancesTab();
setupZcashdTab();
setuphushdTab();
rpc = new Controller(this);
@@ -198,7 +198,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
s.sync();
// Let the RPC know to shut down any running service.
rpc->shutdownZcashd();
rpc->shutdownhushd();
// Bubble up
if (event)
@@ -296,17 +296,17 @@ void MainWindow::setupSettingsModal() {
QIntValidator validator(0, 65535);
settings.port->setValidator(&validator);
// If values are coming from zcash.conf, then disable all the fields
auto zcashConfLocation = Settings::getInstance()->getZcashdConfLocation();
if (!zcashConfLocation.isEmpty()) {
settings.confMsg->setText("Settings are being read from \n" + zcashConfLocation);
// If values are coming from hush.conf, then disable all the fields
auto hushConfLocation = Settings::getInstance()->gethushdConfLocation();
if (!hushConfLocation.isEmpty()) {
settings.confMsg->setText("Settings are being read from \n" + hushConfLocation);
settings.hostname->setEnabled(false);
settings.port->setEnabled(false);
settings.rpcuser->setEnabled(false);
settings.rpcpassword->setEnabled(false);
}
else {
settings.confMsg->setText("No local zcash.conf found. Please configure connection manually.");
settings.confMsg->setText("No local hush.conf found. Please configure connection manually.");
settings.hostname->setEnabled(true);
settings.port->setEnabled(true);
settings.rpcuser->setEnabled(true);
@@ -323,13 +323,13 @@ void MainWindow::setupSettingsModal() {
// Connection tab by default
settings.tabWidget->setCurrentIndex(0);
// Enable the troubleshooting options only if using embedded zcashd
// Enable the troubleshooting options only if using embedded hushd
if (!rpc->isEmbedded()) {
settings.chkRescan->setEnabled(false);
settings.chkRescan->setToolTip(tr("You're using an external zcashd. Please restart zcashd with -rescan"));
settings.chkRescan->setToolTip(tr("You're using an external hushd. Please restart hushd with -rescan"));
settings.chkReindex->setEnabled(false);
settings.chkReindex->setToolTip(tr("You're using an external zcashd. Please restart zcashd with -reindex"));
settings.chkReindex->setToolTip(tr("You're using an external hushd. Please restart hushd with -reindex"));
}
if (settingsDialog.exec() == QDialog::Accepted) {
@@ -351,7 +351,7 @@ void MainWindow::setupSettingsModal() {
if (!isUsingTor && settings.chkTor->isChecked()) {
// If "use tor" was previously unchecked and now checked
Settings::addToZcashConf(zcashConfLocation, "proxy=127.0.0.1:9050");
Settings::addTohushConf(hushConfLocation, "proxy=127.0.0.1:9050");
rpc->getConnection()->config->proxy = "proxy=127.0.0.1:9050";
QMessageBox::information(this, tr("Enable Tor"),
@@ -361,7 +361,7 @@ void MainWindow::setupSettingsModal() {
if (isUsingTor && !settings.chkTor->isChecked()) {
// If "use tor" was previously checked and now is unchecked
Settings::removeFromZcashConf(zcashConfLocation, "proxy");
Settings::removeFromhushConf(hushConfLocation, "proxy");
rpc->getConnection()->config->proxy.clear();
QMessageBox::information(this, tr("Disable Tor"),
@@ -369,7 +369,7 @@ void MainWindow::setupSettingsModal() {
QMessageBox::Ok);
}
if (zcashConfLocation.isEmpty()) {
if (hushConfLocation.isEmpty()) {
// Save settings
Settings::getInstance()->saveSettings(
settings.hostname->text(),
@@ -384,12 +384,12 @@ void MainWindow::setupSettingsModal() {
// Check to see if rescan or reindex have been enabled
bool showRestartInfo = false;
if (settings.chkRescan->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "rescan=1");
Settings::addTohushConf(hushConfLocation, "rescan=1");
showRestartInfo = true;
}
if (settings.chkReindex->isChecked()) {
Settings::addToZcashConf(zcashConfLocation, "reindex=1");
Settings::addTohushConf(hushConfLocation, "reindex=1");
showRestartInfo = true;
}
@@ -472,8 +472,8 @@ void MainWindow::balancesReady() {
// There is a pending URI payment (from the command line, or from a secondary instance),
// process it.
if (!pendingURIPayment.isEmpty()) {
qDebug() << "Paying zcash URI";
payZcashURI(pendingURIPayment);
qDebug() << "Paying hush URI";
payhushURI(pendingURIPayment);
pendingURIPayment = "";
}
@@ -486,7 +486,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) {
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *fileEvent = static_cast<QFileOpenEvent*>(event);
if (!fileEvent->url().isEmpty())
payZcashURI(fileEvent->url().toString());
payhushURI(fileEvent->url().toString());
return true;
}
@@ -495,10 +495,10 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) {
}
// Pay the Zcash URI by showing a confirmation window. If the URI parameter is empty, the UI
// Pay the hush URI by showing a confirmation window. If the URI parameter is empty, the UI
// will prompt for one. If the myAddr is empty, then the default from address is used to send
// the transaction.
void MainWindow::payZcashURI(QString uri, QString myAddr) {
void MainWindow::payhushURI(QString uri, QString myAddr) {
// If the Payments UI is not ready (i.e, all balances have not loaded), defer the payment URI
if (!isPaymentsReady()) {
qDebug() << "Payment UI not ready, waiting for UI to pay URI";
@@ -508,8 +508,8 @@ void MainWindow::payZcashURI(QString uri, QString myAddr) {
// If there was no URI passed, ask the user for one.
if (uri.isEmpty()) {
uri = QInputDialog::getText(this, tr("Paste Zcash URI"),
"Zcash URI" + QString(" ").repeated(180));
uri = QInputDialog::getText(this, tr("Paste hush URI"),
"hush URI" + QString(" ").repeated(180));
}
// If there's no URI, just exit
@@ -520,8 +520,8 @@ void MainWindow::payZcashURI(QString uri, QString myAddr) {
qDebug() << "Received URI " << uri;
PaymentURI paymentInfo = Settings::parseURI(uri);
if (!paymentInfo.error.isEmpty()) {
QMessageBox::critical(this, tr("Error paying zcash URI"),
tr("URI should be of the form 'zcash:<addr>?amt=x&memo=y") + "\n" + paymentInfo.error);
QMessageBox::critical(this, tr("Error paying hush URI"),
tr("URI should be of the form 'hush:<addr>?amt=x&memo=y") + "\n" + paymentInfo.error);
return;
}
@@ -558,7 +558,7 @@ void MainWindow::payZcashURI(QString uri, QString myAddr) {
// pui.buttonBox->button(QDialogButtonBox::Save)->setVisible(false);
// pui.helpLbl->setText(QString() %
// tr("Please paste your private keys (z-Addr or t-Addr) here, one per line") % ".\n" %
// tr("The keys will be imported into your connected zcashd node"));
// tr("The keys will be imported into your connected hushd node"));
// if (d.exec() == QDialog::Accepted && !pui.privKeyTxt->toPlainText().trimmed().isEmpty()) {
// auto rawkeys = pui.privKeyTxt->toPlainText().trimmed().split("\n");
@@ -599,7 +599,7 @@ void MainWindow::payZcashURI(QString uri, QString myAddr) {
*/
void MainWindow::exportTransactions() {
// First, get the export file name
QString exportName = "zcash-transactions-" + QDateTime::currentDateTime().toString("yyyyMMdd") + ".csv";
QString exportName = "hush-transactions-" + QDateTime::currentDateTime().toString("yyyyMMdd") + ".csv";
QUrl csvName = QFileDialog::getSaveFileUrl(this,
tr("Export transactions"), exportName, "CSV file (*.csv)");
@@ -615,24 +615,24 @@ void MainWindow::exportTransactions() {
/**
* Backup the wallet.dat file. This is kind of a hack, since it has to read from the filesystem rather than an RPC call
* This might fail for various reasons - Remote zcashd, non-standard locations, custom params passed to zcashd, many others
* This might fail for various reasons - Remote hushd, non-standard locations, custom params passed to hushd, many others
*/
void MainWindow::backupWalletDat() {
if (!rpc->getConnection())
return;
// QDir zcashdir(rpc->getConnection()->config->zcashDir);
// QString backupDefaultName = "zcash-wallet-backup-" + QDateTime::currentDateTime().toString("yyyyMMdd") + ".dat";
// QDir hushdir(rpc->getConnection()->config->hushDir);
// QString backupDefaultName = "hush-wallet-backup-" + QDateTime::currentDateTime().toString("yyyyMMdd") + ".dat";
// if (Settings::getInstance()->isTestnet()) {
// zcashdir.cd("testnet3");
// hushdir.cd("testnet3");
// backupDefaultName = "testnet-" + backupDefaultName;
// }
// QFile wallet(zcashdir.filePath("wallet.dat"));
// QFile wallet(hushdir.filePath("wallet.dat"));
// if (!wallet.exists()) {
// QMessageBox::critical(this, tr("No wallet.dat"), tr("Couldn't find the wallet.dat on this computer") + "\n" +
// tr("You need to back it up from the machine zcashd is running on"), QMessageBox::Ok);
// tr("You need to back it up from the machine hushd is running on"), QMessageBox::Ok);
// return;
// }
@@ -680,7 +680,7 @@ void MainWindow::exportKeys(QString addr) {
// Wire up save button
QObject::connect(pui.buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, [=] () {
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
allKeys ? "zcash-all-privatekeys.txt" : "zcash-privatekey.txt");
allKeys ? "hush-all-privatekeys.txt" : "hush-privatekey.txt");
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) {
QMessageBox::information(this, tr("Unable to open file"), file.errorString());
@@ -807,8 +807,8 @@ void MainWindow::setupBalancesTab() {
});
}
void MainWindow::setupZcashdTab() {
ui->zcashdlogo->setBasePixmap(QPixmap(":/img/res/zcashdlogo.gif"));
void MainWindow::setuphushdTab() {
ui->hushdlogo->setBasePixmap(QPixmap(":/img/res/hushdlogo.gif"));
}
void MainWindow::setupTransactionsTab() {
@@ -857,7 +857,7 @@ void MainWindow::setupTransactionsTab() {
});
// Payment Request
if (!memo.isEmpty() && memo.startsWith("zcash:")) {
if (!memo.isEmpty() && memo.startsWith("hush:")) {
menu.addAction(tr("View Payment Request"), [=] () {
RequestDialog::showPaymentConfirmation(this, memo);
});

View File

@@ -55,7 +55,7 @@ public:
void stopWebsocket();
void balancesReady();
void payZcashURI(QString uri = "", QString myAddr = "");
void payhushURI(QString uri = "", QString myAddr = "");
void updateLabels();
void updateTAddrCombo(bool checked);
@@ -72,7 +72,7 @@ public:
QLabel* statusLabel;
QLabel* statusIcon;
QLabel* loadingLabel;
QWidget* zcashdtab;
QWidget* hushdtab;
Logger* logger;
@@ -88,7 +88,7 @@ private:
void setupTransactionsTab();
void setupReceiveTab();
void setupBalancesTab();
void setupZcashdTab();
void setuphushdTab();
void setupSettingsModal();
void setupStatusBar();

View File

@@ -905,13 +905,13 @@
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>zcashd</string>
<string>hushd</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="FilledIconLabel" name="zcashdlogo">
<widget class="FilledIconLabel" name="hushdlogo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -1059,7 +1059,7 @@
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionRequest_zcash"/>
<addaction name="actionRequest_hush"/>
<addaction name="actionPay_URI"/>
<addaction name="separator"/>
<addaction name="actionExport_All_Private_Keys"/>
@@ -1151,7 +1151,7 @@
</action>
<action name="actionPay_URI">
<property name="text">
<string>Pay zcash &amp;URI...</string>
<string>Pay hush &amp;URI...</string>
</property>
</action>
<action name="actionConnect_Mobile_App">
@@ -1167,9 +1167,9 @@
<string>&amp;Recurring Payments</string>
</property>
</action>
<action name="actionRequest_zcash">
<action name="actionRequest_hush">
<property name="text">
<string>Request zcash...</string>
<string>Request hush...</string>
</property>
</action>
<action name="actionFile_a_bug">

View File

@@ -78,7 +78,7 @@
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>If enabled, zcashd will slowly migrate your Sprout shielded funds to your Sapling address. </string>
<string>If enabled, hushd will slowly migrate your Sprout shielded funds to your Sapling address. </string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@@ -47,8 +47,8 @@ void RequestDialog::setupDialog(MainWindow* main, QDialog* d, Ui_RequestDialog*
void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI) {
PaymentURI payInfo = Settings::parseURI(paymentURI);
if (!payInfo.error.isEmpty()) {
QMessageBox::critical(main, tr("Error paying zcash URI"),
tr("URI should be of the form 'zcash:<addr>?amt=x&memo=y") + "\n" + payInfo.error);
QMessageBox::critical(main, tr("Error paying hush URI"),
tr("URI should be of the form 'hush:<addr>?amt=x&memo=y") + "\n" + payInfo.error);
return;
}
@@ -80,12 +80,12 @@ void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI
req.lblHeader->setText(tr("You are paying a payment request. Your address will not be visible to the person requesting this payment."));
if (d.exec() == QDialog::Accepted) {
main->payZcashURI(paymentURI, req.cmbMyAddress->currentText());
main->payhushURI(paymentURI, req.cmbMyAddress->currentText());
}
}
// Static method that shows the request dialog
void RequestDialog::showRequestZcash(MainWindow* main) {
void RequestDialog::showRequesthush(MainWindow* main) {
QDialog d(main);
Ui_RequestDialog req;
@@ -123,17 +123,17 @@ void RequestDialog::showRequestZcash(MainWindow* main) {
req.txtFrom->setFocus();
if (d.exec() == QDialog::Accepted) {
// Construct a zcash Payment URI with the data and pay it immediately.
QString memoURI = "zcash:" + req.cmbMyAddress->currentText()
// Construct a hush Payment URI with the data and pay it immediately.
QString memoURI = "hush:" + req.cmbMyAddress->currentText()
+ "?amt=" + Settings::getDecimalString(req.txtAmount->text().toDouble())
+ "&memo=" + QUrl::toPercentEncoding(req.txtMemo->toPlainText());
QString sendURI = "zcash:" + AddressBook::addressFromAddressLabel(req.txtFrom->text())
QString sendURI = "hush:" + AddressBook::addressFromAddressLabel(req.txtFrom->text())
+ "?amt=0.0001"
+ "&memo=" + QUrl::toPercentEncoding(memoURI);
// If the disclosed address in the memo doesn't have a balance, it will automatically fallback to the default
// sapling address
main->payZcashURI(sendURI, req.cmbMyAddress->currentText());
main->payhushURI(sendURI, req.cmbMyAddress->currentText());
}
}

View File

@@ -17,7 +17,7 @@ public:
explicit RequestDialog(QWidget *parent = nullptr);
~RequestDialog();
static void showRequestZcash(MainWindow* main);
static void showRequesthush(MainWindow* main);
static void showPaymentConfirmation(MainWindow* main, QString paymentURI);
static void setupDialog(MainWindow* main, QDialog* d, Ui_RequestDialog* req);
private:

View File

@@ -216,7 +216,7 @@
<item row="0" column="2" colspan="2">
<widget class="QLabel" name="lblHeader">
<property name="text">
<string>Request payment from a Sapling address. You'll send a hush 0.0001 transaction to the address with a zcash payment URI. The memo will be included in the transaction when the address pays you.</string>
<string>Request payment from a Sapling address. You'll send a hush 0.0001 transaction to the address with a hush payment URI. The memo will be included in the transaction when the address pays you.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@@ -3,7 +3,7 @@ Version: RELEASE_VERSION
Section: base
Priority: optional
Architecture: amd64
Maintainer: Aditya Kulkarni <zcash@adityapk.com>
Description: silentdragon is a full node and UI wallet for Zcash.
silentdragon is a full node and UI wallet for Zcash. It comes with
full support for shielded addresses and many apps for Zcash.
Maintainer: Aditya Kulkarni <hush@adityapk.com>
Description: silentdragon is a full node and UI wallet for hush.
silentdragon is a full node and UI wallet for hush. It comes with
full support for shielded addresses and many apps for hush.

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Name=silentdragon
Comment=Full node and wallet for Zcash
Comment=Full node and wallet for hush
GenericName=Wallet
Exec=/usr/local/bin/silentdragon %u
Icon=silentdragon.xpm
@@ -8,6 +8,6 @@ Type=Application
StartupNotify=true
StartupWMClass=silentdragon
Categories=Utility;
MimeType=x-scheme-handler/zcash;
MimeType=x-scheme-handler/hush;
Keywords=silentdragon;

View File

@@ -27,7 +27,7 @@ Write-Host ""
Write-Host "[Building on Mac]"
bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --zcash_path ~/prod/zcash
bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --hush_path ~/prod/hush
if (! $?) {
Write-Output "[Error]"
exit 1;

View File

@@ -12,8 +12,8 @@ case $key in
shift # past argument
shift # past value
;;
-z|--zcash_path)
ZCASH_DIR="$2"
-z|--hush_path)
hush_DIR="$2"
shift # past argument
shift # past value
;;
@@ -35,8 +35,8 @@ if [ -z $QT_PATH ]; then
exit 1;
fi
if [ -z $ZCASH_DIR ]; then
echo "ZCASH_DIR is not set. Please set it to the base directory of a compiled zcashd";
if [ -z $hush_DIR ]; then
echo "hush_DIR is not set. Please set it to the base directory of a compiled hushd";
exit 1;
fi
@@ -45,8 +45,8 @@ if [ -z $APP_VERSION ]; then
exit 1;
fi
if [ ! -f $ZCASH_DIR/src/zcashd ]; then
echo "Could not find compiled zcashd in $ZCASH_DIR/src/.";
if [ ! -f $hush_DIR/src/hushd ]; then
echo "Could not find compiled hushd in $hush_DIR/src/.";
exit 1;
fi
@@ -80,8 +80,8 @@ echo -n "Deploying.............."
mkdir artifacts >/dev/null 2>&1
rm -f artifcats/silentdragon.dmg >/dev/null 2>&1
rm -f artifacts/rw* >/dev/null 2>&1
cp $ZCASH_DIR/src/zcashd silentdragon.app/Contents/MacOS/
cp $ZCASH_DIR/src/zcash-cli silentdragon.app/Contents/MacOS/
cp $hush_DIR/src/hushd silentdragon.app/Contents/MacOS/
cp $hush_DIR/src/hush-cli silentdragon.app/Contents/MacOS/
$QT_PATH/bin/macdeployqt silentdragon.app
echo "[OK]"

View File

@@ -7,37 +7,37 @@ 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 $ZCASH_DIR ]; then
echo "ZCASH_DIR is not set. Please set it to the base directory of a Zcash project with built Zcash binaries."
if [ -z $hush_DIR ]; then
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 $ZCASH_DIR/artifacts/zcashd ]; then
echo "Couldn't find zcashd in $ZCASH_DIR/artifacts/. Please build zcashd."
if [ ! -f $hush_DIR/artifacts/hushd ]; then
echo "Couldn't find hushd in $hush_DIR/artifacts/. Please build hushd."
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli ]; then
echo "Couldn't find zcash-cli in $ZCASH_DIR/artifacts/. Please build zcashd."
if [ ! -f $hush_DIR/artifacts/hush-cli ]; then
echo "Couldn't find hush-cli in $hush_DIR/artifacts/. Please build hushd."
exit 1;
fi
# Ensure that zcashd is the right build
echo -n "zcashd version........."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd && ! readelf -s $ZCASH_DIR/artifacts/zcashd | grep -q "GLIBC_2\.25"; then
# Ensure that hushd is the right build
echo -n "hushd version........."
if grep -q "zqwMagicBean" $hush_DIR/artifacts/hushd && ! readelf -s $hush_DIR/artifacts/hushd | grep -q "GLIBC_2\.25"; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build or zcashd is built with libc 2.25"
echo "hushd doesn't seem to be a zqwMagicBean build or hushd is built with libc 2.25"
exit 1
fi
echo -n "zcashd.exe version....."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd.exe; then
echo -n "hushd.exe version....."
if grep -q "zqwMagicBean" $hush_DIR/artifacts/hushd.exe; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build"
echo "hushd doesn't seem to be a zqwMagicBean build"
exit 1
fi
@@ -86,8 +86,8 @@ mkdir bin/silentdragon-v$APP_VERSION > /dev/null
strip silentdragon
cp silentdragon bin/silentdragon-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcashd bin/silentdragon-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcash-cli 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 README.md bin/silentdragon-v$APP_VERSION > /dev/null
cp LICENSE bin/silentdragon-v$APP_VERSION > /dev/null
@@ -122,7 +122,7 @@ mkdir -p $debdir/usr/local/bin
cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control
cp silentdragon $debdir/usr/local/bin/
cp $ZCASH_DIR/artifacts/zcashd $debdir/usr/local/bin/zqw-zcashd
cp $hush_DIR/artifacts/hushd $debdir/usr/local/bin/zqw-hushd
mkdir -p $debdir/usr/share/pixmaps/
cp res/silentdragon.xpm $debdir/usr/share/pixmaps/
@@ -145,14 +145,14 @@ if [ -z $MXE_PATH ]; then
exit 0;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcashd.exe ]; then
echo "Couldn't find zcashd.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
if [ ! -f $hush_DIR/artifacts/hushd.exe ]; then
echo "Couldn't find hushd.exe in $hush_DIR/artifacts/. Please build hushd.exe"
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli.exe ]; then
echo "Couldn't find zcash-cli.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
if [ ! -f $hush_DIR/artifacts/hush-cli.exe ]; then
echo "Couldn't find hush-cli.exe in $hush_DIR/artifacts/. Please build hushd.exe"
exit 1;
fi
@@ -176,8 +176,8 @@ echo "[OK]"
echo -n "Packaging.............."
mkdir release/silentdragon-v$APP_VERSION
cp release/silentdragon.exe release/silentdragon-v$APP_VERSION
cp $ZCASH_DIR/artifacts/zcashd.exe release/silentdragon-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcash-cli.exe release/silentdragon-v$APP_VERSION > /dev/null
cp $hush_DIR/artifacts/hushd.exe release/silentdragon-v$APP_VERSION > /dev/null
cp $hush_DIR/artifacts/hush-cli.exe release/silentdragon-v$APP_VERSION > /dev/null
cp README.md release/silentdragon-v$APP_VERSION
cp LICENSE release/silentdragon-v$APP_VERSION
cd release && zip -r Windows-binaries-silentdragon-v$APP_VERSION.zip silentdragon-v$APP_VERSION/ > /dev/null

View File

@@ -10,8 +10,8 @@ New-Item release/wininstaller -itemtype directory | Out-Null
Copy-Item release/$target/silentdragon.exe release/wininstaller/
Copy-Item release/$target/LICENSE release/wininstaller/
Copy-Item release/$target/README.md release/wininstaller/
Copy-Item release/$target/zcashd.exe release/wininstaller/
Copy-Item release/$target/zcash-cli.exe release/wininstaller/
Copy-Item release/$target/hushd.exe release/wininstaller/
Copy-Item release/$target/hush-cli.exe release/wininstaller/
Get-Content src/scripts/hush-qt-wallet.wxs | ForEach-Object { $_ -replace "RELEASE_VERSION", "$version" } | Out-File -Encoding utf8 release/wininstaller/hush-qt-wallet.wxs

View File

@@ -61,13 +61,13 @@
</Shortcut>
</File>
<File Source="LICENSE" />
<File Source="zcashd.exe" />
<File Source="zcash-cli.exe" />
<File Source="hushd.exe" />
<File Source="hush-cli.exe" />
<File Source="README.md" />
<RegistryKey Root="HKCR" Key="zcash">
<RegistryKey Root="HKCR" Key="hush">
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
<RegistryValue Type="string" Value="URL:zcash URI protocol"/>
<RegistryValue Type="string" Value="URL:hush URI protocol"/>
<RegistryKey Key="DefaultIcon">
<RegistryValue Type="string" Value="silentdragon.exe" />
</RegistryKey>

View File

@@ -532,7 +532,7 @@ Tx MainWindow::createTxFromSendPage() {
if (Settings::getInstance()->getAutoShield() && sendChangeToSapling) {
auto saplingAddr = std::find_if(rpc->getModel()->getAllZAddresses().begin(), rpc->getModel()->getAllZAddresses().end(), [=](auto i) -> bool {
// We're finding a sapling address that is not one of the To addresses, because zcash doesn't allow duplicated addresses
// We're finding a sapling address that is not one of the To addresses, because hush doesn't allow duplicated addresses
bool isSapling = Settings::getInstance()->isSaplingAddress(i);
if (!isSapling) return false;

View File

@@ -40,7 +40,7 @@ void Settings::saveSettings(const QString& host, const QString& port, const QStr
init();
}
void Settings::setUsingZcashConf(QString confLocation) {
void Settings::setUsinghushConf(QString confLocation) {
if (!confLocation.isEmpty())
_confLocation = confLocation;
}
@@ -82,12 +82,12 @@ bool Settings::isTAddress(QString addr) {
return addr.startsWith("t");
}
int Settings::getZcashdVersion() {
return _zcashdVersion;
int Settings::gethushdVersion() {
return _hushdVersion;
}
void Settings::setZcashdVersion(int version) {
_zcashdVersion = version;
void Settings::sethushdVersion(int version) {
_hushdVersion = version;
}
bool Settings::isSyncing() {
@@ -268,7 +268,7 @@ QString Settings::getDonationAddr() {
}
bool Settings::addToZcashConf(QString confLocation, QString line) {
bool Settings::addTohushConf(QString confLocation, QString line) {
QFile file(confLocation);
if (!file.open(QIODevice::ReadWrite | QIODevice::Append))
return false;
@@ -281,7 +281,7 @@ bool Settings::addToZcashConf(QString confLocation, QString line) {
return true;
}
bool Settings::removeFromZcashConf(QString confLocation, QString option) {
bool Settings::removeFromhushConf(QString confLocation, QString option) {
if (confLocation.isEmpty())
return false;
@@ -362,12 +362,12 @@ QString Settings::paymentURIPretty(PaymentURI uri) {
PaymentURI Settings::parseURI(QString uri) {
PaymentURI ans;
if (!uri.startsWith("zcash:")) {
ans.error = "Not a zcash payment URI";
if (!uri.startsWith("hush:")) {
ans.error = "Not a HUSH payment URI";
return ans;
}
uri = uri.right(uri.length() - QString("zcash:").length());
uri = uri.right(uri.length() - QString("hush:").length());
QRegExp re("([a-zA-Z0-9]+)");
int pos;

View File

@@ -42,8 +42,8 @@ public:
bool isSyncing();
void setSyncing(bool syncing);
int getZcashdVersion();
void setZcashdVersion(int version);
int gethushdVersion();
void sethushdVersion(int version);
void setUseEmbedded(bool r) { _useEmbedded = r; }
bool useEmbedded() { return _useEmbedded; }
@@ -74,8 +74,8 @@ public:
bool isSaplingActive();
void setUsingZcashConf(QString confLocation);
const QString& getZcashdConfLocation() { return _confLocation; }
void setUsinghushConf(QString confLocation);
const QString& gethushdConfLocation() { return _confLocation; }
void sethushPrice(double p) { hushPrice = p; }
double gethushPrice();
@@ -116,8 +116,8 @@ public:
static bool isValidAddress(QString addr);
static bool addToZcashConf(QString confLocation, QString line);
static bool removeFromZcashConf(QString confLocation, QString option);
static bool addTohushConf(QString confLocation, QString line);
static bool removeFromhushConf(QString confLocation, QString option);
static const QString labelRegExp;
@@ -137,7 +137,7 @@ private:
bool _isTestnet = false;
bool _isSyncing = false;
int _blockNumber = 0;
int _zcashdVersion = 0;
int _hushdVersion = 0;
bool _useEmbedded = false;
bool _headless = false;
int _peerConnections = 0;

View File

@@ -30,7 +30,7 @@
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>zcashd connection</string>
<string>hushd connection</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>

View File

@@ -120,7 +120,7 @@ bool TxTableModel::exportToCsv(QString fileName) const {
// If there are multiple memos, then mark them as such
if (dat.items.length() == 1) {
auto memo = dat.items[0].memo;
if (memo.startsWith("zcash:")) {
if (memo.startsWith("hush:")) {
return Settings::paymentURIPretty(Settings::parseURI(memo));
} else {
return modeldata->at(index.row()).type +
@@ -159,7 +159,7 @@ bool TxTableModel::exportToCsv(QString fileName) const {
}
// If the memo is a Payment URI, then show a payment request icon
if (dat.items.length() == 1 && dat.items[0].memo.startsWith("zcash:")) {
if (dat.items.length() == 1 && dat.items[0].memo.startsWith("hush:")) {
QIcon icon(":/icons/res/paymentreq.gif");
return QVariant(icon.pixmap(16, 16));
} else if (hasMemo) {