changeset 294:4747f621b79b

2003-10-25 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c src/gtk/gftp-gtk.h src/gtk/view_dialog.c - when editing a remote file, if the user chooses to upload the changes, make sure the upload is not sent to the current directory on the remote server. * lib/rfc2068.c - set the shown attributes to be -rw------- instead of ----------. The HTTP server doesn't send the attributes over, so I just have to make something up. * src/gtk/options_dialog.c - make sure all of the tooltips text is passed to gettext() * lib/protocols.c - if the file transfer is to be throttled, only display the throttle message once. * lib/local.c (local_get_next_file) - if the file is a symlink, grab file size and attributes from the file this symlink points to.
author masneyb
date Sat, 25 Oct 2003 21:33:46 +0000
parents 332beeff0b3d
children ab4c90a561fc
files ChangeLog lib/local.c lib/protocols.c lib/rfc2068.c src/gtk/gftp-gtk.h src/gtk/options_dialog.c src/gtk/transfer.c src/gtk/view_dialog.c
diffstat 8 files changed, 46 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 22 20:27:23 2003 +0000
+++ b/ChangeLog	Sat Oct 25 21:33:46 2003 +0000
@@ -1,3 +1,22 @@
+2003-10-25 Brian Masney <masneyb@gftp.org>
+	* src/gtk/transfer.c src/gtk/gftp-gtk.h src/gtk/view_dialog.c - when
+	editing a remote file, if the user chooses to upload the changes, make
+	sure the upload is not sent to the current directory on the remote
+	server.
+
+	* lib/rfc2068.c - set the shown attributes to be -rw------- instead of
+	----------. The HTTP server doesn't send the attributes over, so I just
+	have to make something up.
+
+	* src/gtk/options_dialog.c - make sure all of the tooltips text is
+	passed to gettext()
+
+	* lib/protocols.c - if the file transfer is to be throttled, only
+	display the throttle message once.
+
+	* lib/local.c (local_get_next_file) - if the file is a symlink, grab
+	file size and attributes from the file this symlink points to.
+
 2003-10-22 Brian Masney <masneyb@gftp.org>
 	* lib/rfc2068.c - fixed parsing some chunked file transfers
 
@@ -1595,7 +1614,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.155 2003/10/22 20:27:23 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.156 2003/10/25 21:33:40 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/local.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/lib/local.c	Sat Oct 25 21:33:46 2003 +0000
@@ -353,14 +353,14 @@
       g_hash_table_insert (lpd->grouphash, GUINT_TO_POINTER (st.st_gid), group);
     }
 
-  fle->attribs = make_text_mode (st.st_mode);
+  fle->attribs = make_text_mode (fst.st_mode);
   fle->datetime = st.st_mtime;
 
   if ((fle->attribs[0] == 'b' || fle->attribs[0] == 'u' ||
        fle->attribs[0] == 'c'))
     fle->size = (off_t) st.st_rdev;
   else
-    fle->size = st.st_size;
+    fle->size = fst.st_size;
 
   fle->isdir = S_ISDIR (fst.st_mode);
   fle->islink = S_ISLNK (st.st_mode);
