Clean unused elemements
This commit is contained in:
@@ -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();
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user