2 * critical-error-handler.h
3 * Copyright (C) 2005-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
23 #include "critical-error-handler.h"
26 #include <glib/gi18n.h>
31 static void critical_error_handler (const gchar *log_domain,
32 GLogLevelFlags log_level,
37 /***************************************************************************/
38 /* Initialize error handler. */
39 /***************************************************************************/
41 gl_critical_error_handler_init (void)
43 g_log_set_handler ("LibGlabels",
44 G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
45 critical_error_handler,
48 g_log_set_handler (G_LOG_DOMAIN,
49 G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
50 critical_error_handler,
55 /*-------------------------------------------------------------------------*/
56 /* PRIVATE. Actual error handler. */
57 /*-------------------------------------------------------------------------*/
59 critical_error_handler (const gchar *log_domain,
60 GLogLevelFlags log_level,
66 dialog = gtk_message_dialog_new (NULL,
70 _("gLabels Fatal Error!"));
71 gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
73 gtk_dialog_add_button (GTK_DIALOG (dialog),
76 gtk_dialog_run (GTK_DIALOG (dialog));
84 * Local Variables: -- emacs
86 * c-basic-offset: 8 -- emacs
87 * tab-width: 8 -- emacs
88 * indent-tabs-mode: nil -- emacs