Commit 01d0aa7c authored by winckel's avatar winckel
Browse files

Integrated consol logging within dialog box.

Updated use of dialog box.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4339 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 41bc8fdd
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment