Commit b025af70 authored by winckel's avatar winckel

Updated itti name in configuration file.

Change window title to give information on origin of displayed messages list.
Created an about dialog box.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4351 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent cefa1465
......@@ -4,7 +4,7 @@ define([svnversion], esyscmd([sh -c "svnversion ..|tr -d '\n'"]))
AC_DEFINE(SVN_REVISION, "svnversion", [SVN Revision])
AC_INIT([itti_debugger], [0.2.svnversion], [openair_admin@eurecom.fr])
AC_INIT([itti_analyzer], [0.2.svnversion], [openair_admin@eurecom.fr])
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.11 silent-rules])
......
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdint.h>
......@@ -52,6 +56,11 @@ gboolean ui_callback_on_save_filters(GtkWidget *widget, GdkEvent *event, gpointe
gboolean ui_callback_on_about(GtkWidget *widget, GdkEvent *event, gpointer data)
{
#if defined(PACKAGE_STRING)
ui_notification_dialog (GTK_MESSAGE_INFO, "about", "%s", PACKAGE_STRING);
#else
ui_notification_dialog (GTK_MESSAGE_INFO, "about", "itti_analyzer");
#endif
return TRUE;
}
......@@ -261,6 +270,7 @@ gboolean ui_callback_on_connect(GtkWidget *widget, GdkEvent *event, gpointer dat
ui_enable_connect_button ();
return FALSE;
}
ui_set_title ("%s:%d", ip, port);
return TRUE;
}
......@@ -303,6 +313,7 @@ gboolean ui_callback_signal_clear_list(GtkWidget *widget, GdkEvent *event, gpoin
{
/* Disable buttons to move in the list of signals */
ui_set_sensitive_move_buttons (FALSE);
ui_set_title ("");
/* Clear list of signals */
ui_tree_view_destroy_list (ui_main_data.signalslist);
......
......@@ -98,6 +98,27 @@ static int ui_idle_callback(gpointer data)
return FALSE;
}
void ui_set_title(const char *fmt, ...)
{
va_list args;
char *name;
char buffer[200];
char title[220];
#if defined(PACKAGE_STRING)
name = PACKAGE_NAME;
#else
name = "itti_analyzer";
#endif
va_start(args, fmt);
vsnprintf (buffer, sizeof(buffer), fmt, args);
snprintf (title, sizeof(title), "%s %s", name, buffer);
gtk_window_set_title (GTK_WINDOW(ui_main_data.window), title);
}
int ui_gtk_initialize(int argc, char *argv[])
{
GtkWidget *vbox;
......@@ -116,11 +137,7 @@ int ui_gtk_initialize(int argc, char *argv[])
gtk_window_set_position (GTK_WINDOW(ui_main_data.window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size (GTK_WINDOW(ui_main_data.window), 1024, 800);
#if defined(PACKAGE_STRING)
gtk_window_set_title(GTK_WINDOW(ui_main_data.window), PACKAGE_STRING);
#else
gtk_window_set_title (GTK_WINDOW(ui_main_data.window), "itti debugger");
#endif
ui_set_title("");
gtk_window_set_resizable (GTK_WINDOW(ui_main_data.window), TRUE);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
......
......@@ -47,6 +47,8 @@ typedef struct {
extern ui_main_data_t ui_main_data;
void ui_set_title(const char *fmt, ...);
int ui_gtk_initialize(int argc, char *argv[]);
void ui_gtk_flush_events(void);
......
......@@ -33,6 +33,7 @@ int ui_enable_connect_button(void)
/* Disable Disconnect button and enable connect button */
gtk_widget_set_sensitive (GTK_WIDGET (ui_main_data.connect), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (ui_main_data.disconnect), FALSE);
ui_set_title ("");
return RC_OK;
}
......@@ -169,8 +170,13 @@ int ui_messages_read(char *filename)
if (read_messages > 0)
{
char *basename;
/* Enable buttons to move in the list of signals */
ui_set_sensitive_move_buttons (TRUE);
basename = g_path_get_basename(filename);
ui_set_title ("\"%s\"", basename);
}
g_message("Read %d messages (%d to display) from file \"%s\"\n", read_messages, ui_tree_view_get_filtered_number(), filename);
......
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