aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-17 13:00:05 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-11-17 13:03:59 +0100
commite7986c51bc7afeca8f79f286fb5d950f469a8866 (patch)
tree2402624ecc7c4f47a75ee2d4739b4f29c117b304
parentc463f70fb05ed45cfcc609324078a0ccb08c7f06 (diff)
parentac64cec4ce35cb7e6fbf3678c1ffeac0137791ae (diff)
downloadbitcoin-e7986c51bc7afeca8f79f286fb5d950f469a8866.tar.xz
Merge bitcoin-core/gui#96: Slight improve create wallet dialog
ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae gui: create wallet: add advanced section (Sjors Provoost) c99d6f644aa45d1bd929790f23a36d0dd7c29004 gui: create wallet: name placeholder (Sjors Provoost) 5bff82540b90d899ceac6390c008d653e6b665c3 [gui] create wallet: smarter checkbox toggling (Sjors Provoost) Pull request description: Previously only users who needed a second wallet had to use to the create wallet dialog. With the merge of https://github.com/bitcoin/bitcoin/pull/15454 now all new users have to. I don't think it was user-friendly enough for that. <img width="403" alt="Schermafbeelding 2020-09-18 om 09 41 44" src="https://user-images.githubusercontent.com/10217/93574129-52ef9680-f998-11ea-9a6f-31144f66d3bf.png"> This PR makes a few simple improvements so that new users don't have to think too much: <img width="369" alt="Schermafbeelding 2020-10-15 om 16 45 22" src="https://user-images.githubusercontent.com/10217/96145959-0c914700-0f06-11eb-9526-cf447d841d7a.png"> It's lightly inspired by #77. It would be better if those changes made it into the upcoming release, but this PR is a good start imo. * wallet encryption is no longer checked by default, because such a change in the default needs a separate discussion (fwiw, I suspect it increases the number of users losing access to coins) * watch-only and descriptor wallet stuff is moved to advanced, so new users know they can safely ignore these check boxes * bonus: when you click on "disable private keys" it disables encrypt wallet and checks blank wallet * label changes: see screenshot * tooltip changes: see code diff Note that a blank wallet name isn't allowed in the dialog; I haven't addressed that. _Update 2020-10-30_, dropped the new strings for now: <img width="450" alt="Schermafbeelding 2020-10-30 om 11 26 55" src="https://user-images.githubusercontent.com/10217/97694591-1b99fc80-1aa3-11eb-8b85-e19f1ad5add4.png"> ACKs for top commit: fjahr: Tested ACK ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae jonatack: re-ACK ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae, per `git diff d393708 ac64cec` only change since my last review is improving the placeholder from "MyWallet" to "Wallet" and dropping the last commit. Tested creating a dozen wallets in signet with different combinations of options and then verifying/comparing their characteristics in the console with getwalletinfo. My remaining caveats are (1) the need for less user surprise by either (a) improving the user info or (b) with less auto-(un)selecting as mentioned in https://github.com/bitcoin-core/gui/pull/96#issuecomment-727017409 and (2) I prefer the "Encrypt private keys" and "Watch-only" wording and descriptions below over the current ones; hopefully these can be addressed in a follow-up. hebasto: re-ACK ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae ryanofsky: Code review ACK ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae. Only changes since last review are tweaking placeholder text and dropping "allow nameless" commit Tree-SHA512: a25f84eb66ee4f99af441d73e33928df9d9cf592177398ef48f0037f5913699e47a162cf1301c83b34501546d43ff4ae12607fd078c5c03b92f573bf7604a9f2
-rw-r--r--src/qt/createwalletdialog.cpp27
-rw-r--r--src/qt/forms/createwalletdialog.ui32
2 files changed, 48 insertions, 11 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp
index 38c6bfe56a..2ded6a1d89 100644
--- a/src/qt/createwalletdialog.cpp
+++ b/src/qt/createwalletdialog.cpp
@@ -35,11 +35,28 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
}
});
-#ifndef USE_SQLITE
- ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)"));
- ui->descriptor_checkbox->setEnabled(false);
- ui->descriptor_checkbox->setChecked(false);
-#endif
+ connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) {
+ // Disable the encrypt_wallet_checkbox when isDisablePrivateKeysChecked is
+ // set to true, enable it when isDisablePrivateKeysChecked is false.
+ ui->encrypt_wallet_checkbox->setEnabled(!checked);
+
+ // Wallets without private keys start out blank
+ if (checked) {
+ ui->blank_wallet_checkbox->setChecked(true);
+ }
+
+ // When the encrypt_wallet_checkbox is disabled, uncheck it.
+ if (!ui->encrypt_wallet_checkbox->isEnabled()) {
+ ui->encrypt_wallet_checkbox->setChecked(false);
+ }
+ });
+
+ #ifndef USE_SQLITE
+ ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)"));
+ ui->descriptor_checkbox->setEnabled(false);
+ ui->descriptor_checkbox->setChecked(false);
+ #endif
+
}
CreateWalletDialog::~CreateWalletDialog()
diff --git a/src/qt/forms/createwalletdialog.ui b/src/qt/forms/createwalletdialog.ui
index b592140dd7..ea713e1abd 100644
--- a/src/qt/forms/createwalletdialog.ui
+++ b/src/qt/forms/createwalletdialog.ui
@@ -38,6 +38,9 @@
<height>24</height>
</rect>
</property>
+ <property name="placeholderText">
+ <string>Wallet</string>
+ </property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
@@ -68,17 +71,33 @@
<string>Encrypt Wallet</string>
</property>
<property name="checked">
- <bool>true</bool>
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="advanced_options_label">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>90</y>
+ <width>130</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">font-weight:bold;</string>
+ </property>
+ <property name="text">
+ <string>Advanced options</string>
</property>
</widget>
<widget class="QCheckBox" name="disable_privkeys_checkbox">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
- <y>80</y>
+ <y>115</y>
<width>171</width>
<height>22</height>
</rect>
@@ -94,8 +113,8 @@
<property name="geometry">
<rect>
<x>20</x>
- <y>110</y>
- <width>171</width>
+ <y>135</y>
+ <width>220</width>
<height>22</height>
</rect>
</property>
@@ -110,7 +129,7 @@
<property name="geometry">
<rect>
<x>20</x>
- <y>140</y>
+ <y>155</y>
<width>171</width>
<height>22</height>
</rect>
@@ -128,6 +147,7 @@
<tabstop>encrypt_wallet_checkbox</tabstop>
<tabstop>disable_privkeys_checkbox</tabstop>
<tabstop>blank_wallet_checkbox</tabstop>
+ <tabstop>descriptor_checkbox</tabstop>
</tabstops>
<resources/>
<connections>