aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-11 23:25:15 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-11 23:25:15 +0200
commit5fd7a33246d786ee3c7a8d643ff332af793ffa5d (patch)
treea58f6ff86681a416d198110384cbd344f83b273c /c
parent6bcd75ef3fb6786955938019c1eb8a6950e3063e (diff)
downloadEpisodeBrowser-5fd7a33246d786ee3c7a8d643ff332af793ffa5d.tar.gz
Minor formatting.
Diffstat (limited to 'c')
-rw-r--r--c/main.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 1d5bf7b..b0fd7d3 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -534,20 +534,20 @@ void WaitFor(const char* mod, const char* pred)
/* WaitFor uses a thread on the Prolog side to execute a
* predicate asynchronously. */
- static WcharPtr activePred;
+ static WcharPtr predActive;
static UINT_PTR iTimer;
static atom_t aThread;
- if (activePred) {
+ if (predActive) {
wchar_t msg[256] = {0};
Swprintf(msg,
L"Another task (%s) is active. "
L"Do you want to cancel the existing task and start a new one?",
- static_cast<wchar_t*>(activePred));
+ static_cast<wchar_t*>(predActive));
if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES)
return;
KillTimer(nullptr, iTimer);
- activePred = nullptr;
+ predActive = nullptr;
g_elv->Update();
}
@@ -566,7 +566,7 @@ void WaitFor(const char* mod, const char* pred)
} else {
KillTimer(nullptr, iTimer);
i = 0;
- activePred = nullptr;
+ predActive = nullptr;
g_elv->Update();
}
};
@@ -574,7 +574,7 @@ void WaitFor(const char* mod, const char* pred)
Plx(mod,"thread_create",pred,&aThread);
SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), reinterpret_cast<LPARAM>(L"."));
if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc)))
- activePred = WcharPtr::FromNarrow(pred);
+ predActive = WcharPtr::FromNarrow(pred);
}
INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const LPARAM)
@@ -585,11 +585,8 @@ INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wPa
return TRUE;
case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
+ if (LOWORD(wParam) == IDOK)
EndDialog(hWnd, IDOK);
- break;
- }
return TRUE;
default:
@@ -599,8 +596,9 @@ INT_PTR CALLBACK AboutDlgProc(const HWND hWnd, const UINT uMsg, const WPARAM wPa
void UpdateTheme()
{
- if (!IsThemeActive) return;
- const bool bThemeActive = IsThemeActive();
- g_dlv->UpdateTheme(bThemeActive);
- g_elv->UpdateTheme(bThemeActive);
+ if (IsThemeActive) {
+ const bool bThemeActive = IsThemeActive();
+ g_dlv->UpdateTheme(bThemeActive);
+ g_elv->UpdateTheme(bThemeActive);
+ }
}