diff --git a/application.qrc b/application.qrc index 1b2fcc7..29f23df 100644 --- a/application.qrc +++ b/application.qrc @@ -6,5 +6,8 @@ res/connected.png res/loading.gif res/icon.ico - + + + res/zcashdlogo.gif + diff --git a/res/zcashdlogo.gif b/res/zcashdlogo.gif new file mode 100644 index 0000000..431e4fc Binary files /dev/null and b/res/zcashdlogo.gif differ diff --git a/src/connection.cpp b/src/connection.cpp index f692ca2..40d61bf 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -15,6 +15,7 @@ ConnectionLoader::ConnectionLoader(MainWindow* main, RPC* rpc) { d = new QDialog(main); connD = new Ui_ConnectionDialog(); connD->setupUi(d); + connD->topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256)); // Center on screen QRect screenGeometry = QApplication::desktop()->screenGeometry(d); diff --git a/src/fillediconlabel.cpp b/src/fillediconlabel.cpp index a04447a..9b5d9cf 100644 --- a/src/fillediconlabel.cpp +++ b/src/fillediconlabel.cpp @@ -6,17 +6,20 @@ FilledIconLabel::FilledIconLabel(QWidget* parent) : setScaledContents(false); } +void FilledIconLabel::setBasePixmap(QPixmap pm) { + basePm = pm; +} void FilledIconLabel::resizeEvent(QResizeEvent*) { - // Top pixmap - QIcon icon(":/icons/res/icon.ico"); - QSize sz = size(); - qDebug() << sz; + // Top pixmap + QSize sz = size(); + + QPixmap scaled = basePm.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QPixmap p(sz); p.fill(Qt::white); QPainter painter(&p); - painter.drawPixmap((sz.width() - sz.height()) / 2, 0, - icon.pixmap(sz.height(), sz.height())); + painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled); QLabel::setPixmap(p); } \ No newline at end of file diff --git a/src/fillediconlabel.h b/src/fillediconlabel.h index a910796..d5de800 100644 --- a/src/fillediconlabel.h +++ b/src/fillediconlabel.h @@ -8,10 +8,13 @@ class FilledIconLabel : public QLabel Q_OBJECT public: explicit FilledIconLabel(QWidget *parent = 0); + void setBasePixmap(QPixmap pm); public slots: void resizeEvent(QResizeEvent *); +private: + QPixmap basePm; }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2e92c10..fd489dd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -75,6 +75,7 @@ MainWindow::MainWindow(QWidget *parent) : setupRecieveTab(); setupBalancesTab(); setupTurnstileDialog(); + setupZcashdTab(); rpc = new RPC(this); @@ -700,6 +701,10 @@ void MainWindow::setupBalancesTab() { }); } +void MainWindow::setupZcashdTab() { + ui->zcashdlogo->setBasePixmap(QPixmap(":/img/res/zcashdlogo.gif")); +} + void MainWindow::setupTransactionsTab() { // Set up context menu on transactions tab ui->transactionsTable->setContextMenuPolicy(Qt::CustomContextMenu); diff --git a/src/mainwindow.h b/src/mainwindow.h index 4f5005c..e634a37 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -49,6 +49,7 @@ private: void setupTransactionsTab(); void setupRecieveTab(); void setupBalancesTab(); + void setupZcashdTab(); void setupTurnstileDialog(); void setupSettingsModal(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 838cd52..4f22232 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 889 - 603 + 968 + 616 @@ -22,7 +22,7 @@ - 1 + 4 @@ -316,8 +316,8 @@ 0 0 - 841 - 321 + 920 + 334 @@ -715,6 +715,145 @@ + + + zcashd + + + + + + + + + 0 + 0 + + + + + + + false + + + + + + + + + + + + + You are currently not mining + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + TextLabel + + + + + + + Block Height + + + + + + + TextLabel + + + + + + + Network Solution Rate + + + + + + + Connections + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + | + + + + + + + | + + + + + + + | + + + + + + + + + + @@ -724,7 +863,7 @@ 0 0 - 889 + 968 22 @@ -835,6 +974,11 @@ QLabel
qrcodelabel.h
+ + FilledIconLabel + QLabel +
fillediconlabel.h
+
tabWidget diff --git a/src/rpc.cpp b/src/rpc.cpp index 4155828..022fba1 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -477,6 +477,28 @@ void RPC::getInfoThenRefresh(bool force) { refreshTransactions(); } + // Get network sol/s + if (ezcashd != nullptr) { + int conns = reply["connections"].get(); + + json payload = { + {"jsonrpc", "1.0"}, + {"id", "someid"}, + {"method", "getnetworksolps"} + }; + + conn->doRPCIgnoreError(payload, [=](const json& reply) { + qint64 solrate = reply.get(); + + ui->blockheight->setText(QString::number(curBlock)); + ui->numconnections->setText(QString::number(conns)); + ui->solrate->setText(QString::number(solrate) % " Sol/s"); + }); + } else { + ui->tabWidget->removeTab(4); + } + + // Call to see if the blockchain is syncing. json payload = { {"jsonrpc", "1.0"}, diff --git a/src/rpc.h b/src/rpc.h index 3ededd6..c2539c3 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -33,6 +33,7 @@ public: void setConnection(Connection* c); void setEZcashd(QProcess* p); + const QProcess* getEZcashD() { return ezcashd; } void refresh(bool force = false);