Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Warnings with MAIN_MENU_USE_UIMANAGER

From: Anders Broman <a.broman@xxxxxxxxx>
Date: Wed, 13 Oct 2010 21:01:35 +0200
 Joerg Mayer skrev 2010-10-13 20:36:
Hello,

I am curious as to what all these UIMANAGER patches do - it looks
like I missed what's going on here. So I decided to enable it and
compilation didn't work any more due to -Werror and hitting some
warnings. The attached patch makes things compile for me again.
They may or may not be correct, that's why I paste them here.

Ciao
      Joerg
The patch is good I will apply it shortly - thanks.

As to what's going on; GtkItemFactory is deprecated and is recommended to be replaced by UIManager
so I set out to do that :O
Unfortunately I underestimated the difficulty and/or the time it would take to complete it and checked stuff
in a bit to early...
But now the recent files handling is on the right track and the remaining difficultly is the Statistics/Tap part. I'm not sure if the callers should be changed to use UIManager or if it's possible to contain the changes in menus.c
at least as a first step. Any help appreciated.
Regards
Anders
Index: gtk/menus.c
===================================================================
--- gtk/menus.c	(revision 34500)
+++ gtk/menus.c	(working copy)
@@ -478,13 +478,13 @@

  #ifdef MAIN_MENU_USE_UIMANAGER
  static void
-goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data)
+goto_next_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
  {
      goto_conversation_frame(FALSE);
  }

  static void
-goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data)
+goto_previous_frame_conversation_cb(GtkAction *action _U_, gpointer user_data _U_)
  {
      goto_conversation_frame(TRUE);
  }
@@ -4282,6 +4282,7 @@



+#ifndef MAIN_MENU_USE_UIMANAGER
  /* remove the capture filename from the "Recent Files" menu */
  static void
  remove_menu_recent_capture_filename(gchar *cf_name) {
@@ -4325,7 +4326,7 @@

      update_menu_recent_capture_file(submenu_recent_files);
  }
-
+#endif

  /* remove the capture filename from the "Recent Files" menu */
  static void
@@ -4389,7 +4390,7 @@
  }

  static void
-recent_clear_cb(GtkAction *action, gpointer   user_data)
+recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
  {
  	GtkWidget *submenu_recent_files;
  	GList *recent_files_list;
@@ -4408,7 +4409,7 @@
  }

  static void
-recent_activate_cb (GtkAction *action, gpointer   user_data)
+recent_activate_cb (GtkAction *action _U_, gpointer user_data _U_)
  {
  #if 0
    recent_item_activated_cb (NULL,
Index: gtk/menus.h
===================================================================
--- gtk/menus.h	(revision 34500)
+++ gtk/menus.h	(working copy)
@@ -29,7 +29,7 @@
  extern "C" {
  #endif /* __cplusplus */

-/*#define MAIN_MENU_USE_UIMANAGER 1 */
+#define MAIN_MENU_USE_UIMANAGER 1

  	/* Add a new recent capture filename to the "Recent Files" submenu
     (duplicates will be ignored) */