aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-06 23:06:56 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-06 23:06:56 +0200
commit34c0940e6cd6d222f2234d81433fef38ca3a3738 (patch)
treea547f0bfd499e5c95035a701439fd4a0df1440f1
parent750fd640b56e169caafdbb96bef0c3c3af3dba1f (diff)
downloadEpisodeBrowser-34c0940e6cd6d222f2234d81433fef38ca3a3738.tar.gz
Persist "View Watched" setting.
-rw-r--r--c/main.c15
-rw-r--r--pl/cfg.pl11
2 files changed, 20 insertions, 6 deletions
diff --git a/c/main.c b/c/main.c
index fcb8d81..cbc3167 100644
--- a/c/main.c
+++ b/c/main.c
@@ -110,6 +110,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HMODULE hModule;
FARPROC GetDpiForWindow;
+ term_t t;
extern HWND HWnd, HElv;
HWnd = hWnd;
IDPI = 96;
@@ -119,7 +120,11 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
FreeLibrary(hModule);
}
SetWindowPos(hWnd, NULL, -1, -1, Dpi(510), Dpi(400), SWP_NOMOVE);
- SetupFonts();
+ t = T(1);
+ P("cfg","get_view_watched",1,t) goto s;
+ GI(t,&BViewWatched);
+ CheckMenuItem(GetMenu(hWnd), ID_VIEW_WATCHED, BViewWatched? MF_CHECKED: MF_UNCHECKED);
+ s: SetupFonts();
DlvCreate();
ElvCreate();
UpdateTheme();
@@ -201,11 +206,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case ID_VIEW_WATCHED:
{
- HMENU hMenu;
- hMenu = GetMenu(hWnd);
- CheckMenuItem(hMenu, ID_VIEW_WATCHED, BViewWatched? MF_UNCHECKED: MF_CHECKED);
+ term_t t;
+ CheckMenuItem(GetMenu(hWnd), ID_VIEW_WATCHED, BViewWatched? MF_UNCHECKED: MF_CHECKED);
BViewWatched = !BViewWatched;
ElvUpdate();
+ t = T(1);
+ PI(t,BViewWatched) break;
+ P("cfg","set_view_watched",1,t);
break;
}
case ID_WATCH:
diff --git a/pl/cfg.pl b/pl/cfg.pl
index f24e44e..90b1e94 100644
--- a/pl/cfg.pl
+++ b/pl/cfg.pl
@@ -22,12 +22,19 @@ get_root(V) :-
set_glob(V) :- set_key('EpisodeRoot', V).
get_glob(V) :-
- ( get_key('EpisodeRoot', V)
+ ( get_key('EpisodeRoot', V), !
; V = '*/*.*'
).
set_url(V) :- set_key('UrlPrefix', V).
get_url(V) :-
- ( get_key('UrlPrefix', V)
+ ( get_key('UrlPrefix', V), !
; V = 'https://gogoanime.fi/detective-conan-episode-'
).
+
+set_view_watched(V) :- set_key('ViewWatched', V).
+get_view_watched(V) :-
+ ( get_key('ViewWatched', V),
+ integer(V), !
+ ; V = 1
+ ).