Merge pull request #56 from MyHush/dev

fix mac icon,add Halving time,Market Cap and Volume to Hushdaemon tab, change default server to lite.myhush.org
This commit is contained in:
Denio
2019-12-03 21:06:11 +01:00
committed by GitHub
13 changed files with 1044 additions and 477 deletions

6
lib/Cargo.lock generated
View File

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

View File

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

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -20,24 +20,29 @@ void BalancesTableModel::setNewData(const QList<QString> zaddrs, const QList<QSt
// This is a QList deep copy.
*unspentOutputs = outputs;
// Are there any z or t addresses with balance in the balances table?
bool anyz = false;
bool anyt = false;
// Process the address balances into a list
delete modeldata;
modeldata = new QList<std::tuple<QString, CAmount>>();
std::for_each(balances.keyBegin(), balances.keyEnd(), [=] (auto keyIt) {
std::for_each(balances.keyBegin(), balances.keyEnd(), [=, &anyz, &anyt] (auto keyIt) {
modeldata->push_back(std::make_tuple(keyIt, balances.value(keyIt)));
if (Settings::isZAddress(keyIt)) {
anyz = true;
} else if (Settings::isTAddress(keyIt)) {
anyt = true;
}
});
// Add all addresses that have no balances as well
for (auto zaddr: zaddrs) {
if (!balances.contains(zaddr)) {
modeldata->push_back(std::make_tuple(zaddr, CAmount::fromqint64(0)));
}
// Add all addresses that have no balances, if there are no existing addresses
if (!anyz && zaddrs.length() > 0) {
modeldata->push_back(std::make_tuple(zaddrs[0], CAmount::fromqint64(0)));
}
for (auto taddr: taddrs) {
if (!balances.contains(taddr)) {
modeldata->push_back(std::make_tuple(taddr, CAmount::fromqint64(0)));
}
if (!anyt && taddrs.length() > 0) {
modeldata->push_back(std::make_tuple(taddrs[0], CAmount::fromqint64(0)));
}
// And then update the data

View File

@@ -71,6 +71,9 @@ public:
bool operator> (const CAmount& other) const {
return this->amount > other.amount;
}
bool operator== (const qint64 other) const {
return this->amount == other;
}
};
#endif // CAMOUNT_H

View File

@@ -162,11 +162,22 @@ void Controller::getInfoThenRefresh(bool force) {
prevCallSucceeded = true;
int curBlock = reply["latest_block_height"].get<json::number_integer_t>();
int longestchain = reply["longestchain"].get<json::number_integer_t>();
int notarized = reply["notarized"].get<json::number_integer_t>();
int difficulty = reply["difficulty"].get<json::number_integer_t>();
int blocks_until_halving= 340000 - curBlock;
char halving_days[8];
sprintf(halving_days, "%.2f", (double) (blocks_until_halving * 150) / (60*60*24) );
bool doUpdate = force || (model->getLatestBlock() != curBlock);
model->setLatestBlock(curBlock);
ui->blockHeight->setText(QString::number(curBlock));
ui->last_notarized->setText(QString::number(notarized));
ui->longestchain->setText(QString::number(longestchain));
ui->difficulty->setText(QString::number(difficulty));
ui->halvingTime->setText( QString::number(blocks_until_halving) % " blocks, " % QString::fromStdString(halving_days) % " days" );
ui->Version->setText(QString::fromStdString(reply["version"].get<json::string_t>()));
ui->Vendor->setText(QString::fromStdString(reply["vendor"].get<json::string_t>()));
ui->volumeExchange->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCVolume() ,'f',8));
main->logger->write(QString("Refresh. curblock ") % QString::number(curBlock) % ", update=" % (doUpdate ? "true" : "false") );
@@ -181,29 +192,53 @@ void Controller::getInfoThenRefresh(bool force) {
if (Settings::getInstance()->get_currency_name() == "USD") {
main->statusLabel->setText(" HUSH/USD=$ " + QString::number( (double) Settings::getInstance()->getZECPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
main->statusLabel->setText(" HUSH/EUR= " + QString::number( (double) Settings::getInstance()->getEURPrice() ,'f',2));
main->statusLabel->setText(" HUSH/EUR= " + QString::number( (double) Settings::getInstance()->getEURPrice() ,'f',2) + "");
ui->volumeExchange->setText(QString::number((double) Settings::getInstance()->getEURVolume() ,'f',2) + "");
ui->marketcapTab->setText(QString::number((double) Settings::getInstance()->getEURCAP() ,'f',2)+ "");
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
main->statusLabel->setText(" HUSH/BTC=BTC " + QString::number((double) Settings::getInstance()->getBTCPrice() ,'f',8));
ui->volumeExchange->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCVolume() ,'f',8));
ui->marketcapTab->setText(" BTC " + QString::number((double) Settings::getInstance()->getBTCCAP() ,'f',8));
} else if (Settings::getInstance()->get_currency_name() == "CNY") {
main->statusLabel->setText(" HUSH/CNY=¥ /元 " + QString::number( (double) Settings::getInstance()->getCNYPrice() ,'f',2));
ui->volumeExchange->setText(" ¥ /元 " + QString::number((double) Settings::getInstance()->getCNYVolume() ,'f',2));
ui->marketcapTab->setText(" ¥ /元 " + QString::number((double) Settings::getInstance()->getCNYCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "RUB") {
main->statusLabel->setText(" HUSH/RUB=₽ " + QString::number((double) Settings::getInstance()->getRUBPrice() ,'f',2));
ui->volumeExchange->setText("" + QString::number((double) Settings::getInstance()->getRUBVolume() ,'f',2));
ui->marketcapTab->setText("" + QString::number((double) Settings::getInstance()->getRUBCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "CAD") {
main->statusLabel->setText(" HUSH/CAD=$ " + QString::number( (double) Settings::getInstance()->getCADPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getCADVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getCADCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "SGD") {
main->statusLabel->setText(" HUSH/SGD=$ " + QString::number((double) Settings::getInstance()->getSGDPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getSGDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getSGDCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "CHF") {
main->statusLabel->setText(" HUSH/CHF=CHF " + QString::number((double) Settings::getInstance()->getCHFPrice() ,'f',2));
ui->volumeExchange->setText(" CHF " + QString::number((double) Settings::getInstance()->getCHFVolume() ,'f',2));
ui->marketcapTab->setText(" CHF " + QString::number((double) Settings::getInstance()->getCHFCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "INR") {
main->statusLabel->setText(" HUSH/INR=₹ " + QString::number( (double) Settings::getInstance()->getINRPrice() ,'f',2));
ui->volumeExchange->setText("" + QString::number((double) Settings::getInstance()->getINRVolume() ,'f',2));
ui->marketcapTab->setText("" + QString::number((double) Settings::getInstance()->getINRCAP() ,'f',2));
} else if (Settings::getInstance()->get_currency_name() == "GBP") {
main->statusLabel->setText(" HUSH/GBP=£ " + QString::number((double) Settings::getInstance()->getGBPPrice() ,'f',2));
ui->volumeExchange->setText(" £ " + QString::number((double) Settings::getInstance()->getGBPVolume() ,'f',2));
ui->marketcapTab->setText(" £ " + QString::number((double) Settings::getInstance()->getRUBCAP() ,'f',2));
}else if (Settings::getInstance()->get_currency_name() == "AUD") {
main->statusLabel->setText(" HUSH/AUD=$ " + QString::number((double) Settings::getInstance()->getAUDPrice() ,'f',2));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getAUDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getAUDCAP() ,'f',2));
} else {
main->statusLabel->setText(" HUSH/USD=$" + QString::number(Settings::getInstance()->getZECPrice(),'f',2 ));
ui->volumeExchange->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDVolume() ,'f',2));
ui->marketcapTab->setText(" $ " + QString::number((double) Settings::getInstance()->getUSDCAP() ,'f',2));
}
main->statusLabel->setToolTip(tooltip);
main->statusIcon->setPixmap(i.pixmap(16, 16));
@@ -318,6 +353,9 @@ void Controller::updateUIBalances() {
CAmount balTotal = balT + balZ;
CAmount balAvailable = balT + balVerified;
if (balZ < 0) {
balZ = CAmount::fromqint64(0);
}
// Balances table
ui->balSheilded ->setText(balZ.toDecimalhushString());
@@ -336,6 +374,7 @@ void Controller::updateUIBalances() {
ui->balVerified ->setToolTip(balVerified.toDecimalEURString());
ui->balTransparent->setToolTip(balT.toDecimalEURString());
ui->balTotal ->setToolTip(balTotal.toDecimalEURString());
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
ui->balSheilded ->setToolTip(balZ.toDecimalBTCString());
@@ -764,6 +803,28 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
return;
}
@@ -784,6 +845,28 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
return;
}
@@ -857,8 +940,138 @@ void Controller::refreshZECPrice() {
qDebug() << "HUSH = AUD" << QString::number((double)hush["aud"]);
Settings::getInstance()->setAUDPrice( hush["aud"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = usd_24h_vol" << QString::number((double)hush["usd_24h_vol"]);
Settings::getInstance()->setUSDVolume( hush["usd_24h_vol"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = euro_24h_vol" << QString::number((double)hush["eur_24h_vol"]);
Settings::getInstance()->setEURVolume( hush["eur_24h_vol"]);
}
if (hush["btc_24h_vol"] >= 0)
{
qDebug() << "HUSH = btc_24h_vol" << QString::number((double)hush["btc_24h_vol"]);
Settings::getInstance()->setBTCVolume( hush["btc_24h_vol"]);
}
if (hush["cny_24h_vol"] >= 0)
{
qDebug() << "HUSH = cny_24h_vol" << QString::number((double)hush["cny_24h_vol"]);
Settings::getInstance()->setCNYVolume( hush["cny_24h_vol"]);
}
if (hush["rub_24h_vol"] >= 0)
{
qDebug() << "HUSH = rub_24h_vol" << QString::number((double)hush["rub_24h_vol"]);
Settings::getInstance()->setRUBVolume( hush["rub_24h_vol"]);
}
if (hush["cad_24h_vol"] >= 0)
{
qDebug() << "HUSH = cad_24h_vol" << QString::number((double)hush["cad_24h_vol"]);
Settings::getInstance()->setCADVolume( hush["cad_24h_vol"]);
}
if (hush["sgd_24h_vol"] >= 0)
{
qDebug() << "HUSH = sgd_24h_vol" << QString::number((double)hush["sgd_24h_vol"]);
Settings::getInstance()->setSGDVolume( hush["sgd_24h_vol"]);
}
if (hush["chf_24h_vol"] >= 0)
{
qDebug() << "HUSH = chf_24h_vol" << QString::number((double)hush["chf_24h_vol"]);
Settings::getInstance()->setCHFVolume( hush["chf_24h_vol"]);
}
if (hush["inr_24h_vol"] >= 0)
{
qDebug() << "HUSH = inr_24h_vol" << QString::number((double)hush["inr_24h_vol"]);
Settings::getInstance()->setINRVolume( hush["inr_24h_vol"]);
}
if (hush["gbp_24h_vol"] >= 0)
{
qDebug() << "HUSH = gbp_24h_vol" << QString::number((double)hush["gbp_24h_vol"]);
Settings::getInstance()->setGBPVolume( hush["gbp_24h_vol"]);
}
if (hush["aud_24h_vol"] >= 0)
{
qDebug() << "HUSH = aud_24h_vol" << QString::number((double)hush["aud_24h_vol"]);
Settings::getInstance()->setAUDVolume( hush["aud_24h_vol"]);
}
if (hush["usd_market_cap"] >= 0)
{
qDebug() << "HUSH = usd_market_cap" << QString::number((double)hush["usd_market_cap"]);
Settings::getInstance()->setUSDCAP( hush["usd_market_cap"]);
}
if (hush["eur_market_cap"] >= 0)
{
qDebug() << "HUSH = eur_market_cap" << QString::number((double)hush["eur_market_cap"]);
Settings::getInstance()->setEURCAP( hush["eur_market_cap"]);
}
if (hush["btc_market_cap"] >= 0)
{
qDebug() << "HUSH = btc_market_cap" << QString::number((double)hush["btc_market_cap"]);
Settings::getInstance()->setBTCCAP( hush["btc_market_cap"]);
}
if (hush["cny_market_cap"] >= 0)
{
qDebug() << "HUSH = cny_market_cap" << QString::number((double)hush["cny_market_cap"]);
Settings::getInstance()->setCNYCAP( hush["cny_market_cap"]);
}
if (hush["rub_market_cap"] >= 0)
{
qDebug() << "HUSH = rub_market_cap" << QString::number((double)hush["rub_market_cap"]);
Settings::getInstance()->setRUBCAP( hush["rub_market_cap"]);
}
if (hush["cad_market_cap"] >= 0)
{
qDebug() << "HUSH = cad_market_cap" << QString::number((double)hush["cad_market_cap"]);
Settings::getInstance()->setCADCAP( hush["cad_market_cap"]);
}
if (hush["sgd_market_cap"] >= 0)
{
qDebug() << "HUSH = sgd_market_cap" << QString::number((double)hush["sgd_market_cap"]);
Settings::getInstance()->setSGDCAP( hush["sgd_market_cap"]);
}
if (hush["chf_market_cap"] >= 0)
{
qDebug() << "HUSH = chf_market_cap" << QString::number((double)hush["chf_market_cap"]);
Settings::getInstance()->setCHFCAP( hush["chf_market_cap"]);
}
if (hush["inr_market_cap"] >= 0)
{
qDebug() << "HUSH = inr_market_cap" << QString::number((double)hush["inr_market_cap"]);
Settings::getInstance()->setINRCAP( hush["inr_market_cap"]);
}
if (hush["gbp_market_cap"] >= 0)
{
qDebug() << "HUSH = gbp_market_cap" << QString::number((double)hush["gbp_market_cap"]);
Settings::getInstance()->setGBPCAP( hush["gbp_market_cap"]);
}
if (hush["aud_market_cap"] >= 0)
{
qDebug() << "HUSH = aud_market_cap" << QString::number((double)hush["aud_market_cap"]);
Settings::getInstance()->setAUDCAP( hush["aud_market_cap"]);
}
return;
} catch (const std::exception& e) {
// If anything at all goes wrong, just set the price to 0 and move on.
@@ -877,6 +1090,29 @@ void Controller::refreshZECPrice() {
Settings::getInstance()->setGBPPrice(0);
Settings::getInstance()->setAUDPrice(0);
Settings::getInstance()->setINRPrice(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setUSDVolume(0);
Settings::getInstance()->setEURVolume(0);
Settings::getInstance()->setBTCVolume(0);
Settings::getInstance()->setCNYVolume(0);
Settings::getInstance()->setRUBVolume(0);
Settings::getInstance()->setCADVolume(0);
Settings::getInstance()->setINRVolume(0);
Settings::getInstance()->setSGDVolume(0);
Settings::getInstance()->setCHFVolume(0);
Settings::getInstance()->setGBPVolume(0);
Settings::getInstance()->setAUDVolume(0);
Settings::getInstance()->setUSDCAP(0);
Settings::getInstance()->setEURCAP(0);
Settings::getInstance()->setBTCCAP(0);
Settings::getInstance()->setCNYCAP(0);
Settings::getInstance()->setRUBCAP(0);
Settings::getInstance()->setCADCAP(0);
Settings::getInstance()->setINRCAP(0);
Settings::getInstance()->setSGDCAP(0);
Settings::getInstance()->setCHFCAP(0);
Settings::getInstance()->setGBPCAP(0);
Settings::getInstance()->setAUDCAP(0);
});
}

View File

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

View File

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

View File

@@ -457,7 +457,7 @@ void MainWindow::setupSettingsModal() {
settings.chkFetchPrices->setChecked(Settings::getInstance()->getAllowFetchPrices());
// List of default servers
settings.cmbServer->addItem("https://hush-lightwallet.de:443");
settings.cmbServer->addItem("https://lite.myhush.org");
settings.cmbServer->addItem("https://hush-lightwallet.de:443");
// Load current values into the dialog
@@ -1048,8 +1048,7 @@ void MainWindow::setupReceiveTab() {
updateTAddrCombo(checked);
}
// Toggle the "View all addresses" button as well
ui->btnViewAllAddresses->setVisible(checked);
});
// View all addresses goes to "View all private keys"
@@ -1065,7 +1064,14 @@ void MainWindow::setupReceiveTab() {
Settings::saveRestoreTableHeader(viewaddrs.tblAddresses, &d, "viewalladdressestable");
viewaddrs.tblAddresses->horizontalHeader()->setStretchLastSection(true);
ViewAllAddressesModel model(viewaddrs.tblAddresses, getRPC()->getModel()->getAllTAddresses(), getRPC());
QList<QString> allAddresses;
if (ui->rdioTAddr->isChecked()) {
allAddresses = getRPC()->getModel()->getAllTAddresses();
} else {
allAddresses = getRPC()->getModel()->getAllZAddresses();
}
ViewAllAddressesModel model(viewaddrs.tblAddresses, allAddresses, getRPC());
viewaddrs.tblAddresses->setModel(&model);
QObject::connect(viewaddrs.btnExportAll, &QPushButton::clicked, this, &MainWindow::exportAllKeys);
@@ -1100,6 +1106,20 @@ void MainWindow::setupReceiveTab() {
QObject::connect(ui->btnReceiveNewAddr, &QPushButton::clicked, [=] () {
if (!rpc->getConnection())
return;
// Go over the dropdown and just select the next address that has:
// 0 balance and has no labels
for (int i=ui->listReceiveAddresses->currentIndex()+1; i < ui->listReceiveAddresses->count(); i++) {
QString item = ui->listReceiveAddresses->itemText(i);
CAmount bal = getRPC()->getModel()->getAllBalances().value(item, CAmount());
if (bal == 0 && AddressBook::getInstance()->getLabelForAddress(item).isEmpty()) {
// Pick this one, since it has no balance and no label
ui->listReceiveAddresses->setCurrentIndex(i);
return;
}
}
// If none of the existing items were eligible, create a new one.
if (ui->rdioZSAddr->isChecked()) {
addNewZaddr(true);
@@ -1113,7 +1133,7 @@ void MainWindow::setupReceiveTab() {
if (tab == 2) {
// Switched to receive tab, select the z-addr radio button
ui->rdioZSAddr->setChecked(true);
ui->btnViewAllAddresses->setVisible(false);
// And then select the first one
ui->listReceiveAddresses->setCurrentIndex(0);
@@ -1170,7 +1190,7 @@ void MainWindow::setupReceiveTab() {
} else if (Settings::getInstance()->get_currency_name() == "AUD") {
ui->rcvBal->setText(rpc->getModel()->getAllBalances().value(addr).toDecimalhushAUDString());
}
ui->txtReceive->setPlainText(addr);
ui->qrcodeDisplay->setQrcodeString(addr);
if (rpc->getModel()->getUsedAddresses().value(addr, false)) {

View File

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

View File

@@ -135,6 +135,73 @@ double Settings::getGBPPrice() {
double Settings::getAUDPrice() {
return AUDPrice;
}
double Settings::getUSDVolume() {
return USDVolume;
}
double Settings::getEURVolume() {
return EURVolume;
}
double Settings::getBTCVolume() {
return BTCVolume;
}
double Settings::getCNYVolume() {
return CNYVolume;
}
double Settings::getRUBVolume() {
return RUBVolume;
}
double Settings::getCADVolume() {
return CADVolume;
}
double Settings::getSGDVolume() {
return SGDVolume;
}
double Settings::getCHFVolume() {
return CHFVolume;
}
double Settings::getINRVolume() {
return INRVolume;
}
double Settings::getGBPVolume() {
return GBPVolume;
}
double Settings::getAUDVolume() {
return AUDVolume;
}
double Settings::getUSDCAP() {
return USDCAP;
}
double Settings::getEURCAP() {
return EURCAP;
}
double Settings::getBTCCAP() {
return BTCCAP;
}
double Settings::getCNYCAP() {
return CNYCAP;
}
double Settings::getRUBCAP() {
return RUBCAP;
}
double Settings::getCADCAP() {
return CADCAP;
}
double Settings::getSGDCAP() {
return SGDCAP;
}
double Settings::getCHFCAP() {
return CHFCAP;
}
double Settings::getINRCAP() {
return INRCAP;
}
double Settings::getGBPCAP() {
return GBPCAP;
}
double Settings::getAUDCAP() {
return AUDCAP;
}
bool Settings::getCheckForUpdates() {
return QSettings().value("options/allowcheckupdates", true).toBool();
@@ -196,7 +263,7 @@ void Settings::saveRestoreTableHeader(QTableView* table, QDialog* d, QString tab
}
QString Settings::getDefaultServer() {
return "https://hush-lightwallet.de:443";
return "https://lite.myhush.org";
}
void Settings::openAddressInExplorer(QString address) {

View File

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