diff src/gtk/transfer.c @ 341:eedc2c5727fa

2003-12-28 Brian Masney <masneyb@gftp.org> **** NOTE: this commit breaks a lot of functionality in gftp. I **** **** still have more work to do on this. Please don't email me **** **** saying that the CVS code is broken. **** * lib/bookmark.c lib/gftp.h lib/local.c lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - moved the use_threads option from the request structure over to the protocol declaration in options.h. * lib/options.h src/gtk/gftp-gtk.c - added cmd_in_gui option. When this option is enabled, a new toolbar will be shown in the GTK+ port that will allow you to control the GUI by entering manual commands. * src/Makefile.am - added uicommon directory * src/gtk/Makefile.am src/text/Makefile.am - link in the uicommon library. * src/uicommon/* src/text/gftp-text.c - moved most of the functionality of the text port over to the uicommon directory. Made this code a little more generic so that the GTK+ port can have a text interface associated with it. * src/gtk/gtkui.c src/gtk/gftp-gtk.c src/gtk/mkdir_dialog.c src/gtk/rename_dialog.c src/gtk/menu-items.c src/gtk/misc-gtk.c - started to clean up the callback functions and make them more tightly integrated with the uicommon code. * src/gtk/bookmarks.c src/gtk/chmod_dialog.c src/gtk/delete_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/transfer.c - s/refresh/gftpui_refresh/g s/jmp_environment/gftpui_common_jmp_environment/g s/request->use_threads/gftpui_common_use_threads (request)/g * src/gtk/options_dialog.c (apply_changes) - whenever the options are saved, check to see if the command entry needs to be shown or hidden.
author masneyb
date Sun, 28 Dec 2003 16:02:07 +0000
parents cdabbe5c9a95
children 60d3da6ab336
line wrap: on
line diff
--- a/src/gtk/transfer.c	Sat Dec 20 22:00:04 2003 +0000
+++ b/src/gtk/transfer.c	Sun Dec 28 16:02:07 2003 +0000
@@ -79,10 +79,10 @@
 
   request = data;
   
-  if (request->use_threads)
+  if (gftpui_common_use_threads (request))
     {
-      sj = sigsetjmp (jmp_environment, 1);
-      use_jmp_environment = 1;
+      sj = sigsetjmp (gftpui_common_jmp_environment, 1);
+      gftpui_common_use_jmp_environment = 1;
     }
   else
     sj = 0;
@@ -92,8 +92,8 @@
     {
       if (gftp_list_files (request) != 0 || !GFTP_IS_CONNECTED (request))
         {
-          if (request->use_threads)
-            use_jmp_environment = 0;
+          if (gftpui_common_use_threads (request))
+            gftpui_common_use_jmp_environment = 0;
 
           request->stopable = 0;
           if (request->wakeup_main_thread[1] > 0)
@@ -129,8 +129,8 @@
 
       if (!GFTP_IS_CONNECTED (request))
         {
-          if (request->use_threads)
-            use_jmp_environment = 0;
+          if (gftpui_common_use_threads (request))
+            gftpui_common_use_jmp_environment = 0;
 
           request->stopable = 0;
           if (request->wakeup_main_thread[1] > 0)
@@ -154,8 +154,8 @@
         }
     }
 
-  if (request->use_threads)
-    use_jmp_environment = 0;
+  if (gftpui_common_use_threads (request))
+    gftpui_common_use_jmp_environment = 0;
 
   request->stopable = 0;
   if (request->wakeup_main_thread[1] > 0)
@@ -180,7 +180,7 @@
 
       gtk_clist_freeze (GTK_CLIST (wdata->listbox));
       wdata->request->stopable = 1;
-      if (wdata->request->use_threads)
+      if (gftpui_common_use_threads (wdata->request))
         {
           gtk_widget_set_sensitive (stop_btn, 1);
 
@@ -251,10 +251,10 @@
   gftp_lookup_request_option (request, "network_timeout", &network_timeout);
 
   conn_num = 0;
-  if (request->use_threads)
+  if (gftpui_common_use_threads (request))
     {
-      sj = sigsetjmp (jmp_environment, 1);
-      use_jmp_environment = 1;
+      sj = sigsetjmp (gftpui_common_jmp_environment, 1);
+      gftpui_common_use_jmp_environment = 1;
     }
   else
     sj = 0;
@@ -294,8 +294,8 @@
         }  
     }
 
-  if (request->use_threads)
-    use_jmp_environment = 0;
+  if (gftpui_common_use_threads (request))
+    gftpui_common_use_jmp_environment = 0;
 
   request->stopable = 0;
   if (request->wakeup_main_thread[1] > 0)
@@ -347,7 +347,7 @@
         gftp_set_password (request, "");
     }
 
-  if (wdata && wdata->request == request && request->use_threads)
+  if (wdata && wdata->request == request && gftpui_common_use_threads (request))
     {
       request->stopable = 1;
       if (wdata)       
@@ -455,8 +455,8 @@
       gftp_swap_socks (transfer->fromreq, fromwdata->request);
       gftp_swap_socks (transfer->toreq, towdata->request);
 
-      if (transfer->fromreq->use_threads || 
-          (transfer->toreq && transfer->toreq->use_threads))
+      if (gftpui_common_use_threads (transfer->fromreq) || 
+          (transfer->toreq && gftpui_common_use_threads (transfer->toreq)))
         {
           transfer->fromreq->stopable = 1;
           pthread_create (&fromwdata->tid, NULL, do_getdir_thread, transfer);
@@ -517,11 +517,11 @@
 
   transfer = data;
 
-  if (transfer->fromreq->use_threads || 
-      (transfer->toreq && transfer->toreq->use_threads))
+  if (gftpui_common_use_threads (transfer->fromreq) || 
+      (transfer->toreq && gftpui_common_use_threads (transfer->toreq)))
     {
-      sj = sigsetjmp (jmp_environment, 1);
-      use_jmp_environment = 1;
+      sj = sigsetjmp (gftpui_common_jmp_environment, 1);
+      gftpui_common_use_jmp_environment = 1;
     }
   else
     sj = 0;
@@ -539,9 +539,9 @@
                                            _("Operation canceled\n"));
     }
 
-  if (transfer->fromreq->use_threads || 
-      (transfer->toreq && transfer->toreq->use_threads))
-    use_jmp_environment = 0;
+  if (gftpui_common_use_threads (transfer->fromreq) || 
+      (transfer->toreq && gftpui_common_use_threads (transfer->toreq)))
+    gftpui_common_use_jmp_environment = 0;
 
   transfer->fromreq->stopable = 0;
   return (GINT_TO_POINTER (success));
@@ -1098,7 +1098,7 @@
   if (refresh_files && tdata->curfle && tdata->curfle->next &&
       compare_request (tdata->toreq, 
                        ((gftp_window_data *) tdata->towdata)->request, 1))
-    refresh (tdata->towdata);
+    gftpui_refresh (tdata->towdata);
 }
 
 
@@ -1253,7 +1253,7 @@
 
       if (tdata->towdata != NULL && compare_request (tdata->toreq,
                            ((gftp_window_data *) tdata->towdata)->request, 1))
-        refresh (tdata->towdata);
+        gftpui_refresh (tdata->towdata);
 
       num_transfers_in_progress--;
     }