changeset 791:96ce71cd7bf5

2006-7-29 Brian Masney <masneyb@gftp.org> * src/gtk/bookmarks.c (edit_bookmarks) - fixed the keybindings in the bookmarks dialog. Also added mnemonics to all of the entries. (closes #329820) * src/gtk/gftp-gtk.c (CreateMenus) - added keybindings to most of the entries in the local and remote menus. Also added mnemonics to all of the entries.
author masneyb
date Sat, 29 Jul 2006 13:51:15 +0000
parents b0e277040f82
children 37bc51131e2d
files ChangeLog src/gtk/bookmarks.c src/gtk/gftp-gtk.c
diffstat 3 files changed, 67 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 28 18:46:18 2006 +0000
+++ b/ChangeLog	Sat Jul 29 13:51:15 2006 +0000
@@ -1,6 +1,15 @@
+2006-7-29 Brian Masney <masneyb@gftp.org>
+	* src/gtk/bookmarks.c (edit_bookmarks) - fixed the keybindings in the
+	bookmarks dialog. Also added mnemonics to all of the entries.
+	(closes #329820)
+
+	* src/gtk/gftp-gtk.c (CreateMenus) - added keybindings to most of the
+	entries in the local and remote menus. Also added mnemonics to all of
+	the entries.
+	
 2006-7-28 Brian Masney <masneyb@gftp.org>
 	* src/gtk/gftp-gtk.h src/gtk/gftp-gtk.c - remember the last protocol
-	that was used in the toolbar
+	that was used in the toolbar (closes #314330)
 
 	* src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/misc-gtk.c - warning
 	fixes when creating the system menus. Removed some unused global
@@ -3504,7 +3513,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.459 2006/07/28 11:51:09 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.460 2006/07/29 13:51:12 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/bookmarks.c	Fri Jul 28 18:46:18 2006 +0000
+++ b/src/gtk/bookmarks.c	Sat Jul 29 13:51:15 2006 +0000
@@ -1212,17 +1212,18 @@
 void
 edit_bookmarks (gpointer data)
 {
+  GtkAccelGroup * accel_group;
   GtkItemFactory * ifactory;
   GtkWidget * scroll;
   GtkItemFactoryEntry menu_items[] = {
     {N_("/_File"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/File/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
-    {N_("/File/New Folder..."), NULL, new_folder_entry, 0, MN_(NULL)},
-    {N_("/File/New Item..."), NULL, new_item_entry, 0, MS_(GTK_STOCK_NEW)},
-    {N_("/File/Delete"), NULL, delete_entry, 0, MS_(GTK_STOCK_DELETE)},
-    {N_("/File/Properties..."), NULL, edit_entry, 0, MS_(GTK_STOCK_PROPERTIES)},
+    {N_("/File/New _Folder..."), NULL, new_folder_entry, 0, MN_(NULL)},
+    {N_("/File/New _Item..."), NULL, new_item_entry, 0, MS_(GTK_STOCK_NEW)},
+    {N_("/File/_Delete"), NULL, delete_entry, 0, MS_(GTK_STOCK_DELETE)},
+    {N_("/File/_Properties..."), NULL, edit_entry, 0, MS_(GTK_STOCK_PROPERTIES)},
     {N_("/File/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/File/Close"), NULL, gtk_widget_destroy, 0, MS_(GTK_STOCK_CLOSE)}
+    {N_("/File/_Close"), NULL, gtk_widget_destroy, 0, MS_(GTK_STOCK_CLOSE)}
   };
 #if GTK_MAJOR_VERSION == 1
   GtkWidget * tempwid;
@@ -1263,7 +1264,9 @@
       gdk_window_set_icon_name (edit_bookmarks_dialog->window, gftp_version);
     }
 
-  ifactory = item_factory_new (GTK_TYPE_MENU_BAR, "<bookmarks>", NULL, NULL);
+  accel_group = gtk_accel_group_new ();
+  ifactory = item_factory_new (GTK_TYPE_MENU_BAR, "<bookmarks>", accel_group,
+                               NULL);
   create_item_factory (ifactory, 7, menu_items, NULL);
   create_item_factory (ifactory, 1, menu_items + 7, edit_bookmarks_dialog);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_bookmarks_dialog)->vbox),
@@ -1284,6 +1287,8 @@
 
   create_item_factory (edit_factory, 6, menu_items + 2, edit_bookmarks_dialog);
 
+  gtk_window_add_accel_group (GTK_WINDOW (edit_bookmarks_dialog), accel_group);
+
   tree = gtk_ctree_new (1, 0);
   gtk_clist_set_selection_mode (GTK_CLIST (tree), GTK_SELECTION_BROWSE);
   gtk_clist_set_reorderable (GTK_CLIST (tree), 1);
--- a/src/gtk/gftp-gtk.c	Fri Jul 28 18:46:18 2006 +0000
+++ b/src/gtk/gftp-gtk.c	Sat Jul 29 13:51:15 2006 +0000
@@ -242,20 +242,20 @@
 CreateMenus (GtkWidget * parent)
 {
   int local_len, remote_len, len, i, trans_len, log_len, tools_len, log_start;
-  GtkAccelGroup *accel_group;
+  GtkAccelGroup * accel_group;
   intptr_t ascii_transfers;
   GtkWidget * tempwid;
   static GtkItemFactoryEntry menu_items[] = {
     {N_("/_FTP"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/FTP/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
-    {N_("/FTP/Window _1"), NULL, change_setting, GFTP_MENU_ITEM_WIN1,
+    {N_("/FTP/Window _1"), "<control>1", change_setting, GFTP_MENU_ITEM_WIN1,
      MN_("<RadioItem>")},
-    {N_("/FTP/Window _2"), NULL, change_setting, GFTP_MENU_ITEM_WIN2,
+    {N_("/FTP/Window _2"), "<control>2", change_setting, GFTP_MENU_ITEM_WIN2,
      MN_("/FTP/Window 1")},
     {N_("/FTP/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/FTP/Ascii"), NULL, change_setting, GFTP_MENU_ITEM_ASCII,
+    {N_("/FTP/_Ascii"), NULL, change_setting, GFTP_MENU_ITEM_ASCII,
      MN_("<RadioItem>")},
-    {N_("/FTP/Binary"), NULL, change_setting, GFTP_MENU_ITEM_BINARY,
+    {N_("/FTP/_Binary"), NULL, change_setting, GFTP_MENU_ITEM_BINARY,
      MN_("/FTP/Ascii")},
     {N_("/FTP/sep"), NULL, 0, 0, MN_("<Separator>")},
     {N_("/FTP/_Preferences..."), NULL, options_dialog, 0,
@@ -264,48 +264,58 @@
     {N_("/FTP/_Quit"), "<control>Q", _gftp_menu_exit, 0, MS_(GTK_STOCK_QUIT)},
     {N_("/_Local"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Local/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
-    {N_("/Local/Open Location..."), "", openurl_dialog, 0, MS_(GTK_STOCK_OPEN)},
-    {N_("/Local/_Disconnect"), "", gftpui_disconnect, 0, MS_(GTK_STOCK_CLOSE)},
+    {N_("/Local/_Open Location..."), "<control><shift>O", openurl_dialog, 0,
+        MS_(GTK_STOCK_OPEN)},
+    {N_("/Local/D_isconnect"), "<control><shift>I", gftpui_disconnect, 0, MS_(GTK_STOCK_CLOSE)},
     {N_("/Local/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/Local/Change Filespec..."), NULL, change_filespec, 0, MN_(NULL)},
+    {N_("/Local/Change _Filespec..."), "<control><shift>F", change_filespec, 0,
+     MN_(NULL)},
     {N_("/Local/_Show selected"), NULL, show_selected, 0, MN_(NULL)},
-    {N_("/Local/Select _All"), NULL, selectall, 0, MN_(NULL)},
+    {N_("/Local/Select _All"), "<control><shift>A", selectall, 0, MN_(NULL)},
     {N_("/Local/Select All Files"), NULL, selectallfiles, 0, MN_(NULL)},
     {N_("/Local/Deselect All"), NULL, deselectall, 0, MN_(NULL)},
     {N_("/Local/sep"), NULL, 0, 0, MN_("<Separator>")},
     {N_("/Local/Save Directory Listing..."), NULL, save_directory_listing, 0, MN_(NULL)},
     {N_("/Local/Send SITE Command..."), NULL, gftpui_site_dialog, 0, MN_(NULL)},
-    {N_("/Local/Change Directory"), NULL, gftpui_chdir_dialog, 0, MN_(NULL)},
-    {N_("/Local/_Permissions..."), NULL, chmod_dialog, 0, MN_(NULL)},
+    {N_("/Local/_Change Directory"), NULL, gftpui_chdir_dialog, 0, MN_(NULL)},
+    {N_("/Local/_Permissions..."), "<control><shift>P", chmod_dialog, 0,
+        MN_(NULL)},
     {N_("/Local/_New Folder..."), "<control><shift>N", gftpui_mkdir_dialog, 0, MN_(NULL)},
-    {N_("/Local/Re_name..."), "F2", gftpui_rename_dialog, 0, MN_(NULL)},
-    {N_("/Local/Delete..."), NULL, delete_dialog, 0, MN_(NULL)},
-    {N_("/Local/_Edit..."), NULL, edit_dialog, 0, MN_(NULL)},
-    {N_("/Local/_View..."), NULL, view_dialog, 0, MN_(NULL)},
-    {N_("/Local/_Refresh"), NULL, gftp_gtk_refresh, 0, MS_(GTK_STOCK_REFRESH)},
+    {N_("/Local/Rena_me..."), "<control><shift>M", gftpui_rename_dialog, 0,
+        MN_(NULL)},
+    {N_("/Local/_Delete..."), "<control><shift>D", delete_dialog, 0,
+        MN_(NULL)},
+    {N_("/Local/_Edit..."), "<control><shift>E", edit_dialog, 0, MN_(NULL)},
+    {N_("/Local/_View..."), "<control><shift>V", view_dialog, 0, MN_(NULL)},
+    {N_("/Local/_Refresh"), "<control><shift>R", gftp_gtk_refresh, 0,
+        MS_(GTK_STOCK_REFRESH)},
     {N_("/_Remote"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Remote/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
     {N_("/Remote/_Open Location..."), "<control>O", openurl_dialog, 0,
 	MS_(GTK_STOCK_OPEN)},
-    {N_("/Remote/_Disconnect"), "<control>D", gftpui_disconnect, 0,
+    {N_("/Remote/D_isconnect"), "<control>D", gftpui_disconnect, 0,
 	MS_(GTK_STOCK_CLOSE)},
     {N_("/Remote/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/Remote/Change Filespec..."), NULL, change_filespec, 0, MN_(NULL)},
+    {N_("/Remote/Change _Filespec..."), "<control>F", change_filespec, 0,
+        MN_(NULL)},
     {N_("/Remote/_Show selected"), NULL, show_selected, 0, MN_(NULL)},
-    {N_("/Remote/Select _All"), NULL, selectall, 0, MN_(NULL)},
+    {N_("/Remote/Select _All"), "<control>A", selectall, 0, MN_(NULL)},
     {N_("/Remote/Select All Files"), NULL, selectallfiles, 0, MN_(NULL)},
     {N_("/Remote/Deselect All"), NULL, deselectall, 0, MN_(NULL)},
     {N_("/Remote/sep"), NULL, 0, 0, MN_("<Separator>")},
     {N_("/Remote/Save Directory Listing..."), NULL, save_directory_listing, 0, MN_(NULL)},
     {N_("/Remote/Send SITE Command..."), NULL, gftpui_site_dialog, 0, MN_(NULL)},
-    {N_("/Remote/Change Directory"), NULL, gftpui_chdir_dialog, 0, MN_(NULL)},
-    {N_("/Remote/_Permisssions..."), NULL, chmod_dialog, 0, MN_(NULL)},
-    {N_("/Remote/_New Folder..."), NULL, gftpui_mkdir_dialog, 0, MN_(NULL)},
-    {N_("/Remote/Re_name..."), NULL, gftpui_rename_dialog, 0, MN_(NULL)},
-    {N_("/Remote/Delete..."), NULL, delete_dialog, 0, MN_(NULL)},
-    {N_("/Remote/_Edit..."), NULL, edit_dialog, 0, MN_(NULL)},
-    {N_("/Remote/_View..."), NULL, view_dialog, 0, MN_(NULL)},
-    {N_("/Remote/_Refresh"), NULL, gftp_gtk_refresh, 0, MS_(GTK_STOCK_REFRESH)},
+    {N_("/Remote/_Change Directory"), NULL, gftpui_chdir_dialog, 0, MN_(NULL)},
+    {N_("/Remote/_Permisssions..."), "<control>P", chmod_dialog, 0, MN_(NULL)},
+    {N_("/Remote/_New Folder..."), "<control>N", gftpui_mkdir_dialog, 0,
+        MN_(NULL)},
+    {N_("/Remote/Rena_me..."), "<control>M", gftpui_rename_dialog, 0,
+        MN_(NULL)},
+    {N_("/Remote/_Delete..."), "<control>D", delete_dialog, 0, MN_(NULL)},
+    {N_("/Remote/_Edit..."), "<control>E", edit_dialog, 0, MN_(NULL)},
+    {N_("/Remote/_View..."), "<control>V", view_dialog, 0, MN_(NULL)},
+    {N_("/Remote/_Refresh"), "<control>R", gftp_gtk_refresh, 0,
+        MS_(GTK_STOCK_REFRESH)},
     {N_("/_Bookmarks"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Bookmarks/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
     {N_("/Bookmarks/Add _Bookmark"), "<control>B", add_bookmark, 0,
@@ -314,20 +324,20 @@
     {N_("/Bookmarks/sep"), NULL, 0, 0, MN_("<Separator>")},
     {N_("/_Transfer"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Transfer/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
-    {N_("/Transfer/Start"), NULL, start_transfer, 0, MN_(NULL)},
-    {N_("/Transfer/Stop"), NULL, stop_transfer, 0,
+    {N_("/Transfer/_Start"), NULL, start_transfer, 0, MN_(NULL)},
+    {N_("/Transfer/St_op"), NULL, stop_transfer, 0,
 	MS_(GTK_STOCK_STOP)},
     {N_("/Transfer/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/Transfer/Skip Current File"), NULL, skip_transfer, 0, MN_(NULL)},
-    {N_("/Transfer/Remove File"), NULL, remove_file_transfer, 0,
+    {N_("/Transfer/Skip _Current File"), NULL, skip_transfer, 0, MN_(NULL)},
+    {N_("/Transfer/_Remove File"), NULL, remove_file_transfer, 0,
 	MS_(GTK_STOCK_DELETE)},
-    {N_("/Transfer/Move File Up"), NULL, move_transfer_up, 0,
+    {N_("/Transfer/Move File _Up"), NULL, move_transfer_up, 0,
 	MS_(GTK_STOCK_GO_UP)},
-    {N_("/Transfer/Move File Down"), NULL, move_transfer_down, 0,
+    {N_("/Transfer/Move File _Down"), NULL, move_transfer_down, 0,
 	MS_(GTK_STOCK_GO_DOWN)},
     {N_("/Transfer/sep"), NULL, 0, 0, MN_("<Separator>")},
-    {N_("/Transfer/Retrieve Files"), "<control>R", get_files, 0, MN_(NULL)},
-    {N_("/Transfer/Put Files"), "<control>P", put_files, 0, MN_(NULL)},
+    {N_("/Transfer/_Retrieve Files"), "<control>R", get_files, 0, MN_(NULL)},
+    {N_("/Transfer/_Put Files"), "<control>P", put_files, 0, MN_(NULL)},
     {N_("/L_og"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Log/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
     {N_("/Log/_Clear"), NULL, clearlog, 0, MS_(GTK_STOCK_CLEAR)},