From 9033b1048fbd3e6099b0db7d4612bfacac842479 Mon Sep 17 00:00:00 2001 From: FireMartZ Date: Tue, 18 Jun 2019 10:57:05 -0400 Subject: [PATCH] Hide help button and disable close button on connection and disconnection dialogs. Keep connection dialog displayed a bit longer. --- src/connection.cpp | 7 ++++--- src/rpc.cpp | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index 8d49045..818e59a 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -14,6 +14,7 @@ ConnectionLoader::ConnectionLoader(MainWindow* main, RPC* rpc) { this->rpc = rpc; d = new QDialog(main); + d->setWindowFlags(d->windowFlags() & ~(Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)); connD = new Ui_ConnectionDialog(); connD->setupUi(d); QPixmap logo(":/img/res/logobig.gif"); @@ -459,10 +460,10 @@ void ConnectionLoader::refreshZcashdState(Connection* connection, std::function< }; connection->doRPC(payload, [=] (auto) { - // Success, hide the dialog if it was shown. - d->hide(); + // Success main->logger->write("hushd is online."); - this->doRPCSetConnection(connection); + // Delay 1 second to ensure loading (splash) is seen at least 1 second. + QTimer::singleShot(1000, [=]() { this->doRPCSetConnection(connection); }); }, [=] (auto reply, auto res) { // Failed, see what it is. diff --git a/src/rpc.cpp b/src/rpc.cpp index f921b7b..8eafb86 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1125,6 +1125,7 @@ void RPC::shutdownZcashd() { conn->shutdown(); QDialog d(main); + d.setWindowFlags(d.windowFlags() & ~(Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)); Ui_ConnectionDialog connD; connD.setupUi(&d); connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));