diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2017-09-15 16:38:42 +1200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-10-03 20:12:07 +0200 |
commit | 8d13b4298c1ca83db0a65c8c8a93bd3be9135754 (patch) | |
tree | 8795198b85493731df606d2f5825251b87407540 /src/qt/rpcconsole.cpp | |
parent | 6642558078deaae2bdf1d85ed2156eb23ba004b0 (diff) | |
download | bitcoin-8d13b4298c1ca83db0a65c8c8a93bd3be9135754.tar.xz |
Replace save|restoreWindowGeometry with Qt functions
Github-Pull: #11335
Rebased-From: 13baf7217bf8394ae02efc376208ae86eac4d0f6
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 3590a98efa..d895fc1663 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -28,6 +28,7 @@ #include <wallet/wallet.h> #endif +#include <QDesktopWidget> #include <QKeyEvent> #include <QMenu> #include <QMessageBox> @@ -428,7 +429,11 @@ RPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) : consoleFontSize(0) { ui->setupUi(this); - GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); + QSettings settings; + if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) { + // Restore failed (perhaps missing setting), center the window + move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center()); + } ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); @@ -466,14 +471,14 @@ RPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) : ui->detailWidget->hide(); ui->peerHeading->setText(tr("Select a peer to view detailed information.")); - QSettings settings; consoleFontSize = settings.value(fontSizeSettingsKey, QFontInfo(QFont()).pointSize()).toInt(); clear(); } RPCConsole::~RPCConsole() { - GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this); + QSettings settings; + settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); RPCUnsetTimerInterface(rpcTimerInterface); delete rpcTimerInterface; delete ui; |