gtk: Implement handling of new present_cookies callback

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-05-23 20:56:20 +01:00
parent 26df6ab7dd
commit a4e9f41948
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
4 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

@ -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.

View File

@ -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,
};

View File

@ -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.");
}