--- a/lib/protocols.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/lib/protocols.c	Sat Oct 25 21:33:46 2003 +0000
@@ -157,18 +157,8 @@
 gftp_get_file (gftp_request * request, const char *filename, int fd,
                off_t startsize)
 {
-  float maxkbs;
-
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
-  gftp_lookup_request_option (request, "maxkbs", &maxkbs);
-  if (maxkbs > 0)
-    {
-      request->logging_function (gftp_logging_misc, request,
-                    _("File transfer will be throttled to %.2f KB/s\n"),
-                    maxkbs);
-    }
-
   request->cached = 0;
   if (request->get_file == NULL)
     return (GFTP_EFATAL);
@@ -181,19 +171,8 @@
 gftp_put_file (gftp_request * request, const char *filename, int fd,
                off_t startsize, off_t totalsize)
 {
-  float maxkbs;
-
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
-  gftp_lookup_request_option (request, "maxkbs", &maxkbs);
-
-  if (maxkbs > 0)
-    {
-      request->logging_function (gftp_logging_misc, request,
-                    _("File transfer will be throttled to %.2f KB/s\n"), 
-                    maxkbs);
-    }
-
   request->cached = 0;
   if (request->put_file == NULL)
     return (GFTP_EFATAL);
@@ -207,6 +186,7 @@
                     gftp_request * toreq, const char *tofile,
                     int tofd, off_t tosize)
 {
+  float maxkbs;
   off_t size;
   int ret;
 
@@ -215,6 +195,14 @@
   g_return_val_if_fail (toreq != NULL, GFTP_EFATAL);
   g_return_val_if_fail (tofile != NULL, GFTP_EFATAL);
 
+  gftp_lookup_request_option (toreq, "maxkbs", &maxkbs);
+  if (maxkbs > 0)
+    {
+      toreq->logging_function (gftp_logging_misc, toreq,
+                    _("File transfer will be throttled to %.2f KB/s\n"), 
+                    maxkbs);
+    }
+
   if (fromreq->protonum == toreq->protonum &&
       fromreq->transfer_file != NULL)
     return (fromreq->transfer_file (fromreq, fromfile, fromsize, toreq, 
--- a/lib/rfc2068.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/lib/rfc2068.c	Sat Oct 25 21:33:46 2003 +0000
@@ -498,7 +498,7 @@
 
   /* Copy file attributes. Just about the only thing we can get is whether it
      is a directory or not */
-  fle->attribs = g_strdup ("----------");
+  fle->attribs = g_strdup ("-rw-------");
   if (*(pos - 1) == '/')
     {
       *(pos - 1) = '\0';
--- a/src/gtk/gftp-gtk.h	Wed Oct 22 20:27:23 2003 +0000
+++ b/src/gtk/gftp-gtk.h	Sat Oct 25 21:33:46 2003 +0000
@@ -116,6 +116,7 @@
 				   editing it */
    gftp_window_data * fromwdata, /* The window we are viewing this file in */
                     * towdata;
+   gftp_request * torequest;
 } gftp_viewedit_data;
 
 
--- a/src/gtk/options_dialog.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/src/gtk/options_dialog.c	Sat Oct 25 21:33:46 2003 +0000
@@ -71,7 +71,7 @@
   if (tiptxt != NULL)
     {
       tooltip = gtk_tooltips_new ();
-      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), tempwid, tiptxt, NULL);
+      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), tempwid, _(tiptxt), NULL);
     }
 
   return (tempwid);
@@ -192,7 +192,7 @@
   if (cv->comment != NULL)
     {
       tooltip = gtk_tooltips_new ();
-      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), combo, cv->comment, NULL);
+      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), combo, _(cv->comment), NULL);
     }
 
   return (combo);
@@ -416,10 +416,11 @@
   if (cv->comment != NULL)
     {
       tooltip = gtk_tooltips_new ();
-      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), combo, cv->comment, NULL);
+      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), combo, _(cv->comment), NULL);
 
       tooltip = gtk_tooltips_new ();
-      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), textwid, cv->comment, NULL);
+      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), textwid, _(cv->comment), 
+                            NULL);
     }
 
   return (widdata);
@@ -564,7 +565,8 @@
   if (cv->comment != NULL)
     {
       tooltip = gtk_tooltips_new ();
-      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), tempwid, cv->comment, NULL);
+      gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltip), tempwid, _(cv->comment),
+                            NULL);
     }
 
   return (tempwid);
--- a/src/gtk/transfer.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/src/gtk/transfer.c	Sat Oct 25 21:33:46 2003 +0000
@@ -926,6 +926,8 @@
 {
   int i;
 
+  if (ve_proc->torequest)
+    gftp_request_destroy (ve_proc->torequest, 1);
   if (ve_proc->filename)
     g_free (ve_proc->filename);
   if (ve_proc->remote_filename)
@@ -952,13 +954,14 @@
   GList * newfile;
 
   tempfle = g_malloc0 (sizeof (*tempfle));
-  tempfle->destfile = ve_proc->remote_filename;
+  tempfle->destfile = gftp_build_path (ve_proc->torequest->directory,
+                                       ve_proc->remote_filename, NULL);
   ve_proc->remote_filename = NULL;
   tempfle->file = ve_proc->filename;
   ve_proc->filename = NULL;
   tempfle->done_rm = 1;
   newfile = g_list_append (NULL, tempfle);
-  add_file_transfer (ve_proc->fromwdata->request, ve_proc->towdata->request,
+  add_file_transfer (ve_proc->fromwdata->request, ve_proc->torequest,
                      ve_proc->fromwdata, ve_proc->towdata, newfile, 1);
   free_edit_data (ve_proc);
 }
--- a/src/gtk/view_dialog.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/src/gtk/view_dialog.c	Sat Oct 25 21:33:46 2003 +0000
@@ -199,6 +199,7 @@
           newproc->fromwdata = &window1;
           newproc->towdata = &window2;
         }
+      newproc->torequest = copy_request (newproc->towdata->request, 1);
       newproc->filename = g_strdup (filename);
       if (remote_filename != NULL)
 	newproc->remote_filename = g_strdup (remote_filename);