Save/restore RPCConsole geometry only for window#194
Save/restore RPCConsole geometry only for window#194hebasto merged 1 commit intobitcoin-core:masterfrom
Conversation
|
8440fbf to
b5523f1
Compare
|
Fixed. |
luke-jr
left a comment
There was a problem hiding this comment.
Concept ACK, though the code seems uglier than I would like (ignore this nit if we can't think of a better way)
Perhaps add a version number or comment to the splitter settings while you're at it, since adding/changing columns likely shouldn't use old sizes... Or at least a comment reminding us to do so later when/if we change the columns again.
But then the code here will always be compiled in... the whole point of not building wallet support is to omit the code for it :p |
|
@luke-jr I understand that but my proposal doesn't mean wallet support is compiled in, only downside is a runtime check: bool IsWalletEnabled()
{
#ifdef ENABLE_WALLET
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
#else
return false;
#endif
} |
|
But with this, everything conditional on (Unless perhaps IsWalletEnabled is carefully made always-inlined so the compiler knows to remove the branch?) |
b5523f1 to
01d9586
Compare
jarolrod
left a comment
There was a problem hiding this comment.
Can you show a screenshot of the behavior this PR is supposed to exhibit and what it is supposed to fix? Comparing with master, I don't see what this is supposed to do.
Testing on macOS 11.1 with Qt 5.15.2
Master
Wallet Enabled
Run bitcoin-qt with wallet enabled. The main window is resized to be wider.
| Main Window | Node Window |
|---|---|
![]() |
![]() |
Wallet Disabled
run bitcoin-qt with disablewallet=1. The Node Window has inherited the geometry of the Main Window when bitcoin-qt was run with wallet enabled.
| Node Window |
|---|
![]() |
Now, I'll resize the Node Window to be smaller.
| Node Window |
|---|
![]() |
Restart With Wallet Re-Enabled
The Main Window inherits the geometry of the Node Window when I resized the Node Window while bitcoin-qt was run with the -disablewallet=1.
| Main Window |
|---|
![]() |
PR
Wallet Enabled
Run bitcoin-qt with wallet enabled. The main window is resized to be wider.
| Main Window | Node Window |
|---|---|
![]() |
![]() |
Wallet Disabled
run bitcoin-qt with disablewallet=1. The Node Window has inherited the geometry of the Main Window when bitcoin-qt was run with wallet enabled. This is the same behavior as master.
| Node Window |
|---|
![]() |
Now, I'll resize the Node Window to be smaller.
| Node Window |
|---|
![]() |
Restart With Wallet Re-Enabled
The Main Window inherits the geometry of the Node Window when I resized the Node Window while bitcoin-qt was run with the -disablewallet=1. This is the same behavior as master.
| Main Window |
|---|
![]() |
Initially, I tested this pr in the Cinnamon DE only.
|
|
Talkless
left a comment
There was a problem hiding this comment.
tACK 01d9586, tested on Debian Sid with Qt 5.15.2. I've managed to reproduce issue using #194 (comment) instructions, and I see that this PR does detach main window and information window sizes. Built with --enable-wallet and --disable-wallet.
promag
left a comment
There was a problem hiding this comment.
Code review ACK 01d9586.
This is a straightforward solution to handle both cases (with and without wallet support).
A different path would be to move load/save window state out of RPCConsole and also use QSettings::beginGroup to distinguish each case.
|
Thank you for your review!
While working on this PR I did consider both variants you mentioned. The current implementation was chosen due to a smaller diff. |
… window 01d9586 qt: Save/restore RPCConsole geometry only for window (Hennadii Stepanov) Pull request description: After using the GUI with `-disablewallet` the "Node window" inherits the geometry of the main window, that could be unexpected for users. This PR provides independent geometry settings for `RPCConsole` in both modes: - window sizes and `QSplitter` sizes when `-disablewallet=0` - only `QSplitter` sizes when `-disablewallet=1` ACKs for top commit: Talkless: tACK 01d9586, tested on Debian Sid with Qt 5.15.2. I've managed to reproduce issue using bitcoin-core/gui#194 (comment) instructions, and I see that this PR does detach main window and information window sizes. Built with `--enable-wallet` and `--disable-wallet`. jarolrod: ACK 01d9586, tested on macOS 11.2 Qt 5.15.2 promag: Code review ACK 01d9586. Tree-SHA512: 9934cf04d4d5070dfc4671ea950e225cda9988858227e5481dad1baafa14af477bdbf4f91307ca687fde0cad6e4e605a3a99377e70d67eb115a19955ce2516f5










After using the GUI with
-disablewalletthe "Node window" inherits the geometry of the main window, that could be unexpected for users.This PR provides independent geometry settings for
RPCConsolein both modes:QSplittersizes when-disablewallet=0QSplittersizes when-disablewallet=1