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