From 60f8f0126d49dc5313d44858e9b4da0aeb1f5697 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 23 May 2020 21:16:10 +0100 Subject: windows: Enable present_cookies callback Signed-off-by: Daniel Silverstone --- frontends/windows/cookies.c | 8 ++++++-- frontends/windows/cookies.h | 2 +- frontends/windows/main.c | 2 ++ frontends/windows/window.c | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'frontends') diff --git a/frontends/windows/cookies.c b/frontends/windows/cookies.c index b3c56da8c..ee754bc3f 100644 --- a/frontends/windows/cookies.c +++ b/frontends/windows/cookies.c @@ -34,6 +34,7 @@ #include "windows/plot.h" #include "windows/corewindow.h" #include "windows/cookies.h" +#include "windows/gui.h" struct nsw32_cookie_window { @@ -170,13 +171,16 @@ static nserror nsw32_cookie_init(HINSTANCE hInstance) /* exported interface documented in windows/cookie.h */ -nserror nsw32_cookies_present(HINSTANCE hInstance) +nserror nsw32_cookies_present(const char *search_term) { nserror res; - res = nsw32_cookie_init(hInstance); + res = nsw32_cookie_init(hinst); if (res == NSERROR_OK) { ShowWindow(cookie_window->core.hWnd, SW_SHOWNORMAL); + if (search_term != NULL) { + res = cookie_manager_set_search_string(search_term); + } } return res; } diff --git a/frontends/windows/cookies.h b/frontends/windows/cookies.h index 8500c7821..dd7ae4279 100644 --- a/frontends/windows/cookies.h +++ b/frontends/windows/cookies.h @@ -35,7 +35,7 @@ * * \return NSERROR_OK on success else appropriate error code on faliure. */ -nserror nsw32_cookies_present(HINSTANCE hinstance); +nserror nsw32_cookies_present(const char *search_term); /** * Free any resources allocated for the cookie window. diff --git a/frontends/windows/main.c b/frontends/windows/main.c index 24362df09..c051f446c 100644 --- a/frontends/windows/main.c +++ b/frontends/windows/main.c @@ -43,6 +43,7 @@ #include "windows/findfile.h" #include "windows/file.h" +#include "windows/cookies.h" #include "windows/drawable.h" #include "windows/corewindow.h" #include "windows/download.h" @@ -370,6 +371,7 @@ static nserror win32_to_unix_commandline(int *argc_out, char ***argv_out) static struct gui_misc_table win32_misc_table = { .schedule = win32_schedule, + .present_cookies = nsw32_cookies_present, }; /** diff --git a/frontends/windows/window.c b/frontends/windows/window.c index 716039aeb..e682eb889 100644 --- a/frontends/windows/window.c +++ b/frontends/windows/window.c @@ -1154,7 +1154,7 @@ nsws_window_command(HWND hwnd, break; case IDM_TOOLS_COOKIES: - nsw32_cookies_present(hinst); + nsw32_cookies_present(NULL); break; case IDM_NAV_BOOKMARKS: -- cgit v1.2.3