mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-05 22:44:50 +02:00
qt: Save/restore RPCConsole geometry only for window
This commit is contained in:
parent
d1ddead09a
commit
01d9586ae8
@ -453,13 +453,21 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) {
|
#ifdef ENABLE_WALLET
|
||||||
// Restore failed (perhaps missing setting), center the window
|
if (WalletModel::isWalletEnabled()) {
|
||||||
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
|
// 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);
|
constexpr QChar nonbreaking_hyphen(8209);
|
||||||
const std::vector<QString> CONNECTION_TYPE_DOC{
|
const std::vector<QString> CONNECTION_TYPE_DOC{
|
||||||
tr("Inbound Full/Block Relay: initiated by peer"),
|
tr("Inbound Full/Block Relay: initiated by peer"),
|
||||||
@ -516,8 +524,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
RPCConsole::~RPCConsole()
|
RPCConsole::~RPCConsole()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.setValue("RPCConsoleWindowGeometry", saveGeometry());
|
#ifdef ENABLE_WALLET
|
||||||
settings.setValue("PeersTabSplitterSizes", ui->splitter->saveState());
|
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);
|
m_node.rpcUnsetTimerInterface(rpcTimerInterface);
|
||||||
delete rpcTimerInterface;
|
delete rpcTimerInterface;
|
||||||
delete ui;
|
delete ui;
|
||||||
|
Loading…
Reference in New Issue
Block a user