Skip to content

Commit

Permalink
Merge e7986c5 into merged_master (Bitcoin PR bitcoin-core/gui#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Dec 2, 2020
2 parents 94f7b7b + e7986c5 commit 50dafec
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
27 changes: 22 additions & 5 deletions src/qt/createwalletdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
32 changes: 26 additions & 6 deletions src/qt/forms/createwalletdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -110,7 +129,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>140</y>
<y>155</y>
<width>171</width>
<height>22</height>
</rect>
Expand All @@ -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>
Expand Down

0 comments on commit 50dafec

Please sign in to comment.