1
0

Clean unused elemements

This commit is contained in:
Scott E. Graves
2017-02-08 21:23:41 -06:00
parent f77253862f
commit a0efe07390
2 changed files with 25 additions and 0 deletions

View File

@@ -178,6 +178,8 @@ HRESULT CSiaDriveDlg::OnButtonCancel(IHTMLElement* /*pElement*/)
HRESULT CSiaDriveDlg::OnButtonConfirmSeed(IHTMLElement* /*pElement*/)
{
_seedCreation = false;
_walletCreatedSeed = L"";
UpdateData(FALSE);
this->Navigate(this->m_strCurrentUrl);
return S_OK;
@@ -347,10 +349,31 @@ void CSiaDriveDlg::DisplayCreateWallet()
}
}
void CSiaDriveDlg::RemoveElementById(const String& id)
{
CComPtr<IHTMLDOMNode> element;
if (SUCCEEDED(GetDomElementById(id.c_str(), element)))
{
CComPtr<IHTMLDOMNode> parent;
if (SUCCEEDED(element->get_parentNode(&parent)))
{
CComPtr<IHTMLDOMNode> removed;
parent->removeChild(element, &removed);
}
}
}
void CSiaDriveDlg::ClearCreateElements()
{
RemoveElementById(L"create_wallet");
RemoveElementById(L"disp_wallet_seed");
}
void CSiaDriveDlg::DisplayWalletTab()
{
if (_siaApi.GetWallet()->GetCreated())
{
ClearCreateElements();
if (_siaApi.GetWallet()->GetLocked())
{
DisplayUnlockWallet();

View File

@@ -45,11 +45,13 @@ protected:
virtual BOOL PreTranslateMessage(MSG* pMsg) override;
private:
void ClearCreateElements();
void DisplayCreateWallet();
void DisplayWalletTab();
void DisplaySeedCreated(const String& seed);
bool DisplaySiaInfo();
void DisplayUnlockWallet();
void RemoveElementById(const String& id);
bool UpdateUi(const bool& refresh = true);
HRESULT GetDomElementById(const CString& id, CComPtr<IHTMLDOMNode>& node);
HRESULT GetDomElementAndNodeById(const CString& id, CComPtr<IHTMLDOMNode>& node, CComPtr<IHTMLElement>& elem);