merge_all_tap_menus() has been moved to menus.c.
[obnox/wireshark/wip.git] / gtk / about_dlg.c
index 369d37c401aa955693aeedf0ef4440be0feb30df..a41fa8c4053344714aedb6937855aa304ecb2b05 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
- * Copyright 2000 Gerald Combs
+ * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -29,7 +29,6 @@
 
 #include <gtk/gtk.h>
 
-#include <stdio.h>
 #include <string.h>
 
 #include <epan/filesystem.h>
@@ -41,7 +40,6 @@
 #include <epan/geoip_db.h>
 #endif
 
-#include "../globals.h"
 #include "../log.h"
 #include "../version_info.h"
 
@@ -60,7 +58,7 @@
 /*
  * Update frequence for the splash screen, given in milliseconds.
  */
-int splash_register_freq = 100;
+int info_update_freq = 100;
 
 static void about_wireshark_destroy_cb(GtkWidget *, gpointer);
 
@@ -75,13 +73,15 @@ static GtkWidget *about_wireshark_w;
 
 
 static void
-about_wireshark(GtkWidget *parent, GtkWidget *main_vb)
+about_wireshark(GtkWidget *parent _U_, GtkWidget *main_vb)
 {
   GtkWidget   *msg_label, *icon;
   gchar       *message;
   const char  *title = "Network Protocol Analyzer";
 
-  icon = xpm_to_widget_from_parent(parent, wssplash_xpm);
+  /*icon = xpm_to_widget_from_parent(parent, wssplash_xpm);*/
+  icon = xpm_to_widget(wssplash_xpm);
+
   gtk_container_add(GTK_CONTAINER(main_vb), icon);
 
   msg_label = gtk_label_new(title);
@@ -189,7 +189,7 @@ splash_update(register_action_e action, const char *message, gpointer client_dat
       return;
     }
     memcpy(&next_tv, &cur_tv, sizeof(next_tv));
-    next_tv.tv_usec += splash_register_freq * 1000;
+    next_tv.tv_usec += info_update_freq * 1000;
     if (next_tv.tv_usec >= 1000000) {
         next_tv.tv_sec++;
         next_tv.tv_usec -= 1000000;
@@ -268,16 +268,16 @@ splash_update(register_action_e action, const char *message, gpointer client_dat
 
 }
 
-guint
+gboolean
 splash_destroy(GtkWidget *win)
 {
-    if (win == NULL) return FALSE;
+    if (win == NULL)
+        return FALSE;
 
     gtk_widget_destroy(win);
     return FALSE;
 }
 
-
 static GtkWidget *
 about_wireshark_page_new(void)
 {
@@ -287,10 +287,8 @@ about_wireshark_page_new(void)
   main_vb = gtk_vbox_new(FALSE, 6);
   gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
 
-#if GTK_CHECK_VERSION(2,9,0)
   g_object_set(gtk_widget_get_settings(main_vb),
     "gtk-label-select-on-focus", FALSE, NULL);
-#endif
 
   about_wireshark(top_level, main_vb);
 
@@ -331,7 +329,7 @@ about_authors_page_new(void)
   return page;
 }
 
-static gint about_folders_callback(GtkWidget *widget, GdkEventButton *event, gint id _U_)
+static gboolean about_folders_callback(GtkWidget *widget, GdkEventButton *event, gint id _U_)
 {
   GtkTreeSelection *tree_selection;
   GtkTreeModel *model;
@@ -362,7 +360,6 @@ about_folders_row(GtkWidget *table, const char *label, const char *dir, const ch
   simple_list_append(table, 0, label, 1, dir, 2, tip, -1);
 }
 
-
 static GtkWidget *
 about_folders_page_new(void)
 {
@@ -397,13 +394,13 @@ about_folders_page_new(void)
   path = get_tempfile_path("");
   about_folders_row(table, "Temp", path,
       "untitled capture files");
-  g_free((void *) path);
+  g_free(path);
 
   /* pers conf */
   path = get_persconffile_path("", FALSE, FALSE);
   about_folders_row(table, "Personal configuration", path,
       "\"dfilters\", \"preferences\", \"ethers\", ...");
-  g_free((void *) path);
+  g_free(path);
 
   /* global conf */
   constpath = get_datafile_dir();
@@ -422,12 +419,12 @@ about_folders_page_new(void)
   about_folders_row(table, "Program", constpath,
       "program files");
 
-#ifdef HAVE_PLUGINS
+#if defined(HAVE_PLUGINS) || defined(HAVE_LUA_5_1)
   /* pers plugins */
   path = get_plugins_pers_dir();
   about_folders_row(table, "Personal Plugins", path,
       "dissector plugins");
-  g_free((void *) path);
+  g_free(path);
 
   /* global plugins */
   about_folders_row(table, "Global Plugins", get_plugin_dir(),
@@ -444,34 +441,26 @@ about_folders_page_new(void)
   /* GeoIP */
   path = geoip_db_get_paths();
 
-#ifdef _WIN32
-  resultArray = g_strsplit(path, ";", 10);
-#else
-  resultArray = g_strsplit(path, ":", 10);
-#endif
+  resultArray = g_strsplit(path, G_SEARCHPATH_SEPARATOR_S, 10);
 
   for(i = 0; resultArray[i]; i++)
     about_folders_row(table, "GeoIP path", g_strstrip(resultArray[i]),
                      "GeoIP database search path");
   g_strfreev(resultArray);
-  g_free((void *) path);
+  g_free(path);
 #endif
 
 #ifdef HAVE_LIBSMI
   /* SMI MIBs/PIBs */
   path = oid_get_default_mib_path();
 
-#ifdef _WIN32
-  resultArray = g_strsplit(path, ";", 10);
-#else
-  resultArray = g_strsplit(path, ":", 10);
-#endif
+  resultArray = g_strsplit(path, G_SEARCHPATH_SEPARATOR_S, 10);
 
   for(i = 0; resultArray[i]; i++)
     about_folders_row(table, "MIB/PIB path", g_strstrip(resultArray[i]),
                      "SMI MIB/PIB search path");
   g_strfreev(resultArray);
-  g_free((void *) path);
+  g_free(path);
 #endif
 
   gtk_container_add(GTK_CONTAINER(scrolledwindow), table);
@@ -485,7 +474,11 @@ about_license_page_new(void)
   GtkWidget   *page;
   char *absolute_path;
 
+#if defined(_WIN32)
+  absolute_path = get_datafile_path("COPYING.txt");
+#else
   absolute_path = get_datafile_path("COPYING");
+#endif
   page = text_page_new(absolute_path);
 
   return page;
@@ -497,7 +490,7 @@ about_wireshark_cb( GtkWidget *w _U_, gpointer data _U_ )
   GtkWidget   *main_vb, *main_nb, *bbox, *ok_btn;
   GtkWidget   *page_lb, *about_page, *folders_page;
 
-#ifdef HAVE_PLUGINS
+#if defined(HAVE_PLUGINS) || defined(HAVE_LUA_5_1)
   GtkWidget   *plugins_page;
 #endif
 
@@ -541,7 +534,7 @@ about_wireshark_cb( GtkWidget *w _U_, gpointer data _U_ )
   page_lb = gtk_label_new("Folders");
   gtk_notebook_append_page(GTK_NOTEBOOK(main_nb), folders_page, page_lb);
 
-#ifdef HAVE_PLUGINS
+#if defined(HAVE_PLUGINS) || defined(HAVE_LUA_5_1)
   plugins_page = about_plugins_page_new();
   page_lb = gtk_label_new("Plugins");
   gtk_notebook_append_page(GTK_NOTEBOOK(main_nb), plugins_page, page_lb);
@@ -575,5 +568,3 @@ about_wireshark_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
   /* Note that we no longer have an "About Wireshark" dialog box. */
   about_wireshark_w = NULL;
 }
-
-