diff src/gtk/mkdir_dialog.c @ 19:3b2dcdefc7e9

2002-09-15 Brian Masney <masneyb@gftp.org> * lib/gftp.h (struct gftp_transfer) - changed the type of numfiles and numdirs from unsigned long to long. This must be a signed field. This is a bug I introduced a few days ago. * lib/local.c (local_put_file) - remove the + off of the ab mode to fdopen. This is also a bug I introduced a few days ago. * src/gtk/transfer.c (gftp_gtk_calc_kbs) - make sure that the variable difftime isn't a negative number when computing the KB/s * src/gtk/menu-items.c (save_directory_listing) - remove casts to GTK_OBJECT for the str variable * src/gtk/gftp-gtk.c - use GTK_STOCK_* icons in place of left.xpm, right.xpm, up.xpm, down.xpm and stop.xpm in GTK+ 2.0 port * src/gtk/bookmarks.c - show GTK_STOCK_* icons on the popup menu * src/gtk/bookmarks.c, src/gtk/chmod_dialog.c, src/gtk/menu-items.c, src/gtk/misc-gtk.c, src/gtk/options_dialog.c and src/gtk/view_dialog.c - use gtk_dialog_new_with_buttons in GTK+ 2.0 port to create the dialog. Also, associate gFTP icon with this dialog * src/gtk/misc-gtk.c - changed the interface of MakeEditDialog and MakeYesNoDialog. In the GTK+ 2.0 port, I now use stock icons in the dialog buttons.
author masneyb
date Mon, 16 Sep 2002 12:27:50 +0000
parents 8b1883341c6f
children c8ec7877432e
line wrap: on
line diff
--- a/src/gtk/mkdir_dialog.c	Wed Sep 11 10:26:13 2002 +0000
+++ b/src/gtk/mkdir_dialog.c	Mon Sep 16 12:27:50 2002 +0000
@@ -19,56 +19,18 @@
 
 #include "gftp-gtk.h"
 
-static void domkdir 				( GtkWidget * widget, 
-						  gftp_dialog_data * data );
-static void *do_make_dir_thread 		( void * data );
-static RETSIGTYPE sig_mkdirquit 		( int signo );
-
 static const char *edttext;
 static sigjmp_buf mkdirenvir;
 
-void
-mkdir_dialog (gpointer data)
-{
-  gftp_window_data * wdata;
 
-  wdata = data;
-  if (!check_status (_("Mkdir"), wdata, wdata->request->use_threads, 0, 0, 
-                     wdata->request->mkdir != NULL))
-    return;
-
-  MakeEditDialog (_("Make Directory"), _("Enter name of directory to create"),
-		  NULL, 1, 1, NULL, _("Create"), domkdir, wdata, 
-                  _("  Cancel  "), NULL, NULL);
-}
-
-
-static void
-domkdir (GtkWidget * widget, gftp_dialog_data * data)
+static RETSIGTYPE
+sig_mkdirquit (int signo)
 {
-  gftp_window_data * wdata;
-
-  wdata = data->data;
-  edttext = gtk_entry_get_text (GTK_ENTRY (data->edit));
-  if (*edttext == '\0')
-    {
-      ftp_log (gftp_logging_misc, NULL,
-	       _("Mkdir: Operation canceled...you must enter a string\n"));
-      return;
-    }
-
-  if (check_reconnect (wdata) < 0)
-    return;
-
-  if ((int) generic_thread (do_make_dir_thread, wdata))
-    {
-      gftp_delete_cache_entry (wdata->request);
-      refresh (wdata);
-    }
+  signal (signo, sig_mkdirquit);
+  siglongjmp (mkdirenvir, signo == SIGINT ? 1 : 2);
 }
 
 
-
 static void *
 do_make_dir_thread (void * data)
 {
@@ -115,10 +77,40 @@
 }
 
 
-static RETSIGTYPE
-sig_mkdirquit (int signo)
+static void
+domkdir (gftp_window_data * wdata, gftp_dialog_data * ddata)
 {
-  signal (signo, sig_mkdirquit);
-  siglongjmp (mkdirenvir, signo == SIGINT ? 1 : 2);
+  edttext = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
+  if (*edttext == '\0')
+    {
+      ftp_log (gftp_logging_misc, NULL,
+	       _("Mkdir: Operation canceled...you must enter a string\n"));
+      return;
+    }
+
+  if (check_reconnect (wdata) < 0)
+    return;
+
+  if ((int) generic_thread (do_make_dir_thread, wdata))
+    {
+      gftp_delete_cache_entry (wdata->request);
+      refresh (wdata);
+    }
 }
 
+
+void
+mkdir_dialog (gpointer data)
+{
+  gftp_window_data * wdata;
+
+  wdata = data;
+  if (!check_status (_("Mkdir"), wdata, wdata->request->use_threads, 0, 0, 
+                     wdata->request->mkdir != NULL))
+    return;
+
+  MakeEditDialog (_("Make Directory"), _("Enter name of directory to create"),
+		  NULL, 1, NULL, gftp_dialog_button_create, domkdir, wdata, 
+                  NULL, NULL);
+}
+