aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 449863b..5a7ec27 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -215,7 +215,7 @@ static LRESULT CALLBACK CBTProc(const int nCode, const WPARAM wParam, const LPAR
Mark m;
char* s;
if (Pl("cfg","get_limit_screenwriter",&s))
- strcpy_s(g_limitScreenwriter, sizeof(g_limitScreenwriter), s);
+ Strcpy(g_limitScreenwriter, s);
int dlvHeight = 0;
Pl("cfg","get_dlv_height",&dlvHeight);
@@ -418,18 +418,19 @@ void HandleMainMenu(const HWND hWnd, const WORD command)
g_elv->Update();
g_elv->EnsureFocusVisible();
break;
- case IDM_VIEW_OTHERS: /* Show/hide other screenwriters. */
- if (g_limitScreenwriter[0]) {
+ case IDM_VIEW_OTHERS:
+ if (g_limitScreenwriter[0]) { /* Show episodes by all screenwriters. */
CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, MF_CHECKED);
g_limitScreenwriter[0] = 0;
- } else {
- LVITEM lvi = {LVIF_PARAM, -1};
- if (!g_elv->FindNextItem(&lvi, LVNI_FOCUSED)) break;
-
+ } else { /* Hide episodes by other screenwriters than current. */
+ Mark m;
char* s;
- if (!Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&s)) break;
- strcpy_s(g_limitScreenwriter, sizeof(g_limitScreenwriter), s);
- CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, MF_UNCHECKED);
+ LVITEM lvi = {LVIF_PARAM, -1};
+ if (g_elv->FindNextItem(&lvi, LVNI_FOCUSED)
+ && Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&s)) {
+ Strcpy(g_limitScreenwriter, s);
+ CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, MF_UNCHECKED);
+ }
}
Pl("cfg","set_limit_screenwriter",g_limitScreenwriter);
g_elv->Update();
@@ -484,8 +485,7 @@ void HandleContextMenu(const HWND, const WORD command)
g_elv->Redraw();
if (cNotFound == 1) {
- EBMessageBox(L"Episode could not be opened locally.",
- L"Error", MB_ICONWARNING);
+ EBMessageBox(L"Episode could not be opened locally.", L"Error", MB_ICONWARNING);
} else if (cNotFound) {
wchar_t msg[64] = {0};
Swprintf(msg, L"%d episodes could not be opened locally.", cNotFound);
@@ -504,7 +504,8 @@ void WaitFor(const char* mod, const char* pred)
if (activePred) {
wchar_t msg[256] = {0};
- Swprintf(msg, L"Another task (%s) is active. "
+ 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));
if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES)