/*
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
*/
/*
#
# Copyright (c) 2010. Oracle and/or its affiliates. All rights reserved.
# Use is subject to license terms.
#
*/
#include <gtk/gtk.h>
/* shows an error dialog making it transient for @parent */
void
show_error_dialog (GtkWindow *parent,
const gchar *message,
const gchar *detail)
{
GtkWidget *dialog;
g_return_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent)));
g_return_if_fail (message != NULL);
dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"%s", message);
gtk_window_set_title (GTK_WINDOW (dialog), "");
if (detail)
gtk_message_dialog_format_secondary_text (
GTK_MESSAGE_DIALOG (dialog),
"%s", detail);
if (parent && parent->group)
gtk_window_group_add_window (parent->group, GTK_WINDOW (dialog));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}