From 2ade31b69e3c8496993d35169e6aedf97bd24b46 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 14 Nov 2018 22:15:31 -0800 Subject: [PATCH] #51 - Show zcashd tab only if there is embedded zcashd running --- src/mainwindow.cpp | 4 ++++ src/mainwindow.h | 1 + src/rpc.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 113ead6..715da23 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -71,6 +71,10 @@ MainWindow::MainWindow(QWidget *parent) : // Initialize to the balances tab 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); + ui->tabWidget->removeTab(4); + setupSendTab(); setupTransactionsTab(); setupRecieveTab(); diff --git a/src/mainwindow.h b/src/mainwindow.h index d208cb4..81914b9 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -43,6 +43,7 @@ public: QLabel* statusLabel; QLabel* statusIcon; QLabel* loadingLabel; + QWidget* zcashdtab; private: void closeEvent(QCloseEvent* event); diff --git a/src/rpc.cpp b/src/rpc.cpp index 0cef631..dc7a9f1 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -67,8 +67,10 @@ RPC::~RPC() { void RPC::setEZcashd(QProcess* p) { ezcashd = p; - if (ezcashd == nullptr) - ui->tabWidget->removeTab(4); + if (ezcashd) { + ui->tabWidget->addTab(main->zcashdtab, "zcashd"); + } + } void RPC::setConnection(Connection* c) {