From bf3ee089cb57765c48065423027eb4fffbe297f1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 25 Apr 2016 23:11:55 +0100 Subject: use the miscellaneous table warning entry change all the frontends to provide the warning callback in the miscelaneous table instead of using the warn_user function. Changing all the warn_user callsites still requires completion. --- desktop/gui_factory.c | 3 +++ desktop/gui_misc.h | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'desktop') diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index c15603e1c..956c508e6 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -719,6 +719,9 @@ static nserror verify_misc_register(struct gui_misc_table *gmt) if (gmt->schedule == NULL) { return NSERROR_BAD_PARAMETER; } + if (gmt->warning == NULL) { + return NSERROR_BAD_PARAMETER; + } /* fill in the optional entries with defaults */ if (gmt->quit == NULL) { diff --git a/desktop/gui_misc.h b/desktop/gui_misc.h index a46c85367..399d93895 100644 --- a/desktop/gui_misc.h +++ b/desktop/gui_misc.h @@ -57,6 +57,18 @@ struct gui_misc_table { */ nserror (*schedule)(int t, void (*callback)(void *p), void *p); + /** + * Warn the user of an event. + * + * \param[in] message A warning looked up in the message + * translation table + * \param[in] detail Additional text to be displayed or NULL. + * \return NSERROR_OK on success or error code if there was a + * faliure displaying the message to the user. + */ + nserror (*warning)(const char *message, const char *detail); + + /* Optional entries */ /** @@ -86,11 +98,6 @@ struct gui_misc_table { void (*login)(struct nsurl *url, const char *realm, nserror (*cb)(bool proceed, void *pw), void *cbpw); - /** - * Warn the user of an event. - */ - void (*warning)(const char *warning, const char *detail); - /** * Prompt the user for a password for a PDF. */ -- cgit v1.2.3