changeset 198:8fea1b1a2ec6

2003-6-22 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h - renamed parse_args to gftp_config_parse_args() and removed the static declaration * lib/protocols.c (gftp_request_destroy) - fixed memory problem with the new local configuration interface * src/gtk/gftp-gtk.c - added gftp_gtk_config_(read|write)_color(). I am overriding the read and write functions for gftp_option_type_color to be these functions. This is so that I can use a GdkColor structure instead of a gftp_color structure * src/gtk/misc-gtk.c - when destroying the dialogs, set the pointers to NULL before we call the callback functions. This is to make sure that they aren't being used in the callbacks * TODO - updated
author masneyb
date Mon, 23 Jun 2003 01:07:05 +0000
parents 31ea23fcc69f
children 75eebb3b0592
files ChangeLog TODO lib/config_file.c lib/gftp.h lib/protocols.c src/gtk/gftp-gtk.c src/gtk/misc-gtk.c
diffstat 7 files changed, 115 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jun 22 22:54:02 2003 +0000
+++ b/ChangeLog	Mon Jun 23 01:07:05 2003 +0000
@@ -1,3 +1,21 @@
+2003-6-22 Brian Masney <masneyb@gftp.org>
+	* lib/config_file.c lib/gftp.h - renamed parse_args to 
+	gftp_config_parse_args() and removed the static declaration
+
+	* lib/protocols.c (gftp_request_destroy) - fixed memory problem with 
+	the new local configuration interface
+
+	* src/gtk/gftp-gtk.c - added gftp_gtk_config_(read|write)_color().
+	I am overriding the read and write functions for
+	gftp_option_type_color to be these functions. This is so that I can
+	use a GdkColor structure instead of a gftp_color structure
+
+	* src/gtk/misc-gtk.c - when destroying the dialogs, set the pointers
+	to NULL before we call the callback functions. This is to make sure
+	that they aren't being used in the callbacks
+
+	* TODO - updated
+
 2003-6-19 Brian Masney <masneyb@gftp.org>
 	* autogen.sh - updated to hopefully make it more portable across
 	various systems
@@ -1052,7 +1070,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.97 2003/06/20 01:39:42 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.98 2003/06/23 01:07:04 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/TODO	Sun Jun 22 22:54:02 2003 +0000
+++ b/TODO	Mon Jun 23 01:07:05 2003 +0000
@@ -2,14 +2,31 @@
 of gFTP. If there is something you feel should be included in a future
 version of gFTP, please email me about it.
 
+*** TODO FOR 2.0.15 ***
+* DND - be able to resume transfers
+* HTTP - keepalive
+* HTTP - chdir .. is busted
+* HTTP - I am getting complaints about HTTP proxy support is busted
+* Finish generic SSL layer
+* Profile SSHV2 transfers, they seem really slow to me
+* Override options on a per site basis (backend is done, I just have to make
+  a user interface for the text and gtk+ port)
+* Fix most FIXME's in the code
+*** END TODO FOR 2.0.15
+
+* I need to be able to send an event from the core library to the presentation
+  layer to have it ask the user a question. I need this for the SSL layer so 
+  that if an unknown certificate authority signed the certificate, the user
+  can be prompted whether or not to accept it. Also, it would be handy to 
+  prompt the user for their password if a bad password was entered. 
+* Support tabbed interface in GTK+ port
+* Parallel chdir in GTK+ port
 * GTK 2.0 port - make 2 buttons in toolbar be the same size as the gnome 2
   icons
 * Add option to hide certain files
 * Be able to save the state of the transfer queue. Be able to pause transfers.
-  Be able to edit the transfer information (hostname, user, etc)
 * For bookmarks, be able to specify a local protocol, host, port, directory
   to connect to
-* SSH login sequence could be improved
 * Show status information in title bar
 * -d command line, check if it's a file first, if so download. If not, grab directory
 * Add option for @dynamic@ for bookmarks' account
@@ -21,8 +38,9 @@
 * Full Gnome compatibility.
 * Add registered file extensions to options dialog
 * VMS directory listings
+* Add automatic refresh interval (maybe, this could be used to get around 
+  timeouts remote servers may set)
 * HTTP: Support CONNECT method in Squid proxy
-* FTP: Support rfc1639
 * Add support for SRP protocol (http://srp.stanford.edu/srp)
 * Add support for DAV protocol
 * Add support for rsync protocol
--- a/lib/config_file.c	Sun Jun 22 22:54:02 2003 +0000
+++ b/lib/config_file.c	Mon Jun 23 01:07:05 2003 +0000
@@ -227,8 +227,8 @@
 }
 
 
-static int
-parse_args (char *str, int numargs, int lineno, char **first, ...)
+int
+gftp_config_parse_args (char *str, int numargs, int lineno, char **first, ...)
 {
   char *curpos, *endpos, *pos, **dest, tempchar;
   int ret, has_colon;
@@ -384,8 +384,8 @@
   char *tempstr;
 
   tempext = g_malloc (sizeof (*tempext));
-  parse_args (buf, 4, line, &tempext->ext, &tempext->filename,
-              &tempext->ascii_binary, &tempext->view_program);
+  gftp_config_parse_args (buf, 4, line, &tempext->ext, &tempext->filename,
+                          &tempext->ascii_binary, &tempext->view_program);
  
   if ((tempstr = get_xpm_path (tempext->filename, 1)) != NULL)
     g_free (tempstr);
@@ -931,7 +931,7 @@
   if (cv->flags & GFTP_CVARS_FLAGS_DYNMEM && cv->value != NULL)
     g_free (cv->value);
 
-  parse_args (str, 3, line, &red, &green, &blue);
+  gftp_config_parse_args (str, 3, line, &red, &green, &blue);
 
   color = g_malloc (sizeof (*color));
   color->red = strtol (red, NULL, 16);
--- a/lib/gftp.h	Sun Jun 22 22:54:02 2003 +0000
+++ b/lib/gftp.h	Mon Jun 23 01:07:05 2003 +0000
@@ -581,6 +581,12 @@
 					  int ignore_directory );
 
 /* config_file.c */
