From a4e9f41948ddb07e1668a6b8e15c19d1838dc0ab Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 23 May 2020 20:56:20 +0100 Subject: gtk: Implement handling of new present_cookies callback Signed-off-by: Daniel Silverstone --- frontends/gtk/cookies.c | 3 ++- frontends/gtk/cookies.h | 2 +- frontends/gtk/gui.c | 1 + frontends/gtk/toolbar.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'frontends/gtk') diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c index d787e35fb..0df9719cb 100644 --- a/frontends/gtk/cookies.c +++ b/frontends/gtk/cookies.c @@ -309,13 +309,14 @@ static nserror nsgtk_cookies_init(void) /* exported function documented gtk/cookies.h */ -nserror nsgtk_cookies_present(void) +nserror nsgtk_cookies_present(const char *search_term) { nserror res; res = nsgtk_cookies_init(); if (res == NSERROR_OK) { gtk_window_present(cookie_window->wnd); + res = cookie_manager_set_search_string(search_term); } return res; } diff --git a/frontends/gtk/cookies.h b/frontends/gtk/cookies.h index c1a68b7f9..b8fc9aba2 100644 --- a/frontends/gtk/cookies.h +++ b/frontends/gtk/cookies.h @@ -28,7 +28,7 @@ * * \return NSERROR_OK on success else appropriate error code on faliure. */ -nserror nsgtk_cookies_present(void); +nserror nsgtk_cookies_present(const char *search_term); /** * Free any resources allocated for the cookie window. diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c index 17dbc499a..e5006d954 100644 --- a/frontends/gtk/gui.c +++ b/frontends/gtk/gui.c @@ -1183,6 +1183,7 @@ static struct gui_misc_table nsgtk_misc_table = { .quit = gui_quit, .launch_url = gui_launch_url, .pdf_password = nsgtk_pdf_password, + .present_cookies = nsgtk_cookies_present, }; diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c index d08973293..32adabc5b 100644 --- a/frontends/gtk/toolbar.c +++ b/frontends/gtk/toolbar.c @@ -3022,7 +3022,7 @@ static gboolean showcookies_button_clicked_cb(GtkWidget *widget, gpointer data) { nserror res; - res = nsgtk_cookies_present(); + res = nsgtk_cookies_present(NULL); if (res != NSERROR_OK) { NSLOG(netsurf, INFO, "Unable to initialise cookies window."); } -- cgit v1.2.3