diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-07 00:40:48 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-07 00:40:48 +0200 |
commit | e2d0b92ffc536c3d34ee751ba688946613bc5693 (patch) | |
tree | c944a70b4db4ed5b8ec9a440335a42fb86602972 /c/main.cpp | |
parent | bea4e9f8740c1bf3ebe80d95ab6e749cfb5de605 (diff) | |
download | EpisodeBrowser-e2d0b92ffc536c3d34ee751ba688946613bc5693.tar.gz |
Add Strcpy.
Diffstat (limited to 'c/main.cpp')
-rw-r--r-- | c/main.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -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) |