Fix Windows builds that cannot find gtk/gtk.h from epan/prefs.c. Write out
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 8 Nov 2007 02:29:18 +0000 (02:29 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 8 Nov 2007 02:29:18 +0000 (02:29 +0000)
toolbar arrow preference even in GTK < 2.4 and just don't use it unless
running GTK 2.4+.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23397 f5534014-38df-0310-8fa8-9805f1628bb7

epan/prefs.c

index a45bbae84a4995f41ff42a7ac956b2bc4e0ed17c..3350b83462a27a91eb1b43e05c04592e5b9a482f 100644 (file)
@@ -51,8 +51,6 @@
 #include <epan/prefs-int.h>
 #include <epan/uat-int.h>
 
-#include <gtk/gtk.h>
-
 /* Internal functions */
 static module_t *find_subtree(module_t *parent, const char *name);
 static module_t *prefs_register_module_or_subtree(module_t *parent,
@@ -1558,9 +1556,7 @@ prefs_set_pref(char *prefarg)
 #define PRS_GUI_GEOMETRY_MAIN_HEIGHT     "gui.geometry.main.height"
 #define PRS_GUI_TOOLBAR_MAIN_SHOW        "gui.toolbar_main_show"
 #define PRS_GUI_TOOLBAR_MAIN_STYLE       "gui.toolbar_main_style"
-#if GTK_CHECK_VERSION(2,4,0)
 #define PRS_GUI_TOOLBAR_ARROW            "gui.toolbar_arrow"
-#endif
 #define PRS_GUI_WEBBROWSER               "gui.webbrowser"
 #define PRS_GUI_WINDOW_TITLE             "gui.window_title"
 #define PRS_GUI_LAYOUT_TYPE              "gui.layout_type"
@@ -1816,7 +1812,6 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
        prefs.gui_toolbar_main_style =
            find_index_from_string_array(value, gui_toolbar_style_text,
                                     TB_STYLE_ICONS);
-#if GTK_CHECK_VERSION(2,4,0)
   } else if (strcmp(pref_name, PRS_GUI_TOOLBAR_ARROW) == 0) {
     if (strcasecmp(value, "true") == 0) {
            prefs.gui_toolbar_arrow = TRUE;
@@ -1824,7 +1819,6 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
     else {
            prefs.gui_toolbar_arrow = FALSE;
     }
-#endif
   } else if (strcmp(pref_name, PRS_GUI_FONT_NAME_1) == 0) {
     if (prefs.gui_font_name1 != NULL)
       g_free(prefs.gui_font_name1);
@@ -2505,12 +2499,10 @@ write_prefs(char **pf_path_return)
   fprintf(pf, PRS_GUI_TOOLBAR_MAIN_STYLE ": %s\n",
                  gui_toolbar_style_text[prefs.gui_toolbar_main_style]);
 
-#if GTK_CHECK_VERSION(2,4,0)
-  fprintf(pf, "\n# Show toolbar arrow? \n");
+  fprintf(pf, "\n# Show toolbar arrow (GTK2.4+ only)?\n");
   fprintf(pf, "# TRUE or FALSE (case-insensitive).\n");
   fprintf(pf, PRS_GUI_TOOLBAR_ARROW ": %s\n",
                  prefs.gui_toolbar_arrow == TRUE ? "TRUE" : "FALSE");
-#endif
 
   fprintf(pf, "\n# Save window position at exit?\n");
   fprintf(pf, "# TRUE or FALSE (case-insensitive).\n");