diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-07 09:09:14 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-07 09:09:16 +0100 |
commit | 8a720ced5ff2fdd23b6ec7688998ad29e54fac98 (patch) | |
tree | 0ff27f5a382a9391abbea41216a5703bdfa1f523 /src/qt | |
parent | f13e03cda272fb7c9b667b4f7afb4b00fd44c461 (diff) | |
parent | 90f9fc274bf69b33adea593146ff5d6793123781 (diff) |
Merge bitcoin-core/gui#165: Save QSplitter state in QSettings
90f9fc274bf69b33adea593146ff5d6793123781 qt: Save QSplitter state in QSettings (Hennadii Stepanov)
Pull request description:
This PR adds the ability to save the `QSplitter` widget state in `QSettings` during shutdown, and restore it on startup.
A user no longer needs to adjust the splitter every time :)
![DeepinScreenshot_select-area_20201225211422](https://user-images.githubusercontent.com/32963518/103141024-046c3980-46f7-11eb-9a8c-83613527ffe1.png)
ACKs for top commit:
jonasschnelli:
utACK 90f9fc274bf69b33adea593146ff5d6793123781
jonatack:
ACK 90f9fc274bf69b33adea593146ff5d6793123781 this sets the "PeersTabSplitterSizes" value in the RPCConsole dtor and restores it in the RPCConsole ctor; tested in Debian with various split settings, tab open/close sequences, and shutdown methods, and the Peers window split state was faithfully maintained.
Tree-SHA512: efbd6a4cee512982944955d36775e75a8a217b1dc49e62d42c6e402d2710dd44324b2c3c1edeb5fe38d9229e0e4a39734d1f4e63405ade8694762e1bbf72020b
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/rpcconsole.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index aa2c28453b..61f47e3ad3 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -457,6 +457,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); } + ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray()); + QChar nonbreaking_hyphen(8209); ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir")); ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir")); @@ -502,6 +504,7 @@ RPCConsole::~RPCConsole() { QSettings settings; settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); + settings.setValue("PeersTabSplitterSizes", ui->splitter->saveState()); m_node.rpcUnsetTimerInterface(rpcTimerInterface); delete rpcTimerInterface; delete ui; |