mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-23 15:22:46 +02:00
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 :)  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
This commit is contained in:
commit
8a720ced5f
@ -457,6 +457,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
|
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray());
|
||||||
|
|
||||||
QChar nonbreaking_hyphen(8209);
|
QChar nonbreaking_hyphen(8209);
|
||||||
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
|
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
|
||||||
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
|
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
|
||||||
@ -502,6 +504,7 @@ RPCConsole::~RPCConsole()
|
|||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.setValue("RPCConsoleWindowGeometry", saveGeometry());
|
settings.setValue("RPCConsoleWindowGeometry", saveGeometry());
|
||||||
|
settings.setValue("PeersTabSplitterSizes", ui->splitter->saveState());
|
||||||
m_node.rpcUnsetTimerInterface(rpcTimerInterface);
|
m_node.rpcUnsetTimerInterface(rpcTimerInterface);
|
||||||
delete rpcTimerInterface;
|
delete rpcTimerInterface;
|
||||||
delete ui;
|
delete ui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user