mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Dynamically remove/insert the Options for encryption in the menus.
This commit is contained in:
parent
98545d2cdf
commit
81598083e7
@ -171,7 +171,7 @@
|
|||||||
<property name="kind">wxITEM_NORMAL</property>
|
<property name="kind">wxITEM_NORMAL</property>
|
||||||
<property name="label">&Encrypt Wallet...</property>
|
<property name="label">&Encrypt Wallet...</property>
|
||||||
<property name="name">m_menuOptionsEncryptWallet</property>
|
<property name="name">m_menuOptionsEncryptWallet</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">public</property>
|
||||||
<property name="shortcut"></property>
|
<property name="shortcut"></property>
|
||||||
<property name="unchecked_bitmap"></property>
|
<property name="unchecked_bitmap"></property>
|
||||||
<event name="OnMenuSelection">OnMenuOptionsEncryptWallet</event>
|
<event name="OnMenuSelection">OnMenuOptionsEncryptWallet</event>
|
||||||
@ -186,7 +186,7 @@
|
|||||||
<property name="kind">wxITEM_NORMAL</property>
|
<property name="kind">wxITEM_NORMAL</property>
|
||||||
<property name="label">&Change Wallet Encryption Passphrase...</property>
|
<property name="label">&Change Wallet Encryption Passphrase...</property>
|
||||||
<property name="name">m_menuOptionsChangeWalletPassphrase</property>
|
<property name="name">m_menuOptionsChangeWalletPassphrase</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">public</property>
|
||||||
<property name="shortcut"></property>
|
<property name="shortcut"></property>
|
||||||
<property name="unchecked_bitmap"></property>
|
<property name="unchecked_bitmap"></property>
|
||||||
<event name="OnMenuSelection">OnMenuOptionsChangeWalletPassphrase</event>
|
<event name="OnMenuSelection">OnMenuOptionsChangeWalletPassphrase</event>
|
||||||
|
@ -368,6 +368,11 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
|
|||||||
if (CWalletDB(pwalletMain->strWalletFile,"r").ReadDefaultKey(vchPubKey))
|
if (CWalletDB(pwalletMain->strWalletFile,"r").ReadDefaultKey(vchPubKey))
|
||||||
m_textCtrlAddress->SetValue(PubKeyToAddress(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
|
// Fill listctrl with wallet transactions
|
||||||
RefreshListCtrl();
|
RefreshListCtrl();
|
||||||
}
|
}
|
||||||
@ -1217,6 +1222,9 @@ void CMainFrame::OnMenuOptionsEncryptWallet(wxCommandEvent& event)
|
|||||||
munlock(&strWalletPass[0], strWalletPass.capacity());
|
munlock(&strWalletPass[0], strWalletPass.capacity());
|
||||||
munlock(&strWalletPassTest[0], strWalletPassTest.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");
|
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)
|
void CMainFrame::OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event)
|
||||||
|
@ -32,11 +32,9 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
|
|||||||
m_menuOptionsChangeYourAddress = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Your Receiving Addresses...") ) , wxEmptyString, wxITEM_NORMAL );
|
m_menuOptionsChangeYourAddress = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Your Receiving Addresses...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||||
m_menuOptions->Append( m_menuOptionsChangeYourAddress );
|
m_menuOptions->Append( m_menuOptionsChangeYourAddress );
|
||||||
|
|
||||||
wxMenuItem* m_menuOptionsEncryptWallet;
|
|
||||||
m_menuOptionsEncryptWallet = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Encrypt Wallet...") ) , wxEmptyString, wxITEM_NORMAL );
|
m_menuOptionsEncryptWallet = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Encrypt Wallet...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||||
m_menuOptions->Append( m_menuOptionsEncryptWallet );
|
m_menuOptions->Append( m_menuOptionsEncryptWallet );
|
||||||
|
|
||||||
wxMenuItem* m_menuOptionsChangeWalletPassphrase;
|
|
||||||
m_menuOptionsChangeWalletPassphrase = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Change Wallet Encryption Passphrase...") ) , wxEmptyString, wxITEM_NORMAL );
|
m_menuOptionsChangeWalletPassphrase = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Change Wallet Encryption Passphrase...") ) , wxEmptyString, wxITEM_NORMAL );
|
||||||
m_menuOptions->Append( m_menuOptionsChangeWalletPassphrase );
|
m_menuOptions->Append( m_menuOptionsChangeWalletPassphrase );
|
||||||
|
|
||||||
|
@ -117,6 +117,8 @@ class CMainFrameBase : public wxFrame
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wxMenu* m_menuOptions;
|
wxMenu* m_menuOptions;
|
||||||
|
wxMenuItem* m_menuOptionsEncryptWallet;
|
||||||
|
wxMenuItem* m_menuOptionsChangeWalletPassphrase;
|
||||||
wxStatusBar* m_statusBar;
|
wxStatusBar* m_statusBar;
|
||||||
wxTextCtrl* m_textCtrlAddress;
|
wxTextCtrl* m_textCtrlAddress;
|
||||||
wxListCtrl* m_listCtrlAll;
|
wxListCtrl* m_listCtrlAll;
|
||||||
|
Loading…
Reference in New Issue
Block a user