gui: rename encrypt(), blank(), and askPasshprase()
as well as disablePrivateKeys() to be consistent in naming.
This commit is contained in:
parent
4c329d43a5
commit
43aa9b0d79
4 changed files with 14 additions and 13 deletions
|
@ -25,7 +25,8 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->encrypt_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) {
|
connect(ui->encrypt_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) {
|
||||||
// Disable disable_privkeys_checkbox when encrypt is set to true, enable it when encrypt is false
|
// Disable the disable_privkeys_checkbox when isEncryptWalletChecked is
|
||||||
|
// set to true, enable it when isEncryptWalletChecked is false.
|
||||||
ui->disable_privkeys_checkbox->setEnabled(!checked);
|
ui->disable_privkeys_checkbox->setEnabled(!checked);
|
||||||
|
|
||||||
// When the disable_privkeys_checkbox is disabled, uncheck it.
|
// When the disable_privkeys_checkbox is disabled, uncheck it.
|
||||||
|
@ -45,17 +46,17 @@ QString CreateWalletDialog::walletName() const
|
||||||
return ui->wallet_name_line_edit->text();
|
return ui->wallet_name_line_edit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreateWalletDialog::encrypt() const
|
bool CreateWalletDialog::isEncryptWalletChecked() const
|
||||||
{
|
{
|
||||||
return ui->encrypt_wallet_checkbox->isChecked();
|
return ui->encrypt_wallet_checkbox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreateWalletDialog::disablePrivateKeys() const
|
bool CreateWalletDialog::isDisablePrivateKeysChecked() const
|
||||||
{
|
{
|
||||||
return ui->disable_privkeys_checkbox->isChecked();
|
return ui->disable_privkeys_checkbox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreateWalletDialog::blank() const
|
bool CreateWalletDialog::isMakeBlankWalletChecked() const
|
||||||
{
|
{
|
||||||
return ui->blank_wallet_checkbox->isChecked();
|
return ui->blank_wallet_checkbox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@ public:
|
||||||
virtual ~CreateWalletDialog();
|
virtual ~CreateWalletDialog();
|
||||||
|
|
||||||
QString walletName() const;
|
QString walletName() const;
|
||||||
bool encrypt() const;
|
bool isEncryptWalletChecked() const;
|
||||||
bool disablePrivateKeys() const;
|
bool isDisablePrivateKeysChecked() const;
|
||||||
bool blank() const;
|
bool isMakeBlankWalletChecked() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::CreateWalletDialog *ui;
|
Ui::CreateWalletDialog *ui;
|
||||||
|
|
|
@ -179,7 +179,7 @@ CreateWalletActivity::~CreateWalletActivity()
|
||||||
delete m_passphrase_dialog;
|
delete m_passphrase_dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateWalletActivity::askPasshprase()
|
void CreateWalletActivity::askPassphrase()
|
||||||
{
|
{
|
||||||
m_passphrase_dialog = new AskPassphraseDialog(AskPassphraseDialog::Encrypt, m_parent_widget, &m_passphrase);
|
m_passphrase_dialog = new AskPassphraseDialog(AskPassphraseDialog::Encrypt, m_parent_widget, &m_passphrase);
|
||||||
m_passphrase_dialog->show();
|
m_passphrase_dialog->show();
|
||||||
|
@ -201,10 +201,10 @@ void CreateWalletActivity::createWallet()
|
||||||
|
|
||||||
std::string name = m_create_wallet_dialog->walletName().toStdString();
|
std::string name = m_create_wallet_dialog->walletName().toStdString();
|
||||||
uint64_t flags = 0;
|
uint64_t flags = 0;
|
||||||
if (m_create_wallet_dialog->disablePrivateKeys()) {
|
if (m_create_wallet_dialog->isDisablePrivateKeysChecked()) {
|
||||||
flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS;
|
flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS;
|
||||||
}
|
}
|
||||||
if (m_create_wallet_dialog->blank()) {
|
if (m_create_wallet_dialog->isMakeBlankWalletChecked()) {
|
||||||
flags |= WALLET_FLAG_BLANK_WALLET;
|
flags |= WALLET_FLAG_BLANK_WALLET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,8 +246,8 @@ void CreateWalletActivity::create()
|
||||||
Q_EMIT finished();
|
Q_EMIT finished();
|
||||||
});
|
});
|
||||||
connect(m_create_wallet_dialog, &QDialog::accepted, [this] {
|
connect(m_create_wallet_dialog, &QDialog::accepted, [this] {
|
||||||
if (m_create_wallet_dialog->encrypt()) {
|
if (m_create_wallet_dialog->isEncryptWalletChecked()) {
|
||||||
askPasshprase();
|
askPassphrase();
|
||||||
} else {
|
} else {
|
||||||
createWallet();
|
createWallet();
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ Q_SIGNALS:
|
||||||
void created(WalletModel* wallet_model);
|
void created(WalletModel* wallet_model);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void askPasshprase();
|
void askPassphrase();
|
||||||
void createWallet();
|
void createWallet();
|
||||||
void finish();
|
void finish();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue