X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Ferror.c;fp=src%2Ferror.c;h=0000000000000000000000000000000000000000;hb=0b85f1dd5993e2ed111ec2ba13bbbb4ebda06ada;hp=c9b6f088eab5000e8eac81f8b3139f62408d677e;hpb=08f8444e2ae5480eea1cf7e2c1e2eb57f46152db;p=rodin%2Fchimara.git diff --git a/src/error.c b/src/error.c deleted file mode 100644 index c9b6f08..0000000 --- a/src/error.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2006 P.F. Chimento - * This file is part of GNOME Inform 7. - * - * GNOME Inform 7 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GNOME Inform 7 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNOME Inform 7; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include - -#include "error.h" - -/* Create and display an error dialog box, with parent window parent, and -message format string msg. If err is not NULL, tack the error message on to the -end of the format string. */ -void -error_dialog(GtkWindow *parent, GError *err, const gchar *msg, ...) -{ - va_list ap; - - va_start(ap, msg); - gchar buffer[1024]; - g_vsnprintf(buffer, 1024, msg, ap); - va_end(ap); - - gchar *message; - if(err) { - message = g_strconcat(buffer, err->message, NULL); - g_error_free(err); - } else - message = g_strdup(buffer); - - GtkWidget *dialog = gtk_message_dialog_new(parent, - parent? GTK_DIALOG_DESTROY_WITH_PARENT : 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - message); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - g_free(message); -}