diff --git a/common/utils/itti_analyzer/libparser/xml_parse.c b/common/utils/itti_analyzer/libparser/xml_parse.c index 20bc0dd9129292fc9ddbd38dca7df3740d1f391d..03062ac2c1d484dd1155db9f8143542741b95cc3 100644 --- a/common/utils/itti_analyzer/libparser/xml_parse.c +++ b/common/utils/itti_analyzer/libparser/xml_parse.c @@ -665,8 +665,8 @@ int xml_parse_buffer(const char *xml_buffer, const int size) { doc = xmlReadMemory(xml_buffer, size, NULL, NULL, 0); if (doc == NULL) { - g_warning("Failed to parse buffer: %s", xml_buffer); -// ui_notification_dialog(DIALOG_WARNING, "Fail to parse XML buffer"); + g_warning("Failed to parse XML buffer: %s", xml_buffer); + ui_notification_dialog(GTK_MESSAGE_ERROR, "parse messages format definition", "Fail to parse XML buffer"); return RC_FAIL; } @@ -683,8 +683,7 @@ int xml_parse_file(const char *filename) { doc = xmlReadFile (filename, NULL, 0); if (doc == NULL) { - g_warning("Failed to parse %s", filename); -// ui_notification_dialog(DIALOG_WARNING, "Failed to parse file \"%s\"", filename); + ui_notification_dialog(GTK_MESSAGE_ERROR, "parse messages format definition", "Failed to parse file \"%s\"", filename); return RC_FAIL; } @@ -786,7 +785,7 @@ int dissect_signal(buffer_t *buffer, ui_set_signal_text_cb_t ui_set_signal_text_ gpointer user_data) { if (root == NULL) { -// ui_notification_dialog(DIALOG_ERROR, "No message XML file provided"); + g_error("No messages format definition provided"); return RC_FAIL; } diff --git a/common/utils/itti_analyzer/libui/ui_filters.c b/common/utils/itti_analyzer/libui/ui_filters.c index c046b0d5e44176c80dfc1ff1534b07271f286d2b..6db828c1238d7160dc011a586ac58cf6b167d9b0 100644 --- a/common/utils/itti_analyzer/libui/ui_filters.c +++ b/common/utils/itti_analyzer/libui/ui_filters.c @@ -302,7 +302,6 @@ int ui_filters_read(const char *file_name) if (doc == NULL) { - g_warning("Failed to parse \"%s\"", file_name); ui_notification_dialog (GTK_MESSAGE_ERROR, "open filters", "Failed to parse file \"%s\"", file_name); return RC_FAIL; } @@ -311,8 +310,7 @@ int ui_filters_read(const char *file_name) if (ret != RC_OK) { - g_warning("Found no filter definition in \"%s\"", file_name); - ui_notification_dialog (GTK_MESSAGE_ERROR, "open filters", "Found no filter definitions in \"%s\"", file_name); + ui_notification_dialog (GTK_MESSAGE_WARNING, "open filters", "Found no filter definitions in \"%s\"", file_name); return RC_FAIL; } diff --git a/common/utils/itti_analyzer/libui/ui_notif_dlg.c b/common/utils/itti_analyzer/libui/ui_notif_dlg.c index 97908006d75c3516e1b339dca2e80e92d1f68754..42dc60a1582b1d700aaf928cb2bc3447cc2c04ab 100644 --- a/common/utils/itti_analyzer/libui/ui_notif_dlg.c +++ b/common/utils/itti_analyzer/libui/ui_notif_dlg.c @@ -16,6 +16,8 @@ int ui_notification_dialog(GtkMessageType type, const char *title, const char *f vsnprintf (buffer, sizeof(buffer), fmt, args); + g_warning("%s", buffer); + dialogbox = gtk_message_dialog_new (GTK_WINDOW(ui_main_data.window), GTK_DIALOG_MODAL, type, GTK_BUTTONS_OK, "%s", buffer); diff --git a/common/utils/itti_analyzer/libui/ui_notifications.c b/common/utils/itti_analyzer/libui/ui_notifications.c index 1e9006184400e269de714007b5c6b936a8870d2e..d78bc5e825772e595ba56ffbd344bdaec8a62efd 100644 --- a/common/utils/itti_analyzer/libui/ui_notifications.c +++ b/common/utils/itti_analyzer/libui/ui_notifications.c @@ -12,6 +12,7 @@ #include "ui_main_screen.h" #include "ui_menu_bar.h" #include "ui_notifications.h" +#include "ui_notif_dlg.h" #include "ui_callbacks.h" #include "ui_filters.h" @@ -78,7 +79,7 @@ int ui_messages_read(char *filename) source = open (filename, O_RDONLY); if (source < 0) { - g_warning( "Failed to open file \"%s\": %s", filename, g_strerror (errno)); + ui_notification_dialog (GTK_MESSAGE_ERROR, "open messages", "Failed to open file \"%s\": %s", filename, g_strerror (errno)); result = RC_FAIL; } else @@ -93,7 +94,7 @@ int ui_messages_read(char *filename) if (read_data == -1) { - g_warning("Failed to read from file \"%s\": %s", filename, g_strerror (errno)); + ui_notification_dialog (GTK_MESSAGE_ERROR, "open messages", "Failed to read from file \"%s\": %s", filename, g_strerror (errno)); result = RC_FAIL; break; } @@ -112,6 +113,7 @@ int ui_messages_read(char *filename) if (read (source, input_data, input_data_length) < 0) { g_warning("Failed to read from file \"%s\": %s", filename, g_strerror (errno)); + ui_notification_dialog (GTK_MESSAGE_ERROR, "open messages", "Failed to read from file \"%s\": %s", filename, g_strerror (errno)); result = RC_FAIL; break; } @@ -145,7 +147,9 @@ int ui_messages_read(char *filename) case ITTI_STATISTIC_MESSAGE_TYPE: default: - g_warning("Received unknow (or not implemented) message from socket type: %d", message_header.message_type); + ui_notification_dialog (GTK_MESSAGE_WARNING, "open messages", + "Unknown (or not implemented) record type %d in file \"%s\"", + message_header.message_type, filename); break; }