changeset 425:8fc4efa3f72d

2004-3-16 Brian Masney <masneyb@gftp.org> * src/gtk/misc-gtk.c src/gtk/gftp-gtk.h - added destroy_dialog() function * src/gtk/gftp-gtk.c - destroy the openurl dialog before attempting to connect to the server
author masneyb
date Tue, 16 Mar 2004 12:23:54 +0000
parents 26333110dfd2
children c5d14dca70c3
files ChangeLog src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/misc-gtk.c
diffstat 4 files changed, 39 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 16 02:38:52 2004 +0000
+++ b/ChangeLog	Tue Mar 16 12:23:54 2004 +0000
@@ -1,3 +1,10 @@
+2004-3-16 Brian Masney <masneyb@gftp.org>
+	* src/gtk/misc-gtk.c src/gtk/gftp-gtk.h - added destroy_dialog()
+	function
+
+	* src/gtk/gftp-gtk.c - destroy the openurl dialog before attempting to
+	connect to the server
+
 2004-3-15 Brian Masney <masneyb@gftp.org>
 	* src/gtk/misc-gtk.c (update_directory_download_progress) - center the
 	progress dialog (closes #136370)
@@ -5,7 +12,8 @@
 	* lib/gftp.h - if _FILE_OFFSET_BITS is > 32 and _LARGEFILE_SOURCE is 
 	not defined, define it
 
-	* lib/protocols.c (gftp_string_{to|from}_utf8 - don't alter the contents	of the remote_charsets option. Instead, make a copy of that and alter
+	* lib/protocols.c (gftp_string_{to|from}_utf8 - don't alter the contents
+	of the remote_charsets option. Instead, make a copy of that and alter
 	that copy
 
 2004-3-14 Brian Masney <masneyb@gftp.org>
@@ -2275,7 +2283,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.232 2004/03/16 02:38:51 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.233 2004/03/16 12:23:52 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/gftp-gtk.c	Tue Mar 16 02:38:52 2004 +0000
+++ b/src/gtk/gftp-gtk.c	Tue Mar 16 12:23:54 2004 +0000
@@ -162,11 +162,17 @@
 static void
 _gftpui_gtk_do_openurl (gftp_window_data * wdata, gftp_dialog_data * ddata)
 {
-  const char *str;
+  const char *tempstr;
+  char *buf;
 
-  str = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
-  if (str != NULL && *str != '\0')
-    gftpui_common_cmd_open (wdata, wdata->request, NULL, NULL, str);
+  tempstr = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
+  if (tempstr != NULL && *tempstr != '\0')
+    {
+      buf = g_strdup (tempstr);
+      destroy_dialog (ddata);
+      gftpui_common_cmd_open (wdata, wdata->request, NULL, NULL, buf);
+      g_free (buf);
+    }
 }
 
 
--- a/src/gtk/gftp-gtk.h	Tue Mar 16 02:38:52 2004 +0000
+++ b/src/gtk/gftp-gtk.h	Tue Mar 16 12:23:54 2004 +0000
@@ -348,6 +348,8 @@
 void add_file_listbox 				( gftp_window_data * wdata, 
 						  gftp_file * fle );
 
+void destroy_dialog 				( gftp_dialog_data * ddata );
+
 void MakeEditDialog 				( char *diagtxt, 
 						  char *infotxt, 
 						  char *deftext, 
--- a/src/gtk/misc-gtk.c	Tue Mar 16 02:38:52 2004 +0000
+++ b/src/gtk/misc-gtk.c	Tue Mar 16 12:23:54 2004 +0000
@@ -752,6 +752,17 @@
 }
 
 
+void
+destroy_dialog (gftp_dialog_data * ddata)
+{
+  if (ddata->dialog != NULL)
+    {
+      gtk_widget_destroy (ddata->dialog);
+      ddata->dialog = NULL;
+    }
+}
+
+
 #if GTK_MAJOR_VERSION == 1
 static void
 ok_dialog_response (GtkWidget * widget, gftp_dialog_data * ddata)
@@ -766,7 +777,8 @@
   if (ddata->yesfunc != NULL)
     ddata->yesfunc (ddata->yespointer, ddata);
 
-  if (ddata->edit != NULL)
+  if (ddata->edit != NULL &&
+      ddata->dialog != NULL)
     gtk_widget_destroy (ddata->dialog);
 
   g_free (ddata);
@@ -786,7 +798,8 @@
   if (ddata->nofunc != NULL)
     ddata->nofunc (ddata->nopointer, ddata);
 
-  if (ddata->edit != NULL)
+  if (ddata->edit != NULL &&
+      ddata->dialog != NULL)
     gtk_widget_destroy (ddata->dialog);
 
   g_free (ddata);
@@ -814,7 +827,8 @@
         break;
     }
 
-  if (ddata->edit != NULL)
+  if (ddata->edit != NULL &&
+      ddata->dialog != NULL)
     gtk_widget_destroy (ddata->dialog);
 
   g_free (ddata);