Merge pull request #12 from DenioD/dev

dev to master
This commit is contained in:
Denio
2019-10-26 21:17:32 +02:00
committed by GitHub
5 changed files with 20 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ void ConnectionLoader::doAutoConnect() {
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig()); auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
config->dangerous = true; config->dangerous = true;
config->server = QString("127.0.0.1:9069"); config->server = QString("https://hush-lightwallet.de:439");
// Initialize the library // Initialize the library
main->logger->write(QObject::tr("Attempting to initialize")); main->logger->write(QObject::tr("Attempting to initialize"));
@@ -134,6 +134,7 @@ void ConnectionLoader::showInformation(QString info, QString detail) {
qDebug() << "Showing info " << info << ":" << detail; qDebug() << "Showing info " << info << ":" << detail;
connD->status->setText(info); connD->status->setText(info);
connD->statusDetail->setText(detail); connD->statusDetail->setText(detail);
} }
/** /**

View File

@@ -64,7 +64,7 @@ void Controller::setConnection(Connection* c) {
this->zrpc->setConnection(c); this->zrpc->setConnection(c);
ui->statusBar->showMessage("Your hushd is connected"); ui->statusBar->showMessage("Connectet with https://hush-lightwallet.de");
// See if we need to remove the reindex/rescan flags from the hush.conf file // See if we need to remove the reindex/rescan flags from the hush.conf file
auto hushConfLocation = Settings::getInstance()->gethushdConfLocation(); auto hushConfLocation = Settings::getInstance()->gethushdConfLocation();
@@ -174,16 +174,23 @@ void Controller::getInfoThenRefresh(bool force) {
static int lastBlock = 0; static int lastBlock = 0;
int curBlock = reply["latest_block_height"].get<json::number_integer_t>(); int curBlock = reply["latest_block_height"].get<json::number_integer_t>();
model->setLatestBlock(curBlock); model->setLatestBlock(curBlock);
ui->blockHeight->setText(QString::number(curBlock));
// Connected, so display checkmark. // Connected, so display checkmark.
QIcon i(":/icons/res/connected.gif"); QIcon i(":/icons/res/connected.gif");
main->statusLabel->setText(chainName + "(" + QString::number(curBlock) + ")"); main->statusLabel->setText( "connected" "(" + QString::number(curBlock) + ")");
main->statusLabel->setText(" HUSH/USD=$" + QString::number( (double) Settings::getInstance()->gethushPrice() ));
main->statusIcon->setPixmap(i.pixmap(16, 16)); main->statusIcon->setPixmap(i.pixmap(16, 16));
//int version = reply["version"].get<json::string_t>(); //int version = reply["version"].get<json::string_t>();
int version = 1; int version = 1;
Settings::getInstance()->sethushdVersion(version); Settings::getInstance()->sethushdVersion(version);
ui->Version->setText(QString::fromStdString(reply["version"].get<json::string_t>()));
ui->Vendor->setText(QString::fromStdString(reply["vendor"].get<json::string_t>()));
// See if recurring payments needs anything // See if recurring payments needs anything
Recurring::getInstance()->processPending(main); Recurring::getInstance()->processPending(main);
@@ -559,7 +566,7 @@ void Controller::refreshhushPrice() {
//QString price = QString::fromStdString(hush["usd"].get<json::string_t>()); //QString price = QString::fromStdString(hush["usd"].get<json::string_t>());
qDebug() << "HUSH = $" << QString::number((double)hush["usd"]); qDebug() << "HUSH = $" << QString::number((double)hush["usd"]);
Settings::getInstance()->sethushPrice( hush["usd"] ); Settings::getInstance()->sethushPrice( hush["usd"] );
return;
} }
} catch (const std::exception& e) { } catch (const std::exception& e) {
// If anything at all goes wrong, just set the price to 0 and move on. // If anything at all goes wrong, just set the price to 0 and move on.

View File

@@ -40,7 +40,6 @@ public:
Connection* getConnection() { return zrpc->getConnection(); } Connection* getConnection() { return zrpc->getConnection(); }
void setConnection(Connection* c); void setConnection(Connection* c);
void refresh(bool force = false); void refresh(bool force = false);
void refreshAddresses(); void refreshAddresses();

View File

@@ -39,7 +39,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-debug.log")); logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("./komodo/HUSH3/silentdragonlite-debug.log"));
// Status Bar // Status Bar
setupStatusBar(); setupStatusBar();

View File

@@ -953,21 +953,21 @@
</spacer> </spacer>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
<widget class="QLabel" name="version"> <widget class="QLabel" name="Vendor">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="heightLabel"> <widget class="QLabel" name="Vendor">
<property name="text"> <property name="text">
<string>Blockheight</string> <string>blockHeight</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QLabel" name="Vendor"> <widget class="QLabel" name="Version">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
@@ -976,7 +976,7 @@
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>Version hushd light</string> <string>Version hushlightd</string>
</property> </property>
</widget> </widget>
</item> </item>