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. --- utils/utils.c | 12 ++++++++++++ utils/utils.h | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/utils.c b/utils/utils.c index 1509a6b09..22af9d6fa 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -32,6 +32,12 @@ #include #include +/* required for depricated warn_user interface */ +#include +#include "utils/errors.h" +#include "desktop/gui_misc.h" +#include "desktop/gui_internal.h" + #include "utils/config.h" #include "utils/log.h" #include "utils/messages.h" @@ -575,3 +581,9 @@ nserror nsc_strntimet(const char *str, size_t size, time_t *timep) return NSERROR_OK; } + +/* exported interface documented in utils/utils.h */ +void warn_user(const char *message, const char *detail) +{ + guit->misc->warning(message, detail); +} diff --git a/utils/utils.h b/utils/utils.h index d87c9a0db..ec4bb5cbd 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -117,7 +117,15 @@ struct dirent; bool is_dir(const char *path); -/* Platform specific functions */ -void warn_user(const char *warning, const char *detail); +/** + * Warn the user of an event. + * + * \warning depricated interface, this calls the warning entry in the + * miscellaneous gui table and discards the return code. + * + * \param[in] message A warning looked up in the message translation table + * \param[in] detail Additional text to be displayed or NULL. + */ +void warn_user(const char *message, const char *detail); #endif -- cgit v1.2.3