X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gerror.c;h=43bdabae2839f8a23ce052bbe1962728a0c297d5;hp=c0a4679a1b446a3a4b66a7e93cab7350533d46fc;hb=8cd5a2fdad69fcc7acc85863b69cc9ded97edceb;hpb=1252d8f2c1daeb31fdc8c1f63db3ceadf7e20892 diff --git a/gerror.c b/gerror.c index c0a4679a..43bdabae 100644 --- a/gerror.c +++ b/gerror.c @@ -9,7 +9,7 @@ #include "gerror.h" static void on_info_bar_response(GtkWidget *widget, gint response, - gpointer data) + gpointer data) { struct gui *ui = (struct gui *) data; @@ -24,23 +24,24 @@ static void report_error(struct gui_entry *ge, GError *error) struct gui *ui = ge->ui; if (ui->error_info_bar == NULL) { + GtkWidget *container; + ui->error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK, - GTK_RESPONSE_OK, - NULL); + GTK_RESPONSE_OK, NULL); g_signal_connect(ui->error_info_bar, "response", G_CALLBACK(on_info_bar_response), ui); gtk_info_bar_set_message_type(GTK_INFO_BAR(ui->error_info_bar), - GTK_MESSAGE_ERROR); - + GTK_MESSAGE_ERROR); + ui->error_label = gtk_label_new(error->message); - GtkWidget *container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar)); + container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar)); gtk_container_add(GTK_CONTAINER(container), ui->error_label); - + gtk_box_pack_start(GTK_BOX(ui->vbox), ui->error_info_bar, FALSE, FALSE, 0); gtk_widget_show_all(ui->vbox); } else { char buffer[256]; snprintf(buffer, sizeof(buffer), "Failed to open file."); - gtk_label_set(GTK_LABEL(ui->error_label), buffer); + gtk_label_set_text(GTK_LABEL(ui->error_label), buffer); } }