Allow "capture info data" to not be a singleton.
[metze/wireshark/wip.git] / ui / gtk / main.c
index 59cbea2a3451dac515f4236d230adc4a8b0d8a19..245bc1e12c14a919ed1856de97de0416fa3a7fe3 100644 (file)
 #ifdef HAVE_LIBPCAP
 capture_options global_capture_opts;
 capture_session global_capture_session;
+info_data_t global_info_data;
 #endif
 
 capture_file cfile;
@@ -646,7 +647,7 @@ copy_selected_plist_cb(GtkWidget *w _U_, gpointer data _U_, COPY_SELECTED_E acti
     {
     case COPY_SELECTED_DESCRIPTION:
         if (cfile.finfo_selected->rep &&
-            strlen (cfile.finfo_selected->rep->representation) > 0) {
+            strlen(cfile.finfo_selected->rep->representation) > 0) {
             g_string_append(gtk_text_str, cfile.finfo_selected->rep->representation);
         }
         break;
@@ -2231,17 +2232,15 @@ main(int argc, char *argv[])
     GSList              *disable_heur_slist = NULL;
 
 #define OPTSTRING OPTSTRING_CAPTURE_COMMON "C:g:Hh" "jJ:kK:lm:nN:o:P:r:R:St:u:vw:X:Y:z:"
-DIAG_OFF(cast-qual)
     static const struct option long_options[] = {
-        {(char *)"help", no_argument, NULL, 'h'},
-        {(char *)"read-file", required_argument, NULL, 'r' },
-        {(char *)"read-filter", required_argument, NULL, 'R' },
-        {(char *)"display-filter", required_argument, NULL, 'Y' },
-        {(char *)"version", no_argument, NULL, 'v'},
+        {"help", no_argument, NULL, 'h'},
+        {"read-file", required_argument, NULL, 'r' },
+        {"read-filter", required_argument, NULL, 'R' },
+        {"display-filter", required_argument, NULL, 'Y' },
+        {"version", no_argument, NULL, 'v'},
         LONGOPT_CAPTURE_COMMON
         {0, 0, 0, 0 }
     };
-DIAG_ON(cast-qual)
     static const char optstring[] = OPTSTRING;
 
 #ifdef HAVE_GRESOURCE
@@ -2268,7 +2267,7 @@ DIAG_ON(cast-qual)
     /*
      * Attempt to get the pathname of the executable file.
      */
-    init_progfile_dir_error = init_progfile_dir(argv[0], (void *)main);
+    init_progfile_dir_error = init_progfile_dir(argv[0], main);
 
     /* initialize the funnel mini-api */
     initialize_funnel_ops();
@@ -2553,7 +2552,7 @@ DIAG_ON(cast-qual)
     /* Register all the plugin types we have. */
     epan_register_plugin_types(); /* Types known to libwireshark */
     wtap_register_plugin_types(); /* Types known to libwiretap */
-    codec_register_plugin_types(); /* Types known to libcodec */
+    codec_register_plugin_types(); /* Types known to libwscodecs */
 
     /* Scan for plugins.  This does *not* call their registration routines;
        that's done later. */
@@ -3154,9 +3153,10 @@ DIAG_ON(cast-qual)
     switch (user_font_apply()) {
         case FA_SUCCESS:
             break;
-        case FA_FONT_NOT_RESIZEABLE:
-            /* "user_font_apply()" popped up an alert box. */
-            /* turn off zooming - font can't be resized */
+        case FA_ZOOMED_TOO_FAR:
+            /* The zoom level is too big for this font; turn off zooming. */
+            recent.gui_zoom_level = 0;
+            break;
         case FA_FONT_NOT_AVAILABLE:
             /* XXX - did we successfully load the un-zoomed version earlier?
              If so, this *probably* means the font is available, but not at
@@ -3168,6 +3168,7 @@ DIAG_ON(cast-qual)
             /* in any other case than FA_SUCCESS, turn off zooming */
             recent.gui_zoom_level = 0;
             /* XXX: would it be a good idea to disable zooming (insensitive GUI)? */
+            break;
     }
 
     dnd_init(top_level);
@@ -3297,7 +3298,7 @@ DIAG_ON(cast-qual)
                to use for this capture. */
             if (global_capture_opts.ifaces->len == 0)
                 collect_ifaces(&global_capture_opts);
-            if (capture_start(&global_capture_opts, &global_capture_session,main_window_update)) {
+            if (capture_start(&global_capture_opts, &global_capture_session, &global_info_data,main_window_update)) {
                 /* The capture started.  Open stat windows; we do so after creating
                    the main window, to avoid GTK warnings, and after successfully
                    opening the capture file, so we know we have something to compute