From 663d6ac861b4c527044f6a1f10466ec3001de5f8 Mon Sep 17 00:00:00 2001 From: kraxel Date: Tue, 30 Sep 2008 12:34:16 +0000 Subject: error dialog --- monitor.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 7189c5f..8e6bc4c 100644 --- a/monitor.c +++ b/monitor.c @@ -17,8 +17,18 @@ static void show_error(struct qemu_window *win, char *cmd, char *reply) { - /* FIXME: show error dialog */ - fprintf(stderr, "ERROR: %s: %s\n", cmd, reply); + GtkWidget *dialog; + + dialog = gtk_message_dialog_new(GTK_WINDOW(win->toplevel), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + "ERROR: %s", reply); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "monitor command was:\n%s\n", cmd); + g_signal_connect_swapped(dialog, "response", + G_CALLBACK (gtk_widget_destroy), + dialog); + gtk_widget_show_all(dialog); } static int monitor_parse(struct qemu_window *win, char *buf, int len) -- cgit