--- menus.c.orig	2012-01-27 18:09:16.677145401 +0100
+++ menus.c	2012-01-29 16:25:07.000000000 +0100
@@ -46,6 +46,7 @@
     const gchar * icon;
     guint key;
     GdkModifierType mod;
+    const gchar * identifier;
 
     /* for normal items */
     void (* func) (void);
@@ -128,30 +129,30 @@
 static void autoscroll_set (gboolean on) {aud_set_bool ("gtkui", "autoscroll", on); }
 
 static const struct MenuItem file_items[] = {
- {N_("_Open Files ..."), GTK_STOCK_OPEN, 'o', CTRL, .func = open_files},
- {N_("Open _URL ..."), GTK_STOCK_NETWORK, 'l', CTRL, .func = open_url},
- {N_("_Add Files ..."), GTK_STOCK_ADD, 'o', SHIFT | CTRL, .func = add_files},
- {N_("Add U_RL ..."), GTK_STOCK_NETWORK, 'l', SHIFT | CTRL, .func = add_url},
- {.sep = TRUE},
- {N_("A_bout ..."), GTK_STOCK_ABOUT, .func = audgui_show_about_window},
- {N_("_Preferences ..."), GTK_STOCK_PREFERENCES, .func = aud_show_prefs_window},
- {N_("_Quit"), GTK_STOCK_QUIT, 'q', CTRL, .func = aud_drct_quit}};
+ {N_("_Open Files ..."), GTK_STOCK_OPEN, 'o', CTRL, "open_files", .func = open_files},
+ {N_("Open _URL ..."), GTK_STOCK_NETWORK, 'l', CTRL, "open_url", .func = open_url},
+ {N_("_Add Files ..."), GTK_STOCK_ADD, 'o', SHIFT | CTRL, "add_files", .func = add_files},
+ {N_("Add U_RL ..."), GTK_STOCK_NETWORK, 'l', SHIFT | CTRL, "add_url", .func = add_url},
+ {.sep = TRUE},
+ {N_("A_bout ..."), GTK_STOCK_ABOUT, .identifier = "about", .func = audgui_show_about_window},
+ {N_("_Preferences ..."), GTK_STOCK_PREFERENCES, .identifier = "preferences", .func = aud_show_prefs_window},
+ {N_("_Quit"), GTK_STOCK_QUIT, 'q', CTRL, "quit", .func = aud_drct_quit}};
 
 static const struct MenuItem playback_items[] = {
- {N_("_Play"), GTK_STOCK_MEDIA_PLAY, GDK_Return, CTRL, .func = aud_drct_play},
- {N_("Paus_e"), GTK_STOCK_MEDIA_PAUSE, ',', CTRL, .func = aud_drct_pause},
- {N_("_Stop"), GTK_STOCK_MEDIA_STOP, '.', CTRL, .func = aud_drct_stop},
- {N_("Pre_vious"), GTK_STOCK_MEDIA_PREVIOUS, GDK_Up, ALT, .func = aud_drct_pl_prev},
- {N_("_Next"), GTK_STOCK_MEDIA_NEXT, GDK_Down, ALT, .func = aud_drct_pl_next},
- {.sep = TRUE},
- {N_("_Repeat"), NULL, 'r', CTRL, .get = repeat_get, repeat_set, "set repeat"},
- {N_("S_huffle"), NULL, 's', CTRL, .get = shuffle_get, shuffle_set, "set shuffle"},
- {N_("N_o Playlist Advance"), NULL, 'n', CTRL, .get = no_advance_get, no_advance_set, "set no_playlist_advance"},
- {N_("Stop _After This Song"), NULL, 'm', CTRL, .get = stop_after_get, stop_after_set, "set stop_after_current_song"},
- {.sep = TRUE},
- {N_("Song _Info ..."), GTK_STOCK_INFO, 'i', CTRL, .func = audgui_infowin_show_current},
- {N_("Jump to _Time ..."), GTK_STOCK_JUMP_TO, .func = audgui_jump_to_time},
- {N_("_Jump to Song ..."), GTK_STOCK_JUMP_TO, 'j', CTRL, .func = audgui_jump_to_track}};
+ {N_("_Play"), GTK_STOCK_MEDIA_PLAY, GDK_Return, CTRL, "play", .func = aud_drct_play},
+ {N_("Paus_e"), GTK_STOCK_MEDIA_PAUSE, ',', CTRL, "pause", .func = aud_drct_pause},
+ {N_("_Stop"), GTK_STOCK_MEDIA_STOP, '.', CTRL, "stop", .func = aud_drct_stop},
+ {N_("Pre_vious"), GTK_STOCK_MEDIA_PREVIOUS, GDK_Up, ALT, "previous", .func = aud_drct_pl_prev},
+ {N_("_Next"), GTK_STOCK_MEDIA_NEXT, GDK_Down, ALT, "next", .func = aud_drct_pl_next},
+ {.sep = TRUE},
+ {N_("_Repeat"), NULL, 'r', CTRL, "repeat", .get = repeat_get, repeat_set, "set repeat"},
+ {N_("S_huffle"), NULL, 's', CTRL, "shuffle", .get = shuffle_get, shuffle_set, "set shuffle"},
+ {N_("N_o Playlist Advance"), NULL, 'n', CTRL, "no_playlist_advance", .get = no_advance_get, no_advance_set, "set no_playlist_advance"},
+ {N_("Stop _After This Song"), NULL, 'm', CTRL, "stop_after_this_song", .get = stop_after_get, stop_after_set, "set stop_after_current_song"},
+ {.sep = TRUE},
+ {N_("Song _Info ..."), GTK_STOCK_INFO, 'i', CTRL, "song_info", .func = audgui_infowin_show_current},
+ {N_("Jump to _Time ..."), GTK_STOCK_JUMP_TO, .identifier = "jump_to_time", .func = audgui_jump_to_time},
+ {N_("_Jump to Song ..."), GTK_STOCK_JUMP_TO, 'j', CTRL, "jump_to_song", .func = audgui_jump_to_track}};
 
 static const struct MenuItem sort_items[] = {
  {N_("By Track _Number"), .func = pl_sort_track},
@@ -166,25 +167,25 @@
  {N_("_Random Order"), .func = pl_random}};
 
 static const struct MenuItem playlist_items[] = {
- {N_("_Refresh"), GTK_STOCK_REFRESH, GDK_F5, .func = pl_refresh},
- {N_("Remove _Unavailable Files"), GTK_STOCK_REMOVE, .func = pl_remove_failed},
+ {N_("_Refresh"), GTK_STOCK_REFRESH, GDK_F5, .identifier = "playlist_refresh", .func = pl_refresh},
+ {N_("Remove _Unavailable Files"), GTK_STOCK_REMOVE, .identifier = "playlist_remove", .func = pl_remove_failed},
  {.sep = TRUE},
  {N_("_Sort"), GTK_STOCK_SORT_ASCENDING, .items = sort_items, G_N_ELEMENTS (sort_items)},
  {.sep = TRUE},
- {N_("_New"), GTK_STOCK_NEW, 't', CTRL, .func = pl_new},
- {N_("_Close"), GTK_STOCK_CLOSE, 'w', CTRL, .func = pl_close},
+ {N_("_New"), GTK_STOCK_NEW, 't', CTRL, "playlist_new", .func = pl_new},
+ {N_("_Close"), GTK_STOCK_CLOSE, 'w', CTRL, "playlist_close", .func = pl_close},
  {.sep = TRUE},
- {N_("_Import ..."), GTK_STOCK_OPEN, .func = audgui_import_playlist},
- {N_("_Export ..."), GTK_STOCK_SAVE, .func = audgui_export_playlist},
+ {N_("_Import ..."), GTK_STOCK_OPEN, .identifier = "playlist_import", .func = audgui_import_playlist},
+ {N_("_Export ..."), GTK_STOCK_SAVE, .identifier = "playlist_export", .func = audgui_export_playlist},
  {.sep = TRUE},
- {N_("_Playlist Manager ..."), AUD_STOCK_PLAYLIST, 'p', CTRL, .func = audgui_playlist_manager},
- {N_("_Queue Manager ..."), AUD_STOCK_QUEUETOGGLE, 'u', CTRL, .func = audgui_queue_manager_show}};
+ {N_("_Playlist Manager ..."), AUD_STOCK_PLAYLIST, 'p', CTRL, "playlist_manager", .func = audgui_playlist_manager},
+ {N_("_Queue Manager ..."), AUD_STOCK_QUEUETOGGLE, 'u', CTRL, "queue_manager", .func = audgui_queue_manager_show}};
 
 static const struct MenuItem output_items[] = {
- {N_("Volume _Up"), GTK_STOCK_GO_UP, '+', CTRL, .func = volume_up},
- {N_("Volume _Down"), GTK_STOCK_GO_DOWN, '-', CTRL, .func = volume_down},
+ {N_("Volume _Up"), GTK_STOCK_GO_UP, '+', CTRL, "volume_up", .func = volume_up},
+ {N_("Volume _Down"), GTK_STOCK_GO_DOWN, '-', CTRL, "volume_down", .func = volume_down},
  {.sep = TRUE},
- {N_("_Equalizer"), GTK_STOCK_PREFERENCES, 'e', CTRL, .func = audgui_show_equalizer_window},
+ {N_("_Equalizer"), GTK_STOCK_PREFERENCES, 'e', CTRL, "equalizer", .func = audgui_show_equalizer_window},
  {.sep = TRUE},
  {N_("E_ffects"), .get_sub = audgui_create_effects_menu}};
 
