diff options
author | John Ankarström <john@ankarstrom.se> | 2022-05-28 20:50:33 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-05-28 20:50:33 +0200 |
commit | e12dafae0488d82d05be9dfde3d99f9e3cbb0ce0 (patch) | |
tree | b8b24e64dc0bf3e61d997e726153eb4c5c5756fe /c/main.c | |
parent | 2608667f440c1d0f15f26c5856f86cb16bb02175 (diff) | |
download | EpisodeBrowser-e12dafae0488d82d05be9dfde3d99f9e3cbb0ce0.tar.gz |
Add option to show/hide other screenwriters.
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 60 |
1 files changed, 57 insertions, 3 deletions
@@ -6,6 +6,7 @@ #include "resource.h" #include "defs.h" +char SzLimitScreenwriter[64] = {0}; HFONT HfNormal; HFONT HfBold; HMENU HPopupMenu; @@ -127,7 +128,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) term_t t; t = T(1); P("cfg","get_view_watched",1,t) goto s; - GI(t,&BViewWatched); + GI(t,&BViewWatched) goto s; CheckMenuItem(GetMenu(hWnd), IDM_VIEW_WATCHED, BViewWatched? MF_CHECKED: MF_UNCHECKED); } @@ -135,11 +136,22 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) term_t t; t = T(1); P("cfg","get_view_tv_original",1,t) goto t; - GI(t,&BViewTVOriginal); + GI(t,&BViewTVOriginal) goto t; CheckMenuItem(GetMenu(hWnd), IDM_VIEW_TV_ORIGINAL, BViewTVOriginal? MF_CHECKED: MF_UNCHECKED); } - t: SetupFonts(); + t: { + char *sz; + term_t t; + t = T(1); + P("cfg","get_limit_screenwriter",1,t) goto u; + GAC(t,&sz) goto u; + strcpy_s(SzLimitScreenwriter, + sizeof(SzLimitScreenwriter), sz); + CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, + SzLimitScreenwriter[0]? MF_UNCHECKED: MF_CHECKED); + } + u: SetupFonts(); DlvCreate(); ElvCreate(); UpdateTheme(); @@ -270,6 +282,48 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ListView_EnsureVisible(HElv, iEpFocus, TRUE); break; } + case IDM_VIEW_OTHERS: /* Show/hide other screenwriters. */ + { + atom_t a; + int iEpFocus; + term_t t; + extern HWND HElv; + if (SzLimitScreenwriter[0]) { + CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, + MF_CHECKED); + SzLimitScreenwriter[0] = 0; + } else { + atom_t a; + char *sz; + LVITEM lvi; + term_t t; + iEpFocus = ListView_GetNextItem(HElv, -1, LVNI_FOCUSED); + if (iEpFocus == -1) break; + lvi.iItem = iEpFocus; + lvi.mask = LVIF_PARAM; + if (!ListView_GetItem(HElv, &lvi)) break; + t = T(3); + a = A("Screenwriter"); + PI(t,lvi.lParam) break; + PA(t+1,a) break; + P("episode_data","episode_datum",3,t) break; + GAC(t+2,&sz) break; + strcpy_s(SzLimitScreenwriter, + sizeof(SzLimitScreenwriter), sz); + CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, + MF_UNCHECKED); + } + OutputDebugStringA(SzLimitScreenwriter); + ElvUpdate(); + t = T(1); + a = A(SzLimitScreenwriter); + PA(t,a) break; + P("cfg","set_limit_screenwriter",1,t); + iEpFocus = ListView_GetNextItem(HElv, -1, LVNI_FOCUSED); + if (iEpFocus == -1) break; + ListView_EnsureVisible(HElv, iEpFocus, TRUE); + break; + } case IDM_WATCH: case IDM_TOGGLE: case IDM_FORGET: |