changeset 586:4b7f208dd6ee

2004-10-5 Brian Masney <masneyb@gftp.org> * src/gtk/misc-gtk.c src/gtk/gftp-gtk.c - disable the items in the transfer menu when the user is not connected. (Patch partially from Frank Anderson <fanson@gmail.com>)
author masneyb
date Wed, 06 Oct 2004 01:45:37 +0000
parents d04885d47cc0
children 7937ade77c22
files ChangeLog src/gtk/gftp-gtk.c src/gtk/misc-gtk.c
diffstat 3 files changed, 32 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Oct 05 22:32:21 2004 +0000
+++ b/ChangeLog	Wed Oct 06 01:45:37 2004 +0000
@@ -1,3 +1,8 @@
+2004-10-5 Brian Masney <masneyb@gftp.org>
+	* src/gtk/misc-gtk.c src/gtk/gftp-gtk.c - disable the items in the
+	transfer menu when the user is not connected. (Patch partially from
+	Frank Anderson <fanson@gmail.com>)
+
 2004-10-4 Brian Masney <masneyb@gftp.org>
 	* lib/protocols.c (gftp_string_from_utf8,gftp_string_to_utf8) - added
 	more printf() functions whenever there is a problem converting a string
@@ -2930,7 +2935,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.341 2004/10/05 00:13:09 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.342 2004/10/06 01:45:37 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/gftp-gtk.c	Tue Oct 05 22:32:21 2004 +0000
+++ b/src/gtk/gftp-gtk.c	Wed Oct 06 01:45:37 2004 +0000
@@ -304,9 +304,9 @@
     {N_("/Transfers/Skip Current File"), NULL, skip_transfer, 0, MN_(NULL)},
     {N_("/Transfers/Remove File"), NULL, remove_file_transfer, 0,
 	MS_(GTK_STOCK_DELETE)},
-    {N_("/Transfers/Move File _Up"), NULL, move_transfer_up, 0,
+    {N_("/Transfers/Move File Up"), NULL, move_transfer_up, 0,
 	MS_(GTK_STOCK_GO_UP)},
-    {N_("/Transfers/Move File _Down"), NULL, move_transfer_down, 0,
+    {N_("/Transfers/Move File Down"), NULL, move_transfer_down, 0,
 	MS_(GTK_STOCK_GO_DOWN)},
     {N_("/Transfers/sep"), NULL, 0, 0, MN_("<Separator>")},
     {N_("/Transfers/Retrieve Files"), "<control>R", get_files, 0, MN_(NULL)},
--- a/src/gtk/misc-gtk.c	Tue Oct 05 22:32:21 2004 +0000
+++ b/src/gtk/misc-gtk.c	Wed Oct 06 01:45:37 2004 +0000
@@ -270,13 +270,16 @@
   if (tempwid)
     gtk_widget_set_sensitive (tempwid, sensitive);
 
-  if ((pos = strchr (path + 1, '/')) == NULL)
-    pos = path;
-
-  if (wdata->ifactory)
-    tempwid = gtk_item_factory_get_widget (wdata->ifactory, pos);
-  if (tempwid)
-    gtk_widget_set_sensitive (tempwid, sensitive);
+  if (wdata != NULL)
+    {
+      if ((pos = strchr (path + 1, '/')) == NULL)
+        pos = path;
+    
+      if (wdata->ifactory)
+        tempwid = gtk_item_factory_get_widget (wdata->ifactory, pos);
+      if (tempwid)
+        gtk_widget_set_sensitive (tempwid, sensitive);
+    }
 }
 
 
@@ -359,6 +362,20 @@
   set_menu_sensitive (wdata, menus[start + 19].path, connected &&
                       wdata->request->get_file != NULL);
   set_menu_sensitive (wdata, menus[start + 20].path, connected);
+
+  connected = GFTP_IS_CONNECTED (window1.request) && GFTP_IS_CONNECTED (window2.request);
+
+  start = trans_start;
+  set_menu_sensitive (NULL, menus[start + 2].path, connected);
+  set_menu_sensitive (NULL, menus[start + 3].path, connected);
+  set_menu_sensitive (NULL, menus[start + 5].path, connected);
+  set_menu_sensitive (NULL, menus[start + 6].path, connected);
+
+  set_menu_sensitive (NULL, menus[start + 7].path, connected);
+  set_menu_sensitive (NULL, menus[start + 8].path, connected);
+
+  set_menu_sensitive (NULL, menus[start + 10].path, connected);
+  set_menu_sensitive (NULL, menus[start + 11].path, connected);
 }