+int gftp_config_parse_args 		( char *str, 
+					  int numargs, 
+					  int lineno, 
+					  char **first, 
+					  ... );
+
 void gftp_add_bookmark 			( gftp_bookmarks_var * newentry );
 
 void gftp_read_config_file 		( char *global_data_path );
--- a/lib/protocols.c	Sun Jun 22 22:54:02 2003 +0000
+++ b/lib/protocols.c	Mon Jun 23 01:07:05 2003 +0000
@@ -64,6 +64,12 @@
   if (request->protocol_data)
     g_free (request->protocol_data);
 
+  if (request->local_options_vars != NULL)
+    {
+      g_free (request->local_options_vars);
+      g_hash_table_destroy (request->local_options_hash);
+    }
+
   memset (request, 0, sizeof (*request));
 
   if (free_request)
@@ -73,12 +79,6 @@
       request->datafd = -1;
       request->cachefd = -1;
     }
-
-  if (request->local_options_vars != NULL)
-    {
-      g_free (request->local_options_vars);
-      g_hash_table_destroy (request->local_options_hash);
-    }
 }
 
 
--- a/src/gtk/gftp-gtk.c	Sun Jun 22 22:54:02 2003 +0000
+++ b/src/gtk/gftp-gtk.c	Mon Jun 23 01:07:05 2003 +0000
@@ -1050,6 +1050,43 @@
 }
 
 
+static int
+gftp_gtk_config_file_read_color (char *str, gftp_config_vars * cv, int line)
+{
+  char *red, *green, *blue;
+  GdkColor * color;
+
+  if (cv->flags & GFTP_CVARS_FLAGS_DYNMEM && cv->value != NULL)
+    g_free (cv->value);
+
+  gftp_config_parse_args (str, 3, line, &red, &green, &blue);
+
+  color = g_malloc (sizeof (*color));
+  color->red = strtol (red, NULL, 16);
+  color->green = strtol (green, NULL, 16);
+  color->blue = strtol (blue, NULL, 16);
+  g_free (red);
+  g_free (green);
+  g_free (blue);
+
+  cv->value = color;
+  cv->flags |= GFTP_CVARS_FLAGS_DYNMEM;
+
+  return (0);
+}
+
+
+static int
+gftp_gtk_config_file_write_color (gftp_config_vars * cv, FILE * fd, int to_config_file)
+{
+  GdkColor * color;
+
+  color = cv->value;
+  fprintf (fd, "%x:%x:%x", color->red, color->green, color->blue);
+  return (0);
+}
+
+
 int
 main (int argc, char **argv)
 {
@@ -1077,6 +1114,12 @@
 
   graphic_hash_table = g_hash_table_new (string_hash_function, string_hash_compare);
  
+  /* We override the read color functions because we are using a GdkColor 
+     structures to store the color. If I put this in lib/config_file.c, then 
+     the core library would be dependant on Gtk+ being present */
+  gftp_option_types[gftp_option_type_color].read_function = gftp_gtk_config_file_read_color;
+  gftp_option_types[gftp_option_type_color].write_function = gftp_gtk_config_file_write_color;
+
   gftp_read_config_file (SHARE_DIR);
   if (gftp_parse_command_line (&argc, &argv) != 0)
     exit (0);
--- a/src/gtk/misc-gtk.c	Sun Jun 22 22:54:02 2003 +0000
+++ b/src/gtk/misc-gtk.c	Mon Jun 23 01:07:05 2003 +0000
@@ -808,7 +808,11 @@
 ok_dialog_response (GtkWidget * widget, gftp_dialog_data * ddata)
 {
   if (ddata->edit == NULL)
-    gtk_widget_destroy (ddata->dialog);
+    {
+      gtk_widget_destroy (ddata->dialog);
+      ddata->dialog = NULL;
+      ddata->checkbox = NULL;
+    }
  
   if (ddata->yesfunc != NULL)
     ddata->yesfunc (ddata->yespointer, ddata);
@@ -824,7 +828,11 @@
 cancel_dialog_response (GtkWidget * widget, gftp_dialog_data * ddata)
 {
   if (ddata->edit == NULL)
-    gtk_widget_destroy (ddata->dialog);
+    {
+      gtk_widget_destroy (ddata->dialog);
+      ddata->dialog = NULL;
+      ddata->checkbox = NULL;
+    }
  
   if (ddata->nofunc != NULL)
     ddata->nofunc (ddata->nopointer, ddata);
@@ -839,7 +847,11 @@
 dialog_response (GtkWidget * widget, gint response, gftp_dialog_data * ddata)
 {
   if (ddata->edit == NULL)
-    gtk_widget_destroy (ddata->dialog);
+    {
+      gtk_widget_destroy (ddata->dialog);
+      ddata->dialog = NULL;
+      ddata->checkbox = NULL;
+    }
 
   switch (response)
     {