-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Replace save|restoreWindowGeometry with Qt functions #11335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I think it's better to keep
restoreWindowGeometry
and move this there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as below, I think its a lot cleaner inline, will change if others agree though 👍