mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
qt: Save/restore RPCConsole geometry only for window
This commit is contained in:
parent
d1ddead09a
commit
01d9586ae8
1 changed files with 25 additions and 7 deletions
|
@ -453,13 +453,21 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||
{
|
||||
ui->setupUi(this);
|
||||
QSettings settings;
|
||||
if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) {
|
||||
// Restore failed (perhaps missing setting), center the window
|
||||
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
|
||||
#ifdef ENABLE_WALLET
|
||||
if (WalletModel::isWalletEnabled()) {
|
||||
// RPCConsole widget is a window.
|
||||
if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) {
|
||||
// Restore failed (perhaps missing setting), center the window
|
||||
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
|
||||
}
|
||||
ui->splitter->restoreState(settings.value("RPCConsoleWindowPeersTabSplitterSizes").toByteArray());
|
||||
} else
|
||||
#endif // ENABLE_WALLET
|
||||
{
|
||||
// RPCConsole is a child widget.
|
||||
ui->splitter->restoreState(settings.value("RPCConsoleWidgetPeersTabSplitterSizes").toByteArray());
|
||||
}
|
||||
|
||||
ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray());
|
||||
|
||||
constexpr QChar nonbreaking_hyphen(8209);
|
||||
const std::vector<QString> CONNECTION_TYPE_DOC{
|
||||
tr("Inbound Full/Block Relay: initiated by peer"),
|
||||
|
@ -516,8 +524,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||
RPCConsole::~RPCConsole()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("RPCConsoleWindowGeometry", saveGeometry());
|
||||
settings.setValue("PeersTabSplitterSizes", ui->splitter->saveState());
|
||||
#ifdef ENABLE_WALLET
|
||||
if (WalletModel::isWalletEnabled()) {
|
||||
// RPCConsole widget is a window.
|
||||
settings.setValue("RPCConsoleWindowGeometry", saveGeometry());
|
||||
settings.setValue("RPCConsoleWindowPeersTabSplitterSizes", ui->splitter->saveState());
|
||||
} else
|
||||
#endif // ENABLE_WALLET
|
||||
{
|
||||
// RPCConsole is a child widget.
|
||||
settings.setValue("RPCConsoleWidgetPeersTabSplitterSizes", ui->splitter->saveState());
|
||||
}
|
||||
|
||||
m_node.rpcUnsetTimerInterface(rpcTimerInterface);
|
||||
delete rpcTimerInterface;
|
||||
delete ui;
|
||||
|
|
Loading…
Add table
Reference in a new issue