Mercurial > gftp.yaz
comparison src/gtk/transfer.c @ 31:d930e06af9ae
2002-10-03 Brian Masney <masneyb@gftp.org>
* src/gtk/gftp-gtk.c - call g_thread_init (NULL)
* src/gtk/delete_dialog.c, src/gtk/misc-gtk.c, src/gtk/transfer.c -
call gdk_threads_enter() and gdk_threads_leave()
author | masneyb |
---|---|
date | Thu, 03 Oct 2002 12:05:54 +0000 |
parents | 3b2dcdefc7e9 |
children | c8ec7877432e |
comparison
equal
deleted
inserted
replaced
30:dfd68d1d3d13 | 31:d930e06af9ae |
---|---|
84 gtk_widget_set_sensitive (stop_btn, 1); | 84 gtk_widget_set_sensitive (stop_btn, 1); |
85 | 85 |
86 handler = setup_wakeup_main_thread (wdata->request); | 86 handler = setup_wakeup_main_thread (wdata->request); |
87 pthread_create (&wdata->tid, NULL, getdir_thread, wdata->request); | 87 pthread_create (&wdata->tid, NULL, getdir_thread, wdata->request); |
88 while (wdata->request->stopable) | 88 while (wdata->request->stopable) |
89 g_main_iteration (TRUE); | 89 { |
90 gdk_threads_leave (); | |
91 g_main_iteration (TRUE); | |
92 gdk_threads_enter (); | |
93 } | |
90 teardown_wakeup_main_thread (wdata->request, handler); | 94 teardown_wakeup_main_thread (wdata->request, handler); |
91 | 95 |
92 pthread_join (wdata->tid, &success); | 96 pthread_join (wdata->tid, &success); |
93 gtk_widget_set_sensitive (stop_btn, 0); | 97 gtk_widget_set_sensitive (stop_btn, 0); |
94 } | 98 } |
251 MakeEditDialog (_("Enter Password"), | 255 MakeEditDialog (_("Enter Password"), |
252 _("Please enter your password for this site"), NULL, | 256 _("Please enter your password for this site"), NULL, |
253 0, NULL, gftp_dialog_button_connect, | 257 0, NULL, gftp_dialog_button_connect, |
254 try_connect_again, request, | 258 try_connect_again, request, |
255 dont_connect_again, request); | 259 dont_connect_again, request); |
260 | |
256 while (request->stopable) | 261 while (request->stopable) |
257 g_main_iteration (TRUE); | 262 { |
263 gdk_threads_leave (); | |
264 g_main_iteration (TRUE); | |
265 gdk_threads_enter (); | |
266 } | |
258 | 267 |
259 if (GFTP_GET_PASSWORD (request) == NULL || | 268 if (GFTP_GET_PASSWORD (request) == NULL || |
260 *GFTP_GET_PASSWORD (request) == '\0') | 269 *GFTP_GET_PASSWORD (request) == '\0') |
261 return (0); | 270 return (0); |
262 } | 271 } |
272 gtk_widget_set_sensitive (stop_btn, 1); | 281 gtk_widget_set_sensitive (stop_btn, 1); |
273 pthread_create (&wdata->tid, NULL, connect_thread, request); | 282 pthread_create (&wdata->tid, NULL, connect_thread, request); |
274 | 283 |
275 handler = setup_wakeup_main_thread (wdata->request); | 284 handler = setup_wakeup_main_thread (wdata->request); |
276 while (request->stopable) | 285 while (request->stopable) |
277 g_main_iteration (TRUE); | 286 { |
287 gdk_threads_leave (); | |
288 g_main_iteration (TRUE); | |
289 gdk_threads_enter (); | |
290 } | |
278 pthread_join (wdata->tid, &ret); | 291 pthread_join (wdata->tid, &ret); |
279 teardown_wakeup_main_thread (wdata->request, handler); | 292 teardown_wakeup_main_thread (wdata->request, handler); |
280 | 293 |
281 gtk_widget_set_sensitive (stop_btn, 0); | 294 gtk_widget_set_sensitive (stop_btn, 0); |
282 if (wdata) | 295 if (wdata) |
434 pthread_create (&fromwdata->tid, NULL, do_getdir_thread, transfer); | 447 pthread_create (&fromwdata->tid, NULL, do_getdir_thread, transfer); |
435 | 448 |
436 timeout_num = gtk_timeout_add (100, progress_timeout, transfer); | 449 timeout_num = gtk_timeout_add (100, progress_timeout, transfer); |
437 | 450 |
438 while (transfer->fromreq->stopable) | 451 while (transfer->fromreq->stopable) |
439 g_main_iteration (TRUE); | 452 { |
453 gdk_threads_leave (); | |
454 g_main_iteration (TRUE); | |
455 gdk_threads_enter (); | |
456 } | |
440 | 457 |
441 gtk_timeout_remove (timeout_num); | 458 gtk_timeout_remove (timeout_num); |
442 transfer->numfiles = transfer->numdirs = -1; | 459 transfer->numfiles = transfer->numdirs = -1; |
443 update_directory_download_progress (transfer); | 460 update_directory_download_progress (transfer); |
444 | 461 |