aboutsummaryrefslogtreecommitdiff
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorMatt Corallo <matt@bluematt.me>2011-06-29 01:08:48 +0200
committerMatt Corallo <matt@bluematt.me>2011-07-13 02:11:25 +0200
commit81598083e7c822964815bdb1e26d6c62760e52b8 (patch)
tree3b2beb6045bdaa4563c351e397214829dde3e3bf /src/ui.cpp
parent98545d2cdf53f7b6f32eba7a7f51034a9ca994c2 (diff)
downloadbitcoin-81598083e7c822964815bdb1e26d6c62760e52b8.tar.xz
Dynamically remove/insert the Options for encryption in the menus.
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 52315e1fe4..9e099ae57c 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -368,6 +368,11 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
if (CWalletDB(pwalletMain->strWalletFile,"r").ReadDefaultKey(vchPubKey))
m_textCtrlAddress->SetValue(PubKeyToAddress(vchPubKey));
+ if (pwalletMain->IsCrypted())
+ m_menuOptions->Remove(m_menuOptionsEncryptWallet);
+ else
+ m_menuOptions->Remove(m_menuOptionsChangeWalletPassphrase);
+
// Fill listctrl with wallet transactions
RefreshListCtrl();
}
@@ -1217,6 +1222,9 @@ void CMainFrame::OnMenuOptionsEncryptWallet(wxCommandEvent& event)
munlock(&strWalletPass[0], strWalletPass.capacity());
munlock(&strWalletPassTest[0], strWalletPassTest.capacity());
wxMessageBox(_("Wallet Encrypted.\nRemember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer."), "Bitcoin");
+
+ m_menuOptions->Remove(m_menuOptionsEncryptWallet);
+ m_menuOptions->Insert(m_menuOptions->GetMenuItemCount() - 1, m_menuOptionsChangeWalletPassphrase);
}
void CMainFrame::OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event)