"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main.c" between
etherape-0.9.17.tar.gz and etherape-0.9.18.tar.gz

About: EtherApe is a GNOME/pcap-based graphical network monitor (etherman clone).

main.c  (etherape-0.9.17):main.c  (etherape-0.9.18)
skipping to change at line 32 skipping to change at line 32
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <ctype.h> #include <ctype.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <signal.h> #include <signal.h>
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <popt.h> #include <popt.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include "appdata.h" #include "appdata.h"
#include "names/ip-cache.h" #include "names/ip-cache.h"
#include "main.h" #include "main.h"
#include "diagram.h" #include "diagram.h"
#include "preferences.h" #include "preferences.h"
#include "info_windows.h" #include "info_windows.h"
#include "menus.h" #include "menus.h"
#include "capture/capctl.h" #include "capture/capctl.h"
#include "datastructs.h" #include "datastructs.h"
#include "names/dns.h" #include "names/dns.h"
skipping to change at line 257 skipping to change at line 256
appdata.max_delay = madelay; appdata.max_delay = madelay;
if (appdata.max_delay != G_MAXLONG) if (appdata.max_delay != G_MAXLONG)
g_message("Maximum delay set to %lu ms", appdata.max_delay); g_message("Maximum delay set to %lu ms", appdata.max_delay);
} }
else else
g_message("Invalid maximum delay %ld, ignored", madelay); g_message("Invalid maximum delay %ld, ignored", madelay);
if (position_file_path) if (position_file_path)
appdata.column_patterns = parse_position_file(position_file_path); appdata.column_patterns = parse_position_file(position_file_path);
/* Glade */ /* GtkBuilder */
glade_init (); if (!appdata_init_builder(cl_glade_file))
if (!appdata_init_glade(cl_glade_file))
return 1; return 1;
/* prepare decoders */ /* prepare decoders */
services_init(); services_init();
/* Sets controls to the values of variables and connects signals */ /* Sets controls to the values of variables and connects signals */
init_diagram (appdata.xml); init_diagram(appdata.xml);
if (!pref.show_statusbar) if (!pref.show_statusbar)
{ {
widget = GTK_WIDGET(appdata.statusbar); widget = GTK_WIDGET(appdata.statusbar);
gtk_widget_hide(widget); gtk_widget_hide(widget);
widget = glade_xml_get_widget(appdata.xml, "status_bar_check"); widget = GTK_WIDGET(gtk_builder_get_object(appdata.xml, "status_bar_check" ));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE);
} }
if (!pref.show_toolbar) if (!pref.show_toolbar)
{ {
widget = glade_xml_get_widget(appdata.xml, "handlebox_toolbar"); widget = GTK_WIDGET(gtk_builder_get_object(appdata.xml, "handlebox_toolbar "));
gtk_widget_hide(widget); gtk_widget_hide(widget);
widget = glade_xml_get_widget(appdata.xml, "toolbar_check"); widget = GTK_WIDGET(gtk_builder_get_object(appdata.xml, "toolbar_check"));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE);
} }
if (!pref.show_legend) if (!pref.show_legend)
{ {
widget = glade_xml_get_widget(appdata.xml, "handlebox_legend"); widget = GTK_WIDGET(gtk_builder_get_object(appdata.xml, "handlebox_legend" ));
gtk_widget_hide(widget); gtk_widget_hide(widget);
widget = glade_xml_get_widget(appdata.xml, "legend_check"); widget = GTK_WIDGET(gtk_builder_get_object(appdata.xml, "legend_check"));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), FALSE);
} }
gtk_widget_show (appdata.app1); gtk_widget_show (appdata.app1);
install_handlers(); install_handlers();
/* With this we force an update of the diagram every x ms /* With this we force an update of the diagram every x ms
* Data in the diagram is updated, and then the canvas redraws itself when * Data in the diagram is updated, and then the canvas redraws itself when
* the gtk loop is idle. If the CPU can't handle the set refresh_period, * the gtk loop is idle. If the CPU can't handle the set refresh_period,
* then it will just do a best effort */ * then it will just do a best effort */
diagram_timeout_changed();
widget = canvas_widget();
destroying_idle(widget);
/* This other timeout makes sure that the info windows are updated */ /* This other timeout makes sure that the info windows are updated */
g_timeout_add(500, update_info_windows, NULL); g_timeout_add(500, update_info_windows, NULL);
if (pref.name_res && dns_open()) if (pref.name_res && dns_open())
g_warning(_("DNS resolver initialization failed")); g_warning(_("DNS resolver initialization failed"));
init_names(); init_names();
init_eth_resolv(); init_eth_resolv();
init_menus (); init_menus ();
skipping to change at line 506 skipping to change at line 501
signal(SIGUSR1, SIG_IGN); signal(SIGUSR1, SIG_IGN);
} }
/* /*
* Quit the program. * Quit the program.
* Makes sure that the capture device is closed, or else we might * Makes sure that the capture device is closed, or else we might
* be leaving it in promiscuous mode * be leaving it in promiscuous mode
*/ */
void cleanup(int signum) void cleanup(int signum)
{ {
cleanup_capture (); cleanup_capture();
free_static_data(); free_static_data();
gtk_exit (0); exit(0);
} }
/* activates a flag requesting an xml dump */ /* activates a flag requesting an xml dump */
static void signal_export(int signum) static void signal_export(int signum)
{ {
appdata.request_dump = TRUE; appdata.request_dump = TRUE;
} }
 End of changes. 11 change blocks. 
16 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)