@@ -192,13 +193,13 @@
  {N_("_Interface"), .get_sub = audgui_create_iface_menu},
  {N_("_Visualizations"), .get_sub = audgui_create_vis_menu},
  {.sep = TRUE},
- {N_("Show _Menu Bar"), NULL, 'm', SHIFT | CTRL, .get = menu_bar_get, show_menu},
- {N_("Show I_nfo Bar"), NULL, 'i', SHIFT | CTRL, .get = info_bar_get, show_infoarea},
- {N_("Show _Status Bar"), NULL, 's', SHIFT | CTRL, .get = status_bar_get, show_statusbar},
- {.sep = TRUE},
- {N_("Show Column _Headers"), .get = column_headers_get, playlist_show_headers},
- {N_("Choose _Columns ..."), .func = pw_col_choose},
- {N_("Scrol_l on Song Change"), .get = autoscroll_get, autoscroll_set}};
+ {N_("Show _Menu Bar"), NULL, 'm', SHIFT | CTRL, "show_menu_bar", .get = menu_bar_get, show_menu},
+ {N_("Show I_nfo Bar"), NULL, 'i', SHIFT | CTRL, "show_info_bar", .get = info_bar_get, show_infoarea},
+ {N_("Show _Status Bar"), NULL, 's', SHIFT | CTRL, "show_status_bar", .get = status_bar_get, show_statusbar},
+ {.sep = TRUE},
+ {N_("Show Column _Headers"), .identifier = "show_column_headers", .get = column_headers_get, playlist_show_headers},
+ {N_("Choose _Columns ..."), .identifier = "choose_columns", .func = pw_col_choose},
+ {N_("Scrol_l on Song Change"),  .identifier = "scroll_on_song_change", .get = autoscroll_get, autoscroll_set}};
 
 static const struct MenuItem main_items[] = {
  {N_("_File"), .items = file_items, G_N_ELEMENTS (file_items)},
@@ -209,20 +210,20 @@
  {N_("_View"), .items = view_items, G_N_ELEMENTS (view_items)}};
 
 static const struct MenuItem rclick_items[] = {
- {N_("Song _Info ..."), GTK_STOCK_INFO, 'i', ALT, .func = playlist_song_info},
- {N_("_Queue/Unqueue"), AUD_STOCK_QUEUETOGGLE, 'q', ALT, .func = playlist_queue_toggle},
- {N_("_Refresh"), GTK_STOCK_REFRESH, GDK_F6, .func = pl_refresh_sel},
- {.sep = TRUE},
- {N_("Cu_t"), GTK_STOCK_CUT, .func = playlist_cut},
- {N_("_Copy"), GTK_STOCK_COPY, .func = playlist_copy},
- {N_("_Paste"), GTK_STOCK_PASTE, .func = playlist_paste},
- {N_("Select _All"), GTK_STOCK_SELECT_ALL, .func = pl_select_all},
+ {N_("Song _Info ..."), GTK_STOCK_INFO, 'i', ALT, "list_song_info", .func = playlist_song_info},
+ {N_("_Queue/Unqueue"), AUD_STOCK_QUEUETOGGLE, 'q', ALT, "list_queue", .func = playlist_queue_toggle},
+ {N_("_Refresh"), GTK_STOCK_REFRESH, GDK_F6, .identifier = "list_refresh", .func = pl_refresh_sel},
+ {.sep = TRUE},
+ {N_("Cu_t"), GTK_STOCK_CUT, .identifier = "list_cut", .func = playlist_cut},
+ {N_("_Copy"), GTK_STOCK_COPY, .identifier = "list_copy", .func = playlist_copy},
+ {N_("_Paste"), GTK_STOCK_PASTE, .identifier = "list_paste", .func = playlist_paste},
+ {N_("Select _All"), GTK_STOCK_SELECT_ALL, .identifier = "list_select_all", .func = pl_select_all},
  {.sep = TRUE},
  {N_("_Services"), .get_sub = get_services_pl}};
 
 static const struct MenuItem tab_items[] = {
- {N_("_Rename"), GTK_STOCK_EDIT, GDK_F2, .func = pl_rename},
- {N_("_Close"), GTK_STOCK_CLOSE, .func = pl_close}};
+ {N_("_Rename"), GTK_STOCK_EDIT, GDK_F2, .identifier = "tab_rename", .func = pl_rename},
+ {N_("_Close"), GTK_STOCK_CLOSE, .identifier = "tab_close", .func = pl_close}};
 
 static void toggled_cb (GtkCheckMenuItem * check, const struct MenuItem * item)
 {
@@ -302,9 +303,25 @@
         if (! widget)
             continue;
 
+		guint fkey = item->key;
+		GdkModifierType fmod = item->mod;
+		if (item->identifier) 
+		{
+			gchar *nkey; 
+			nkey = aud_get_string("gtkui",g_strconcat("key_",item->identifier,NULL));
+			if (nkey[0] != 0)
+				fkey = (guint) (nkey[0]);
+			g_free (nkey);
+			
+			gint nmod;
+			nmod = aud_get_int("gtkui",g_strconcat("mod_",item->identifier,NULL));
+			if (nmod != 0)
+				fmod = (GdkModifierType) nmod;
+		}
+
         if (item->key)
-            gtk_widget_add_accelerator (widget, "activate", accel, item->key,
-             item->mod, GTK_ACCEL_VISIBLE);
+            gtk_widget_add_accelerator (widget, "activate", accel, fkey,
+             fmod, GTK_ACCEL_VISIBLE);
 
         gtk_widget_show (widget);
         gtk_menu_shell_append ((GtkMenuShell *) shell, widget);
