@@ -205,11 +205,10 @@ void WalletView::showOutOfSyncWarning(bool fShow)
205
205
206
206
void WalletView::encryptWallet ()
207
207
{
208
- AskPassphraseDialog dlg (AskPassphraseDialog::Encrypt, this );
209
- dlg.setModel (walletModel);
210
- dlg.exec ();
211
-
212
- Q_EMIT encryptionStatusChanged ();
208
+ auto dlg = new AskPassphraseDialog (AskPassphraseDialog::Encrypt, this );
209
+ dlg->setModel (walletModel);
210
+ connect (dlg, &QDialog::finished, this , &WalletView::encryptionStatusChanged);
211
+ GUIUtil::ShowModalDialogAndDeleteOnClose (dlg);
213
212
}
214
213
215
214
void WalletView::backupWallet ()
@@ -234,19 +233,18 @@ void WalletView::backupWallet()
234
233
235
234
void WalletView::changePassphrase ()
236
235
{
237
- AskPassphraseDialog dlg (AskPassphraseDialog::ChangePass, this );
238
- dlg. setModel (walletModel);
239
- dlg. exec ( );
236
+ auto dlg = new AskPassphraseDialog (AskPassphraseDialog::ChangePass, this );
237
+ dlg-> setModel (walletModel);
238
+ GUIUtil::ShowModalDialogAndDeleteOnClose (dlg );
240
239
}
241
240
242
241
void WalletView::unlockWallet ()
243
242
{
244
243
// Unlock wallet when requested by wallet model
245
- if (walletModel->getEncryptionStatus () == WalletModel::Locked)
246
- {
247
- AskPassphraseDialog dlg (AskPassphraseDialog::Unlock, this );
248
- dlg.setModel (walletModel);
249
- dlg.exec ();
244
+ if (walletModel->getEncryptionStatus () == WalletModel::Locked) {
245
+ auto dlg = new AskPassphraseDialog (AskPassphraseDialog::Unlock, this );
246
+ dlg->setModel (walletModel);
247
+ GUIUtil::ShowModalDialogAndDeleteOnClose (dlg);
250
248
}
251
249
}
252
250
0 commit comments