From d75bff32b82a9409219e047b8e6a59ebb241acf2 Mon Sep 17 00:00:00 2001 From: winckel Date: Mon, 18 Nov 2013 10:52:53 +0000 Subject: [PATCH] Added ui notification for IP address error when connecting to host. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4427 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- common/utils/itti_analyzer/libui/ui_callbacks.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/utils/itti_analyzer/libui/ui_callbacks.c b/common/utils/itti_analyzer/libui/ui_callbacks.c index 9131da9754..f4275f8d2c 100644 --- a/common/utils/itti_analyzer/libui/ui_callbacks.c +++ b/common/utils/itti_analyzer/libui/ui_callbacks.c @@ -382,15 +382,20 @@ gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data) uint16_t port; int pipe_fd[2]; - g_message("Connect event occurred"); - port = atoi (gtk_entry_get_text (GTK_ENTRY(ui_main_data.port_entry))); ip = gtk_entry_get_text (GTK_ENTRY(ui_main_data.ip_entry)); - if ((ip == NULL) || (port == 0)) + g_message("Connect event occurred to %s:%d", ip, port); + + if (strlen(ip) == 0) { - g_warning("NULL parameter given for ip address or port = 0"); - /* TODO: add dialog box here */ + ui_notification_dialog (GTK_MESSAGE_WARNING, "Connect", "Empty host ip address"); + return FALSE; + } + + if (port == 0) + { + ui_notification_dialog (GTK_MESSAGE_WARNING, "Connect", "Invalid host port value"); return FALSE; }