Files
openairinterface5g/common/utils/itti_analyzer/libui/ui_notif_dlg.c
T
winckel 0b31d1403a Modified ITTI log file format:
- removed signal_name.
- added message start and end markers.
Added a "cancel" button for some dialog box.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4861 818b1a75-f10b-46b9-bf7c-635c3b92a50f
2014-01-13 22:32:06 +00:00

43 lines
1.1 KiB
C

#define G_LOG_DOMAIN ("UI")
#include "rc.h"
#include "ui_notif_dlg.h"
#include "ui_main_screen.h"
static const char * const title_type[] =
{"Info", "Warning", "Question", "Error", "Other"};
int ui_notification_dialog(GtkMessageType type, gboolean cancel, const char *title, const char *fmt, ...)
{
va_list args;
GtkWidget *dialogbox;
char buffer[200];
int result = RC_OK;
va_start(args, fmt);
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,
cancel ? GTK_BUTTONS_OK_CANCEL : GTK_BUTTONS_OK, "%s",
buffer);
gtk_dialog_set_default_response (GTK_DIALOG(dialogbox), GTK_RESPONSE_OK);
snprintf (buffer, sizeof(buffer), "%s: %s", title_type[type], title);
gtk_window_set_title (GTK_WINDOW(dialogbox), buffer);
if (gtk_dialog_run (GTK_DIALOG (dialogbox)) == GTK_RESPONSE_CANCEL)
{
result = RC_FAIL;
}
gtk_widget_destroy (dialogbox);
va_end(args);
return result;
}