improvements to render the price
This commit is contained in:
@@ -44,7 +44,7 @@ QString CAmount::toDecimalEURString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
double price = Settings::getInstance()->getEURPrice();
|
||||
|
||||
return QLocale(QLocale::English).toString(dblAmount*price, 'f', 2) + " €";
|
||||
return QLocale(QLocale::German).toString(dblAmount*price, 'f', 2) + " €";
|
||||
}
|
||||
QString CAmount::toDecimalBTCString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
@@ -80,7 +80,7 @@ QString CAmount::toDecimalCHFString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
double price = Settings::getInstance()->getCHFPrice();
|
||||
|
||||
return "CHF " + QLocale(QLocale::English).toString(dblAmount*price, 'f', 2);
|
||||
return "CHF " + QLocale(QLocale::German).toString(dblAmount*price, 'f', 2);
|
||||
}
|
||||
QString CAmount::toDecimalINRString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
|
||||
@@ -166,37 +166,28 @@ void Controller::getInfoThenRefresh(bool force) {
|
||||
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) );
|
||||
int halving_days =
|
||||
(blocks_until_halving * 150) / (60*60*24) ;
|
||||
bool doUpdate = force || (model->getLatestBlock() != curBlock);
|
||||
model->setLatestBlock(curBlock);
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->blockHeight->setText(QLocale(QLocale::German).toString(curBlock));
|
||||
ui->last_notarized->setText(QLocale(QLocale::German).toString(notarized));
|
||||
ui->longestchain->setText(QLocale(QLocale::German).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::German).toString(difficulty));}
|
||||
|
||||
else if (Settings::getInstance()->get_currency_name() == "CHF") {
|
||||
ui->blockHeight->setText(QLocale(QLocale::German).toString(curBlock));
|
||||
ui->last_notarized->setText(QLocale(QLocale::German).toString(notarized));
|
||||
ui->longestchain->setText(QLocale(QLocale::German).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::German).toString(difficulty));}
|
||||
|
||||
else if (Settings::getInstance()->get_currency_name() == "RUB") {
|
||||
ui->blockHeight->setText(QLocale(QLocale::German).toString(curBlock));
|
||||
ui->last_notarized->setText(QLocale(QLocale::German).toString(notarized));
|
||||
ui->longestchain->setText(QLocale(QLocale::German).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::German).toString(difficulty));}
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "EUR" || Settings::getInstance()->get_currency_name() == "CHF" || Settings::getInstance()->get_currency_name() == "RUB") {
|
||||
ui->blockHeight->setText("Block: " + QLocale(QLocale::German).toString(curBlock));
|
||||
ui->last_notarized->setText("Block: " + QLocale(QLocale::German).toString(notarized));
|
||||
ui->longestchain->setText("Block: " + QLocale(QLocale::German).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::German).toString(difficulty));
|
||||
ui->halvingTime->setText((QLocale(QLocale::German).toString(blocks_until_halving)) + " Blocks or , " + (QLocale(QLocale::German).toString(halving_days) + " days" ));
|
||||
}
|
||||
else {
|
||||
ui->blockHeight->setText(QLocale(QLocale::English).toString(curBlock));
|
||||
ui->last_notarized->setText(QLocale(QLocale::English).toString(notarized));
|
||||
ui->longestchain->setText(QLocale(QLocale::English).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::English).toString(difficulty));}
|
||||
ui->blockHeight->setText("Block: " + QLocale(QLocale::English).toString(curBlock));
|
||||
ui->last_notarized->setText("Block: " + QLocale(QLocale::English).toString(notarized));
|
||||
ui->longestchain->setText("Block: " + QLocale(QLocale::English).toString(longestchain));
|
||||
ui->difficulty->setText(QLocale(QLocale::English).toString(difficulty));
|
||||
ui->halvingTime->setText((QLocale(QLocale::English).toString(blocks_until_halving)) + " Blocks or , " + (QLocale(QLocale::English).toString(halving_days) + " days" ));
|
||||
|
||||
}
|
||||
|
||||
|
||||
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>()));
|
||||
|
||||
@@ -325,25 +316,14 @@ void Controller::getInfoThenRefresh(bool force) {
|
||||
int zfunds = reply["zfunds"].get<json::number_integer_t>();
|
||||
int total = reply["total"].get<json::number_integer_t>();
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->supply_taddr->setText((QLocale(QLocale::German).toString(supply)));
|
||||
ui->supply_zaddr->setText((QLocale(QLocale::German).toString(zfunds)));
|
||||
ui->supply_total->setText((QLocale(QLocale::German).toString(total)));}
|
||||
|
||||
else if (Settings::getInstance()->get_currency_name() == "CHF") {
|
||||
ui->supply_taddr->setText((QLocale(QLocale::German).toString(supply)));
|
||||
ui->supply_zaddr->setText((QLocale(QLocale::German).toString(zfunds)));
|
||||
ui->supply_total->setText((QLocale(QLocale::German).toString(total)));}
|
||||
|
||||
else if (Settings::getInstance()->get_currency_name() == "RUB") {
|
||||
ui->supply_taddr->setText((QLocale(QLocale::German).toString(supply)));
|
||||
ui->supply_zaddr->setText((QLocale(QLocale::German).toString(zfunds)));
|
||||
ui->supply_total->setText((QLocale(QLocale::German).toString(total)));}
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "EUR" || Settings::getInstance()->get_currency_name() == "CHF" || Settings::getInstance()->get_currency_name() == "RUB") {
|
||||
ui->supply_taddr->setText((QLocale(QLocale::German).toString(supply)+ " Hush"));
|
||||
ui->supply_zaddr->setText((QLocale(QLocale::German).toString(zfunds)+ " Hush"));
|
||||
ui->supply_total->setText((QLocale(QLocale::German).toString(total)+ " Hush"));}
|
||||
else{
|
||||
ui->supply_taddr->setText((QLocale(QLocale::English).toString(supply)));
|
||||
ui->supply_zaddr->setText((QLocale(QLocale::English).toString(zfunds)));
|
||||
ui->supply_total->setText((QLocale(QLocale::English).toString(total)));}
|
||||
ui->supply_taddr->setText("Hush " + (QLocale(QLocale::English).toString(supply)));
|
||||
ui->supply_zaddr->setText("Hush " +(QLocale(QLocale::English).toString(zfunds)));
|
||||
ui->supply_total->setText("Hush " +(QLocale(QLocale::English).toString(total)));}
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -1010,7 +1010,7 @@
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1024,7 +1024,7 @@
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_38">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1045,7 +1045,7 @@
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1094,14 +1094,14 @@
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="label_34">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1115,7 +1115,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1136,7 +1136,7 @@
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1150,7 +1150,7 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1164,7 +1164,7 @@
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label_29">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1192,7 +1192,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1264,7 +1264,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1285,7 +1285,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
<string><html><head/><body><p align="center">|</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user