comparison src/gtk/menu-items.c @ 129:fe0b21c006f6

2003-4-13 Brian Masney <masneyb@gftp.org> * lib/config_file.c - implemented gftp_set_global_option() * lib/gftp.h lib/misc.c - added gftp_tdata_new() * src/text/gftp-text.c src/gtk/transfer.c - use gftp_tdata_new() * src/gtk/bookmarks.c - In run_bookmark(), use gftp_parse_bookmark() function. Renamed all instances of gftp_bookmarks to gftp_bookmarks_var * src/gtk/gftp-gtk.[ch] - added global variables viewedit_processes and viewedit_processes_done. These used to be declared in lib/options.h * src/gtk/gftp-gtk.h (struct gftp_window_data) - removed sortcol and sortasds variables. Added prefix_col_str variable. This will either be local or remote * src/gtk/misc-gtk.c - removed r_gethostbyname() and r_getservbyname() * src/gtk/transfer.c - removed gftp_gtk_calc_kbs(), get_status() and parse_attribs(). These are in the lib/ directory now. Also, use g_static_mutex_*() functions from glib instead of pthread_mutex_*() * src/gtk/bookmark.c src/gtk/dnd.c src/gtk/menu-items.c src/gtk/transfer.c - use g_strdup() instead of g_malloc()/strcpy() * src/gtk/options_dialog.c - commented out large parts of this file. This file is busted at the moment * src/gtk/*.[ch] - Use new configuration interface in all source files. Updated copyright dates on all source files
author masneyb
date Sun, 13 Apr 2003 15:21:13 +0000
parents a12bcbc2fce4
children c77f85763e28
comparison
equal deleted inserted replaced
128:7616ab674d4e 129:fe0b21c006f6
24 change_setting (gftp_window_data * wdata, int menuitem, GtkWidget * checkmenu) 24 change_setting (gftp_window_data * wdata, int menuitem, GtkWidget * checkmenu)
25 { 25 {
26 switch (menuitem) 26 switch (menuitem)
27 { 27 {
28 case 1: 28 case 1:
29 if (wdata->request != NULL) 29 if (window1.request != NULL)
30 gftp_set_data_type (wdata->request, GFTP_TYPE_ASCII); 30 gftp_set_request_option (window1.request, "ascii_transfers", GINT_TO_POINTER(1));
31
32 if (window2.request != NULL)
33 gftp_set_request_option (window2.request, "ascii_transfers", GINT_TO_POINTER(1));
31 break; 34 break;
32 case 2: 35 case 2:
33 if (wdata->request != NULL) 36 if (window1.request != NULL)
34 gftp_set_data_type (wdata->request, GFTP_TYPE_BINARY); 37 gftp_set_request_option (window1.request, "ascii_transfers", GINT_TO_POINTER(0));
38
39 if (window2.request != NULL)
40 gftp_set_request_option (window2.request, "ascii_transfers", GINT_TO_POINTER(0));
35 break; 41 break;
36 case 3: 42 case 3:
37 current_wdata = &window1; 43 current_wdata = &window1;
38 other_wdata = &window2; 44 other_wdata = &window2;
39 if (wdata->request) 45 if (wdata->request)
156 _("Change Filespec: Operation canceled...you must enter a string\n")); 162 _("Change Filespec: Operation canceled...you must enter a string\n"));
157 return; 163 return;
158 } 164 }
159 if (wdata->filespec) 165 if (wdata->filespec)
160 g_free (wdata->filespec); 166 g_free (wdata->filespec);
161 wdata->filespec = g_malloc (strlen (edttext) + 1); 167 wdata->filespec = g_strdup (edttext);
162 strcpy (wdata->filespec, edttext);
163 168
164 filelist = wdata->files; 169 filelist = wdata->files;
165 templist = GTK_CLIST (wdata->listbox)->selection; 170 templist = GTK_CLIST (wdata->listbox)->selection;
166 num = 0; 171 num = 0;
167 while (templist != NULL) 172 while (templist != NULL)
419 424
420 425
421 static void * 426 static void *
422 do_change_dir_thread (void * data) 427 do_change_dir_thread (void * data)
423 { 428 {
429 int success, sj, network_timeout;
424 gftp_window_data * wdata; 430 gftp_window_data * wdata;
425 int success, sj;
426 431
427 wdata = data; 432 wdata = data;
428 433
429 if (wdata->request->use_threads) 434 if (wdata->request->use_threads)
430 { 435 {
432 use_jmp_environment = 1; 437 use_jmp_environment = 1;
433 } 438 }
434 else 439 else
435 sj = 0; 440 sj = 0;
436 441
442 gftp_lookup_request_option (wdata->request, "network_timeout",
443 &network_timeout);
444
437 success = 0; 445 success = 0;
438 if (sj == 0) 446 if (sj == 0)
439 { 447 {
440 if (wdata->request->network_timeout > 0) 448 if (network_timeout > 0)
441 alarm (wdata->request->network_timeout); 449 alarm (network_timeout);
442 success = gftp_set_directory (wdata->request, wdata->request->directory); 450 success = gftp_set_directory (wdata->request, wdata->request->directory);
443 alarm (0); 451 alarm (0);
444 } 452 }
445 else 453 else
446 { 454 {
465 int ret; 473 int ret;
466 474
467 if (directory != wdata->request->directory) 475 if (directory != wdata->request->directory)
468 { 476 {
469 olddir = wdata->request->directory; 477 olddir = wdata->request->directory;
470 wdata->request->directory = g_malloc (strlen (directory) + 1); 478 wdata->request->directory = g_strdup (directory);
471 strcpy (wdata->request->directory, directory);
472 } 479 }
473 else 480 else
474 olddir = NULL; 481 olddir = NULL;
475 482
476 ret = (int) generic_thread (do_change_dir_thread, wdata); 483 ret = (int) generic_thread (do_change_dir_thread, wdata);
552 templist = GTK_CLIST (wdata->listbox)->selection; 559 templist = GTK_CLIST (wdata->listbox)->selection;
553 num = 0; 560 num = 0;
554 templist = get_next_selection (templist, &filelist, &num); 561 templist = get_next_selection (templist, &filelist, &num);
555 tempfle = filelist->data; 562 tempfle = filelist->data;
556 563
557 newdir = g_strconcat (GFTP_GET_DIRECTORY (wdata->request), "/", 564 newdir = g_strconcat (wdata->request->directory, "/", tempfle->file, NULL);
558 tempfle->file, NULL);
559 remove_double_slashes (newdir); 565 remove_double_slashes (newdir);
560 if ((tempstr = expand_path (newdir)) == NULL) 566 if ((tempstr = expand_path (newdir)) == NULL)
561 return (0); 567 return (0);
562 g_free (newdir); 568 g_free (newdir);
563 569
790 796
791 tempwid = toolbar_pixmap (dialog, "gftp-logo.xpm"); 797 tempwid = toolbar_pixmap (dialog, "gftp-logo.xpm");
792 gtk_box_pack_start (GTK_BOX (box), tempwid, FALSE, FALSE, 0); 798 gtk_box_pack_start (GTK_BOX (box), tempwid, FALSE, FALSE, 0);
793 gtk_widget_show (tempwid); 799 gtk_widget_show (tempwid);
794 800
795 tempstr = g_strdup_printf (_("%s\nCopyright (C) 1998-2002 Brian Masney <masneyb@gftp.org>\nOfficial Homepage: http://www.gftp.org/\nLogo by: Aaron Worley <planet_hoth@yahoo.com>\n"), 801 tempstr = g_strdup_printf (_("%s\nCopyright (C) 1998-2002 Brian Masney <masneyb@gftp.org>\nOfficial Homepage: http://www.gftp.org/\nLogo by: Aaron Worley <planet_hoth@yahoo.com>\n"), gftp_version);
796 version);
797 str = _("Translated by"); 802 str = _("Translated by");
798 if (strcmp (str, "Translated by") != 0) 803 if (strcmp (str, "Translated by") != 0)
799 { 804 {
800 tempstr = g_realloc (tempstr, strlen (tempstr) + strlen (str) + 1); 805 tempstr = g_realloc (tempstr, strlen (tempstr) + strlen (str) + 1);
801 strcat (tempstr, str); 806 strcat (tempstr, str);