1
0

Refactoring

This commit is contained in:
Scott E. Graves
2017-02-18 13:54:02 -06:00
parent e17e3d4934
commit a4d719c726
2 changed files with 4 additions and 4 deletions

View File

@@ -321,7 +321,7 @@ HRESULT CSiaDriveDlg::OnButtonUnlockWallet(IHTMLElement* /*pElement*/)
std::thread th([this, pwd]() { std::thread th([this, pwd]() {
if (ApiSuccess(_siaApi->GetWallet()->Unlock(pwd))) if (ApiSuccess(_siaApi->GetWallet()->Unlock(pwd)))
{ {
QueueUiAction([this]() { ExecuteUiAction([this]() {
SetWalletUnlockPassword(L""); SetWalletUnlockPassword(L"");
SetBodyEnabled(true); SetBodyEnabled(true);
ReloadDisplay(); ReloadDisplay();
@@ -329,7 +329,7 @@ HRESULT CSiaDriveDlg::OnButtonUnlockWallet(IHTMLElement* /*pElement*/)
} }
else else
{ {
QueueUiAction([this]() { ExecuteUiAction([this]() {
SetWalletUnlockPassword(L""); SetWalletUnlockPassword(L"");
AfxMessageBox(L"Invalid password entered"); AfxMessageBox(L"Invalid password entered");
SetBodyEnabled(true); SetBodyEnabled(true);
@@ -520,7 +520,7 @@ void CSiaDriveDlg::OnTimer(UINT_PTR nIDEvent)
} }
} }
void CSiaDriveDlg::QueueUiAction(std::function<void()> fn) void CSiaDriveDlg::ExecuteUiAction(std::function<void()> fn)
{ {
if (GetCurrentThreadId() == _uiThreadId) if (GetCurrentThreadId() == _uiThreadId)
{ {

View File

@@ -84,7 +84,7 @@ private:
void SetRenterUsedFunds(const SiaCurrency& currency); void SetRenterUsedFunds(const SiaCurrency& currency);
void SetRenterHosts(const std::uint64_t& hosts); void SetRenterHosts(const std::uint64_t& hosts);
void SetRenterTotalUsed(const std::uint64_t& bytes); void SetRenterTotalUsed(const std::uint64_t& bytes);
void QueueUiAction(std::function<void()> action); void ExecuteUiAction(std::function<void()> action);
void ProcessUiActionQueue(); void ProcessUiActionQueue();
void ClearDisplay(); void ClearDisplay();