[project @ 2006-02-10 20:44:04 by adrianl]

Simplify code

svn path=/import/netsurf/; revision=2069
This commit is contained in:
Adrian Lees 2006-02-10 20:44:04 +00:00
parent 9f0f47cff7
commit e7810f25bf

View File

@ -2176,20 +2176,16 @@ void gui_launch_url(const char *url)
void warn_user(const char *warning, const char *detail)
{
union {
char warn_buffer[300];
os_error error;
} d;
LOG(("%s %s", warning, detail));
if (dialog_warning) {
snprintf(d.warn_buffer, sizeof d.warn_buffer, "%s %s",
char warn_buffer[300];
snprintf(warn_buffer, sizeof warn_buffer, "%s %s",
messages_get(warning),
detail ? detail : "");
d.warn_buffer[sizeof d.warn_buffer - 1] = 0;
warn_buffer[sizeof warn_buffer - 1] = 0;
ro_gui_set_icon_string(dialog_warning, ICON_WARNING_MESSAGE,
d.warn_buffer);
warn_buffer);
xwimp_set_icon_state(dialog_warning, ICON_WARNING_HELP,
wimp_ICON_DELETED, wimp_ICON_DELETED);
ro_gui_dialog_open(dialog_warning);
@ -2198,11 +2194,12 @@ void warn_user(const char *warning, const char *detail)
else {
/* probably haven't initialised (properly), use a
non-multitasking error box */
snprintf(d.error.errmess, sizeof d.error.errmess, "%s %s",
os_error error;
snprintf(error.errmess, sizeof error.errmess, "%s %s",
messages_get(warning),
detail ? detail : "");
d.error.errmess[sizeof d.error.errmess - 1] = 0;
xwimp_report_error_by_category(&d.error,
error.errmess[sizeof error.errmess - 1] = 0;
xwimp_report_error_by_category(&error,
wimp_ERROR_BOX_OK_ICON |
wimp_ERROR_BOX_GIVEN_CATEGORY |
wimp_ERROR_BOX_CATEGORY_ERROR <<