Mercurial > gftp.yaz
changeset 37:5a178bd04ca5
2002-10-13 Brian Masney <masneyb@gftp.org>
* lib/gftp.h (struct gftp_config_vars_tag) - remove shown flag and
added ports_shown flag. Added GFTP_PORTS_TEXT, GFTP_PORTS_GTK,
and GFTP_PORTS_ALL flags
* lib/config_file.c - update to use new fields.
* lib/config_file.c, lib/options.h, lib/gftp.h - added new global
options: local_sortcol, local_sortasds, remote_sortcol, remote_sortasds
* src/gtk/gftp-gtk.c - sort based on parameters above. Also, if a url
was given on the command line, don't connect to it until the local side
has been setup
* src/gtk/options_dialog.c - only show variables that have GFTP_PORT_GTK
set
* src/text/gftp-text.c - add help screen for set command. Added command
clear cache. Sort the filelist based on the configuration options.
* configure.in - update to version 2.0.14
* cvsclean - clean up the Makefile.am file better
author | masneyb |
---|---|
date | Mon, 14 Oct 2002 02:46:14 +0000 |
parents | bc9473ba9a90 |
children | 0bd328793122 |
files | ChangeLog configure.in cvsclean lib/config_file.c lib/gftp.h lib/options.h src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/options_dialog.c src/gtk/transfer.c src/text/gftp-text.c src/text/gftp-text.h |
diffstat | 12 files changed, 391 insertions(+), 221 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Oct 08 02:19:46 2002 +0000 +++ b/ChangeLog Mon Oct 14 02:46:14 2002 +0000 @@ -1,3 +1,27 @@ +2002-10-13 Brian Masney <masneyb@gftp.org> + * lib/gftp.h (struct gftp_config_vars_tag) - remove shown flag and + added ports_shown flag. Added GFTP_PORTS_TEXT, GFTP_PORTS_GTK, + and GFTP_PORTS_ALL flags + + * lib/config_file.c - update to use new fields. + + * lib/config_file.c, lib/options.h, lib/gftp.h - added new global + options: local_sortcol, local_sortasds, remote_sortcol, remote_sortasds + + * src/gtk/gftp-gtk.c - sort based on parameters above. Also, if a url + was given on the command line, don't connect to it until the local side + has been setup + + * src/gtk/options_dialog.c - only show variables that have GFTP_PORT_GTK + set + + * src/text/gftp-text.c - add help screen for set command. Added command + clear cache. Sort the filelist based on the configuration options. + + * configure.in - update to version 2.0.14 + + * cvsclean - clean up the Makefile.am file better + 2002-10-07 Brian Masney <masneyb@gftp.org> * lib/local.c - fixed file uploads @@ -28,7 +52,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.16 2002/10/08 02:19:45 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.17 2002/10/14 02:46:12 masneyb Exp $ tags * debian/* - updated files from Debian maintainer
--- a/configure.in Tue Oct 08 02:19:46 2002 +0000 +++ b/configure.in Mon Oct 14 02:46:14 2002 +0000 @@ -3,7 +3,7 @@ AC_INIT(lib/gftp.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(gftp,2.0.13) +AM_INIT_AUTOMAKE(gftp,2.0.14) AC_ARG_ENABLE(gtk20, [ --enable-gtk20 Try and compile with GTK+ 2.0 if available], enable_gtk20=1, enable_gtk20=0) AC_ARG_ENABLE(gtkport, [ --disable-gtkport Disable compiling the GTK+ port], enable_gtkport=0, enable_gtkport=1)
--- a/cvsclean Tue Oct 08 02:19:46 2002 +0000 +++ b/cvsclean Mon Oct 14 02:46:14 2002 +0000 @@ -10,5 +10,6 @@ cat configure.in | sed s/\ intl\\/Makefile\ //g | sed s/po\\/Makefile.in\ //g > configure.in.new mv configure.in.new configure.in -cat Makefile.am | sed s/\ intl\ //g | sed s/\ config\.rpath//g | sed s/mkinstalldirs//g > Makefile.am.new + +cat Makefile.am | sed s/\ intl\ //g | sed s/\ config\.rpath\ //g | sed s/mkinstalldirs\ // > Makefile.am.new mv Makefile.am.new Makefile.am
--- a/lib/config_file.c Tue Oct 08 02:19:46 2002 +0000 +++ b/lib/config_file.c Mon Oct 14 02:46:14 2002 +0000 @@ -30,174 +30,174 @@ gftp_config_vars config_file_vars[] = { - {"", N_("General"), (void *) 0x1, CONFIG_NOTEBOOK, 1, ""}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"email", N_("Email address:"), &emailaddr, CONFIG_CHARTEXT, 1, - N_("Enter your email address here")}, - {"view_program", N_("View program:"), &view_program, CONFIG_CHARTEXT, 1, - N_("The default program used to view files. If this is blank, the internal file viewer will be used")}, - {"edit_program", N_("Edit program:"), &edit_program, CONFIG_CHARTEXT, 1, - N_("The default program used to edit files.")}, - {"startup_directory", N_("Startup Directory:"), &startup_directory, - CONFIG_CHARTEXT, 1, - N_("The default directory gFTP will go to on startup")}, + {"", N_("General"), (void *) 0x1, CONFIG_NOTEBOOK, "", NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"email", N_("Email address:"), &emailaddr, CONFIG_CHARTEXT, + N_("Enter your email address here"), NULL, GFTP_PORT_ALL}, + {"view_program", N_("View program:"), &view_program, CONFIG_CHARTEXT, + N_("The default program used to view files. If this is blank, the internal file viewer will be used"), NULL, GFTP_PORT_ALL}, + {"edit_program", N_("Edit program:"), &edit_program, CONFIG_CHARTEXT, + N_("The default program used to edit files."), NULL, GFTP_PORT_GTK}, + {"startup_directory", N_("Startup Directory:"), &startup_directory, CONFIG_CHARTEXT, + N_("The default directory gFTP will go to on startup"), NULL, GFTP_PORT_ALL}, {"max_log_window_size", N_("Max Log Window Size:"), &max_log_window_size, CONFIG_UINTTEXT, - 1, N_("The maximum size of the log window in bytes for the GTK+ port")}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, + N_("The maximum size of the log window in bytes for the GTK+ port"), NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, {"append_transfers", N_("Append file transfers"), &append_file_transfers, - CONFIG_CHECKBOX, 1, - N_("Append new file transfers onto existing ones")}, - {"one_transfer", N_("Do one transfer at a time"), &do_one_transfer_at_a_time, CONFIG_CHECKBOX, 1, N_("Do only one transfer at a time?")}, - {"overwrite_default", N_("Overwrite by Default"), &overwrite_by_default, - CONFIG_CHECKBOX, 1, - N_("Overwrite files by default or set to resume file transfers")}, - {"refresh_files", N_("Refresh after each file transfer"), &refresh_files, - CONFIG_CHECKBOX, 1, - N_("Refresh the listbox after each file is transfered")}, - {"sort_dirs_first", N_("Sort directories first"), &sort_dirs_first, - CONFIG_CHECKBOX, 1, N_("Put the directories first then the files")}, - {"start_transfers", N_("Start file transfers"), &start_file_transfers, - CONFIG_CHECKBOX, 1, - N_("Automatically start the file transfers when they get queued?")}, - {"show_hidden_files", N_("Show hidden files"), &show_hidden_files, - CONFIG_CHECKBOX, 1, N_("Show hidden files in the listboxes")}, + CONFIG_CHECKBOX, + N_("Append new file transfers onto existing ones"), NULL, GFTP_PORT_GTK}, + {"one_transfer", N_("Do one transfer at a time"), &do_one_transfer_at_a_time, CONFIG_CHECKBOX, + N_("Do only one transfer at a time?"), NULL, GFTP_PORT_GTK}, + {"overwrite_default", N_("Overwrite by Default"), &overwrite_by_default, CONFIG_CHECKBOX, + N_("Overwrite files by default or set to resume file transfers"), NULL, GFTP_PORT_GTK}, + {"refresh_files", N_("Refresh after each file transfer"), &refresh_files, CONFIG_CHECKBOX, + N_("Refresh the listbox after each file is transfered"), NULL, GFTP_PORT_GTK}, + {"sort_dirs_first", N_("Sort directories first"), &sort_dirs_first, CONFIG_CHECKBOX, + N_("Put the directories first then the files"), NULL, GFTP_PORT_ALL}, + {"start_transfers", N_("Start file transfers"), &start_file_transfers, CONFIG_CHECKBOX, + N_("Automatically start the file transfers when they get queued?"), NULL, GFTP_PORT_GTK}, + {"show_hidden_files", N_("Show hidden files"), &show_hidden_files, CONFIG_CHECKBOX, + N_("Show hidden files in the listboxes"), NULL, GFTP_PORT_ALL}, - {"", N_("Network"), (void *) 0x1, CONFIG_NOTEBOOK, 1, ""}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, + {"", N_("Network"), (void *) 0x1, CONFIG_NOTEBOOK, "", NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, {"network_timeout", N_("Network timeout:"), &network_timeout, CONFIG_INTTEXT, - 1, N_("The timeout waiting for network input/output. This is NOT an idle timeout.")}, - {"retries", N_("Connect retries:"), &retries, CONFIG_INTTEXT, 1, - N_("The number of auto-retries to do. Set this to 0 to retry indefinately")}, - {"sleep_time", N_("Retry sleep time:"), &sleep_time, CONFIG_INTTEXT, 1, - N_("The number of seconds to wait between retries")}, - {"maxkbs", N_("Max KB/S:"), &maxkbs, CONFIG_FLOATTEXT, 1, - N_("The maximum KB/s a file transfer can get. (Set to 0 to disable)")}, - {"", N_("Default Protocol"), (void *) 0x1, CONFIG_COMBO, 1, "DP"}, + N_("The timeout waiting for network input/output. This is NOT an idle timeout."), NULL, GFTP_PORT_ALL}, + {"retries", N_("Connect retries:"), &retries, CONFIG_INTTEXT, + N_("The number of auto-retries to do. Set this to 0 to retry indefinately"), NULL, GFTP_PORT_ALL}, + {"sleep_time", N_("Retry sleep time:"), &sleep_time, CONFIG_INTTEXT, + N_("The number of seconds to wait between retries"), NULL, GFTP_PORT_ALL}, + {"maxkbs", N_("Max KB/S:"), &maxkbs, CONFIG_FLOATTEXT, + N_("The maximum KB/s a file transfer can get. (Set to 0 to disable)"), NULL, GFTP_PORT_ALL}, + {"", N_("Default Protocol"), (void *) 0x1, CONFIG_COMBO, "DP", NULL, GFTP_PORT_GTK}, {"default_protocol", N_("Default Protocol"), &default_protocol, - CONFIG_CHARTEXT, 0, N_("This specifies the default protocol to use")}, - - {"", N_("FTP"), (void *) 0x1, CONFIG_NOTEBOOK, 1, ""}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"firewall_host", N_("Proxy hostname:"), &firewall_host, CONFIG_CHARTEXT, 1, - N_("Firewall hostname")}, - {"firewall_port", N_("Proxy port:"), &firewall_port, CONFIG_INTTEXT, 1, - N_("Port to connect to on the firewall")}, - {"firewall_username", N_("Proxy username:"), &firewall_username, - CONFIG_CHARTEXT, 1, N_("Your firewall username")}, - {"firewall_password", N_("Proxy password:"), &firewall_password, - CONFIG_CHARPASS, 1, N_("Your firewall password")}, - {"firewall_account", N_("Proxy account:"), &firewall_account, CONFIG_CHARTEXT, 1, N_("Your firewall account (optional)")}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, + CONFIG_CHARTEXT, N_("This specifies the default protocol to use"), NULL, 0}, - {"passive_transfer", N_("Passive file transfers"), &passive_transfer, - CONFIG_CHECKBOX, 1, - N_("Send PASV command or PORT command for data transfers")}, - {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), &resolve_symlinks, - CONFIG_CHECKBOX, 1, - N_("If you disable this feature, then gFTP will only send LIST to the remote server instead of LIST -L")}, + {"", N_("FTP"), (void *) 0x1, CONFIG_NOTEBOOK, "", NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"firewall_host", N_("Proxy hostname:"), &firewall_host, CONFIG_CHARTEXT, + N_("Firewall hostname"), NULL, GFTP_PORT_ALL}, + {"firewall_port", N_("Proxy port:"), &firewall_port, CONFIG_INTTEXT, + N_("Port to connect to on the firewall"), NULL, GFTP_PORT_ALL}, + {"firewall_username", N_("Proxy username:"), &firewall_username, + CONFIG_CHARTEXT, N_("Your firewall username"), NULL, GFTP_PORT_ALL}, + {"firewall_password", N_("Proxy password:"), &firewall_password, + CONFIG_CHARPASS, N_("Your firewall password"), NULL, GFTP_PORT_ALL}, + {"firewall_account", N_("Proxy account:"), &firewall_account, CONFIG_CHARTEXT, + N_("Your firewall account (optional)"), NULL, GFTP_PORT_ALL}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"", N_("Proxy server type"), (void *) 0x1, CONFIG_COMBO, 1, "PS"}, - {"proxy_config", N_("Proxy config"), &proxy_config, CONFIG_TEXT, 1, - N_("This specifies how your proxy server expects us to log in")}, - {"", N_("%pu = proxy user"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%hu = host user"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%pp = proxy pass"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%hp = host pass"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%ph = proxy host"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%hh = host"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%po = proxy port"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%ho = host port"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%pa = proxy account"), (void *) 0x1, CONFIG_LABEL, 1, ""}, - {"", N_("%ha = host account"), (void *) 0x1, CONFIG_LABEL, 1, ""}, + {"passive_transfer", N_("Passive file transfers"), &passive_transfer, CONFIG_CHECKBOX, + N_("Send PASV command or PORT command for data transfers"), NULL, GFTP_PORT_ALL}, + {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), &resolve_symlinks, CONFIG_CHECKBOX, + N_("If you disable this feature, then gFTP will only send LIST to the remote server instead of LIST -L"), NULL, GFTP_PORT_ALL}, - {"", N_("HTTP"), (void *) 0x1, CONFIG_NOTEBOOK, 1, ""}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"", N_("Proxy server type"), (void *) 0x1, CONFIG_COMBO, "PS", NULL, 0}, + {"proxy_config", N_("Proxy config"), &proxy_config, CONFIG_TEXT, + N_("This specifies how your proxy server expects us to log in"), NULL, GFTP_PORT_GTK}, + {"", N_("%pu = proxy user"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%hu = host user"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%pp = proxy pass"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%hp = host pass"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%ph = proxy host"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%hh = host"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%po = proxy port"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%ho = host port"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%pa = proxy account"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + {"", N_("%ha = host account"), (void *) 0x1, CONFIG_LABEL, "", NULL, 0}, + + {"", N_("HTTP"), (void *) 0x1, CONFIG_NOTEBOOK, "", NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, {"http_proxy_host", N_("Proxy hostname:"), &http_proxy_host, CONFIG_CHARTEXT, - 1, N_("Firewall hostname")}, - {"http_proxy_port", N_("Proxy port:"), &http_proxy_port, CONFIG_INTTEXT, 1, - N_("Port to connect to on the firewall")}, + N_("Firewall hostname"), NULL, GFTP_PORT_ALL}, + {"http_proxy_port", N_("Proxy port:"), &http_proxy_port, CONFIG_INTTEXT, + N_("Port to connect to on the firewall"), NULL, GFTP_PORT_ALL}, {"http_proxy_username", N_("Proxy username:"), &http_proxy_username, - CONFIG_CHARTEXT, 1, N_("Your firewall username")}, + CONFIG_CHARTEXT, N_("Your firewall username"), NULL, GFTP_PORT_ALL}, {"http_proxy_password", N_("Proxy password:"), &http_proxy_password, - CONFIG_CHARPASS, 1, N_("Your firewall password")}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"use_http11", N_("Use HTTP/1.1"), &use_http11, CONFIG_CHECKBOX, 1, - N_("Do you want to use HTTP/1.1 or HTTP/1.0")}, + CONFIG_CHARPASS, N_("Your firewall password"), NULL, GFTP_PORT_ALL}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"use_http11", N_("Use HTTP/1.1"), &use_http11, CONFIG_CHECKBOX, + N_("Do you want to use HTTP/1.1 or HTTP/1.0"), NULL, GFTP_PORT_ALL}, - {"", N_("SSH"), (void *) 0x1, CONFIG_NOTEBOOK, 1, ""}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"ssh_prog_name", N_("SSH Prog Name:"), &ssh_prog_name, CONFIG_CHARTEXT, 1, - N_("The path to the SSH executable")}, + {"", N_("SSH"), (void *) 0x1, CONFIG_NOTEBOOK, "", NULL, GFTP_PORT_GTK}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"ssh_prog_name", N_("SSH Prog Name:"), &ssh_prog_name, CONFIG_CHARTEXT, + N_("The path to the SSH executable"), NULL, GFTP_PORT_ALL}, {"ssh_extra_params", N_("SSH Extra Params:"), &ssh_extra_params, - CONFIG_CHARTEXT, 1, N_("Extra parameters to pass to the SSH program")}, + CONFIG_CHARTEXT, N_("Extra parameters to pass to the SSH program"), NULL, GFTP_PORT_ALL}, {"ssh1_sftp_path", N_("SSH sftpserv path:"), &ssh1_sftp_path, - CONFIG_CHARTEXT, 1, N_("Default remote SSH sftpserv path")}, + CONFIG_CHARTEXT, N_("Default remote SSH sftpserv path"), NULL, GFTP_PORT_ALL}, {"ssh2_sftp_path", N_("SSH2 sftp-server path:"), &ssh2_sftp_path, - CONFIG_CHARTEXT, 1, N_("Default remote SSH2 sftp-server path")}, - {"", "", (void *) 0x1, CONFIG_TABLE, 1, ""}, - {"ssh_need_userpass", N_("Need SSH User/Pass"), &ssh_need_userpass, - CONFIG_CHECKBOX, 1, - N_("Require a username/password for SSH connections")}, - {"ssh_use_askpass", N_("Use ssh-askpass util"), &ssh_use_askpass, - CONFIG_CHECKBOX, 1, - N_("Use the ssh-askpass utility to grab the users password")}, - {"sshv2_use_sftp_subsys", N_("Use SSH2 SFTP subsys"), - &sshv2_use_sftp_subsys, CONFIG_CHECKBOX, 1, - N_("Call ssh with the -s sftp flag. This is helpful because you won't have to know the remote path to the remote sftp-server")}, - {"enable_old_ssh", N_("Enable old SSH protocol"), &enable_old_ssh, - CONFIG_CHECKBOX, 0, - N_("Enable the old SSH protocol. You will need to download the sftp server from http:///www.xbill.org/sftp")}, + CONFIG_CHARTEXT, N_("Default remote SSH2 sftp-server path"), NULL, GFTP_PORT_ALL}, + {"", "", (void *) 0x1, CONFIG_TABLE, "", NULL, GFTP_PORT_GTK}, + {"ssh_need_userpass", N_("Need SSH User/Pass"), &ssh_need_userpass, CONFIG_CHECKBOX, + N_("Require a username/password for SSH connections"), NULL, GFTP_PORT_ALL}, + {"ssh_use_askpass", N_("Use ssh-askpass util"), &ssh_use_askpass, CONFIG_CHECKBOX, + N_("Use the ssh-askpass utility to grab the users password"), NULL, GFTP_PORT_GTK}, + {"sshv2_use_sftp_subsys", N_("Use SSH2 SFTP subsys"), &sshv2_use_sftp_subsys, CONFIG_CHECKBOX, + N_("Call ssh with the -s sftp flag. This is helpful because you won't have to know the remote path to the remote sftp-server"), NULL, GFTP_PORT_GTK}, + {"enable_old_ssh", N_("Enable old SSH protocol"), &enable_old_ssh, CONFIG_CHECKBOX, + N_("Enable the old SSH protocol. You will need to download the sftp server from http:///www.xbill.org/sftp"), NULL, GFTP_PORT_ALL}, - {"list_dblclk_action", "", &listbox_dblclick_action, CONFIG_HIDEINT, 0, - N_("This defines what will happen when you double click a file in the file listboxes. 0=View file 1=Edit file 2=Transfer file")}, - {"use_default_dl_types", "", &use_default_dl_types, CONFIG_HIDEINT, 0, - N_("(*) If this is set, and there is a ext= line below for the file extension, it will download the file as specified below")}, - {"listbox_local_width", "", &listbox_local_width, CONFIG_HIDEINT, 0, - N_("The default width of the local files listbox")}, - {"listbox_remote_width", "", &listbox_remote_width, CONFIG_HIDEINT, 0, - N_("The default width of the remote files listbox")}, - {"listbox_file_height", "", &listbox_file_height, CONFIG_HIDEINT, 0, - N_("The default height of the local/remote files listboxes")}, - {"transfer_height", "", &transfer_height, CONFIG_HIDEINT, 0, - N_("The default height of the transfer listbox")}, - {"log_height", "", &log_height, CONFIG_HIDEINT, 0, - N_("The default height of the logging window")}, - {"file_trans_column", "", &file_trans_column, CONFIG_HIDEINT, 0, - N_("The width of the filename column in the transfer window. Set this to 0 to have this column automagically resize.")}, - {"local_file_width", "", &local_columns[0], CONFIG_HIDEINT, 0, - N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"local_size_width", "", &local_columns[1], CONFIG_HIDEINT, 0, - N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"local_user_width", "", &local_columns[2], CONFIG_HIDEINT, 0, - N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"local_group_width", "", &local_columns[3], CONFIG_HIDEINT, 0, - N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"local_date_width", "", &local_columns[4], CONFIG_HIDEINT, 0, - N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"local_attribs_width", "", &local_columns[5], CONFIG_HIDEINT, 0, - N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_file_width", "", &remote_columns[0], CONFIG_HIDEINT, 0, - N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_size_width", "", &remote_columns[1], CONFIG_HIDEINT, 0, - N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_user_width", "", &remote_columns[2], CONFIG_HIDEINT, 0, - N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_group_width", "", &remote_columns[3], CONFIG_HIDEINT, 0, - N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_date_width", "", &remote_columns[4], CONFIG_HIDEINT, 0, - N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"remote_attribs_width", "", &remote_columns[5], CONFIG_HIDEINT, 0, - N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column")}, - {"send_color", "", &send_color, CONFIG_COLOR, 0, - N_("The color of the commands that are sent to the server")}, - {"recv_color", "", &recv_color, CONFIG_COLOR, 0, - N_("The color of the commands that are received from the server")}, - {"error_color", "", &error_color, CONFIG_COLOR, 0, - N_("The color of the error messages")}, - {"misc_color", "", &misc_color, CONFIG_COLOR, 0, - N_("The color of the rest of the log messages")}, - {NULL, NULL, NULL, 0, 0, ""} + {"list_dblclk_action", "", &listbox_dblclick_action, CONFIG_HIDEINT, + N_("This defines what will happen when you double click a file in the file listboxes. 0=View file 1=Edit file 2=Transfer file"), NULL, 0}, + {"use_default_dl_types", "", &use_default_dl_types, CONFIG_HIDEINT, + N_("(*) If this is set, and there is a ext= line below for the file extension, it will download the file as specified below"), NULL, 0}, + {"listbox_local_width", "", &listbox_local_width, CONFIG_HIDEINT, + N_("The default width of the local files listbox"), NULL, 0}, + {"listbox_remote_width", "", &listbox_remote_width, CONFIG_HIDEINT, + N_("The default width of the remote files listbox"), NULL, 0}, + {"listbox_file_height", "", &listbox_file_height, CONFIG_HIDEINT, + N_("The default height of the local/remote files listboxes"), NULL, 0}, + {"transfer_height", "", &transfer_height, CONFIG_HIDEINT, + N_("The default height of the transfer listbox"), NULL, 0}, + {"log_height", "", &log_height, CONFIG_HIDEINT, + N_("The default height of the logging window"), NULL, 0}, + {"file_trans_column", "", &file_trans_column, CONFIG_HIDEINT, + N_("The width of the filename column in the transfer window. Set this to 0 to have this column automagically resize."), NULL, 0}, + {"local_sortcol", "", &local_sortcol, CONFIG_INTTEXT, + N_("The default column to sort by"), NULL, GFTP_PORT_TEXT}, + {"local_sortasds", "", &local_sortasds, CONFIG_INTTEXT, + N_("Sort ascending or descending"), NULL, GFTP_PORT_TEXT}, + {"remote_sortcol", "", &remote_sortcol, CONFIG_INTTEXT, + N_("The default column to sort by"), NULL, GFTP_PORT_TEXT}, + {"remote_sortasds", "", &remote_sortasds, CONFIG_INTTEXT, + N_("Sort ascending or descending"), NULL, GFTP_PORT_TEXT}, + {"local_file_width", "", &local_columns[0], CONFIG_HIDEINT, + N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"local_size_width", "", &local_columns[1], CONFIG_HIDEINT, + N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"local_user_width", "", &local_columns[2], CONFIG_HIDEINT, + N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"local_group_width", "", &local_columns[3], CONFIG_HIDEINT, + N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"local_date_width", "", &local_columns[4], CONFIG_HIDEINT, + N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"local_attribs_width", "", &local_columns[5], CONFIG_HIDEINT, + N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_file_width", "", &remote_columns[0], CONFIG_HIDEINT, + N_("The width of the filename column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_size_width", "", &remote_columns[1], CONFIG_HIDEINT, + N_("The width of the size column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_user_width", "", &remote_columns[2], CONFIG_HIDEINT, + N_("The width of the user column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_group_width", "", &remote_columns[3], CONFIG_HIDEINT, + N_("The width of the group column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_date_width", "", &remote_columns[4], CONFIG_HIDEINT, + N_("The width of the date column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"remote_attribs_width", "", &remote_columns[5], CONFIG_HIDEINT, + N_("The width of the attribs column in the file listboxes. Set this to 0 to have this column automagically resize. Set this to -1 to disable this column"), NULL, 0}, + {"send_color", "", &send_color, CONFIG_COLOR, + N_("The color of the commands that are sent to the server"), NULL, 0}, + {"recv_color", "", &recv_color, CONFIG_COLOR, + N_("The color of the commands that are received from the server"), NULL, 0}, + {"error_color", "", &error_color, CONFIG_COLOR, + N_("The color of the error messages"), NULL, 0}, + {"misc_color", "", &misc_color, CONFIG_COLOR, + N_("The color of the rest of the log messages"), NULL, 0}, + {NULL, NULL, NULL, 0, "", NULL, 0} };
--- a/lib/gftp.h Tue Oct 08 02:19:46 2002 +0000 +++ b/lib/gftp.h Mon Oct 14 02:46:14 2002 +0000 @@ -403,10 +403,10 @@ char *key, /* variable name */ *description; /* How this field will show up in the dialog */ gpointer var; /* Pointer to our variable */ - int type, /* See defines below */ - shown; /* Is this shown in the options dialog? */ + int type; /* See defines below */ char *comment; /* Comment to write out to the config file */ gpointer widget; + int ports_shown; /* What ports of gFTP is this option shown in */ } gftp_config_vars; #define CONFIG_INTTEXT 1 @@ -423,6 +423,10 @@ #define CONFIG_UINTTEXT 12 #define CONFIG_CHARPASS 13 +#define GFTP_PORT_GTK (1 << 1) +#define GFTP_PORT_TEXT (1 << 2) +#define GFTP_PORT_ALL (GFTP_PORT_GTK | GFTP_PORT_TEXT) + typedef struct gftp_proxy_type_tag { char *key, @@ -455,7 +459,8 @@ local_columns[6], remote_columns[6], resolve_symlinks, firewall_port, http_proxy_port, overwrite_by_default, append_file_transfers, enable_old_ssh, ssh_need_userpass, - ssh_use_askpass, sshv2_use_sftp_subsys; + ssh_use_askpass, sshv2_use_sftp_subsys, local_sortcol, + local_sortasds, remote_sortcol, remote_sortasds; extern guint max_log_window_size; extern GHashTable * bookmarks_htable, * config_htable; extern GList * localhistory, * remotehistory, * host_history, * port_history,
--- a/lib/options.h Tue Oct 08 02:19:46 2002 +0000 +++ b/lib/options.h Mon Oct 14 02:46:14 2002 +0000 @@ -137,9 +137,14 @@ grab the password. I personally don't like this, but some people do */ - sshv2_use_sftp_subsys = 0; /* Call ssh -s sftp. If you set this + sshv2_use_sftp_subsys = 0, /* Call ssh -s sftp. If you set this it'll automatically use the askpass utility above */ + local_sortcol = 1, + local_sortasds = 1, + remote_sortcol = 1, + remote_sortasds = 1; + guint max_log_window_size = 5000; /* Max size of the log window for the GTK port */
--- a/src/gtk/gftp-gtk.c Tue Oct 08 02:19:46 2002 +0000 +++ b/src/gtk/gftp-gtk.c Mon Oct 14 02:46:14 2002 +0000 @@ -133,13 +133,18 @@ ftp_log (gftp_logging_misc, NULL, _("gFTP comes with ABSOLUTELY NO WARRANTY; for details, see the COPYING file. This is free software, and you are welcome to redistribute it under certain conditions; for details, see the COPYING file\n")); - init_gftp (argc, argv, window); gtk_timeout_add (1000, update_downloads, NULL); gftp_protocols[GFTP_LOCAL_NUM].init (window1.request); if (startup_directory != NULL && *startup_directory != '\0') gftp_set_directory (window1.request, startup_directory); gftp_connect (window1.request); ftp_list_files (&window1, 0); + + /* On the remote window, even though we aren't connected, draw the sort + icon on that side */ + sortrows (GTK_CLIST (window2.listbox), *window2.sortcol, &window2); + + init_gftp (argc, argv, window); gftp_is_started = 1; GDK_THREADS_ENTER (); @@ -210,6 +215,8 @@ box = gtk_hbox_new (FALSE, 0); local_frame = CreateFTPWindow (&window1, listbox_local_width, local_columns); + window1.sortcol = &local_sortcol; + window1.sortasds = &local_sortasds; gtk_box_pack_start (GTK_BOX (box), local_frame, TRUE, TRUE, 0); dlbox = gtk_vbox_new (FALSE, 0); @@ -246,6 +253,8 @@ remote_frame = CreateFTPWindow (&window2, listbox_remote_width, remote_columns); + window2.sortcol = &remote_sortcol; + window2.sortasds = &remote_sortasds; gtk_paned_pack2 (GTK_PANED (winpane), remote_frame, 1, 1); dlpane = gtk_vpaned_new (); @@ -740,8 +749,6 @@ wdata->request->logging_function = ftp_log; wdata->filespec = g_malloc0 (2); *wdata->filespec = '*'; - wdata->sortcol = 1; - wdata->sortasds = 1; parent = gtk_frame_new (NULL); gtk_widget_set_size_request (parent, width, listbox_file_height); @@ -1021,9 +1028,9 @@ int swap_col; wdata = data; - if (column == 0 || (column == wdata->sortcol && wdata->sorted)) + if (column == 0 || (column == *wdata->sortcol && wdata->sorted)) { - wdata->sortasds = !wdata->sortasds; + *wdata->sortasds = !(*wdata->sortasds); swap_col = 1; } else @@ -1034,12 +1041,12 @@ sort_wid = gtk_clist_get_column_widget (clist, 0); gtk_widget_destroy (sort_wid); #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 - if (wdata->sortasds) + if (*wdata->sortasds) sort_wid = toolbar_pixmap (wdata->listbox, "down.xpm"); else sort_wid = toolbar_pixmap (wdata->listbox, "up.xpm"); #else - if (wdata->sortasds) + if (*wdata->sortasds) sort_wid = gtk_image_new_from_stock (GTK_STOCK_SORT_ASCENDING, GTK_ICON_SIZE_SMALL_TOOLBAR); else @@ -1050,13 +1057,16 @@ gtk_clist_set_column_widget (clist, 0, sort_wid); } else - wdata->sortcol = column; + *wdata->sortcol = column; + + if (!GFTP_IS_CONNECTED (wdata->request)) + return; gtk_clist_freeze (clist); gtk_clist_clear (clist); - wdata->files = gftp_sort_filelist (wdata->files, wdata->sortcol, - wdata->sortasds); + wdata->files = gftp_sort_filelist (wdata->files, *wdata->sortcol, + *wdata->sortasds); templist = wdata->files; while (templist != NULL)
--- a/src/gtk/gftp-gtk.h Tue Oct 08 02:19:46 2002 +0000 +++ b/src/gtk/gftp-gtk.h Mon Oct 14 02:46:14 2002 +0000 @@ -65,9 +65,9 @@ a directory */ *hoststxt, /* Show which directory we're in */ *listbox; /* Our listbox showing the files */ - unsigned int sortcol, /* Which column we are sorting by */ - sortasds : 1, /* Sorted ascending or descending */ - sorted : 1, /* Is the output sorted? */ + unsigned int *sortcol, /* Which column we are sorting by */ + *sortasds; /* Sorted ascending or descending */ + unsigned int sorted : 1, /* Is the output sorted? */ show_selected : 1, /* Show only selected files */ *histlen; /* Pointer to length of history */ char *filespec; /* Filespec for the listbox */
--- a/src/gtk/options_dialog.c Tue Oct 08 02:19:46 2002 +0000 +++ b/src/gtk/options_dialog.c Mon Oct 14 02:46:14 2002 +0000 @@ -112,7 +112,7 @@ table = box = NULL; for (i=0; config_file_vars[i].key != NULL; i++) { - if (!config_file_vars[i].shown) + if (!(config_file_vars[i].ports_shown & GFTP_PORT_GTK)) continue; switch (config_file_vars[i].type)
--- a/src/gtk/transfer.c Tue Oct 08 02:19:46 2002 +0000 +++ b/src/gtk/transfer.c Mon Oct 14 02:46:14 2002 +0000 @@ -112,7 +112,7 @@ } wdata->sorted = 0; - sortrows (GTK_CLIST (wdata->listbox), wdata->sortcol, (gpointer) wdata); + sortrows (GTK_CLIST (wdata->listbox), *wdata->sortcol, (gpointer) wdata); if (IS_NONE_SELECTED (wdata)) gtk_clist_select_row (GTK_CLIST (wdata->listbox), 0, 0); return (1);
--- a/src/text/gftp-text.c Tue Oct 08 02:19:46 2002 +0000 +++ b/src/text/gftp-text.c Mon Oct 14 02:46:14 2002 +0000 @@ -28,65 +28,67 @@ struct _gftp_text_methods gftp_text_methods[] = { {N_("about"), 2, gftp_text_about, NULL, - N_("Shows gFTP information")}, + N_("Shows gFTP information"), NULL}, {N_("ascii"), 2, gftp_text_ascii, &gftp_text_remreq, - N_("Sets the current file transfer mode to Ascii (only for FTP)")}, + N_("Sets the current file transfer mode to Ascii (only for FTP)"), NULL}, {N_("binary"), 1, gftp_text_binary, &gftp_text_remreq, - N_("Sets the current file transfer mode to Binary (only for FTP)")}, + N_("Sets the current file transfer mode to Binary (only for FTP)"), NULL}, {N_("cd"), 2, gftp_text_cd, &gftp_text_remreq, - N_("Changes the remote working directory")}, + N_("Changes the remote working directory"), NULL}, {N_("chdir"), 3, gftp_text_cd, &gftp_text_remreq, - N_("Changes the remote working directory")}, + N_("Changes the remote working directory"), NULL}, {N_("chmod"), 3, gftp_text_chmod, &gftp_text_remreq, - N_("Changes the permissions of a remote file")}, - {N_("close"), 2, gftp_text_close, &gftp_text_remreq, - N_("Disconnects from the remote site")}, + N_("Changes the permissions of a remote file"), NULL}, + {N_("clear"), 3, gftp_text_clear, NULL, + N_("Available options: cache"), gftp_text_clear_show_subhelp}, + {N_("close"), 3, gftp_text_close, &gftp_text_remreq, + N_("Disconnects from the remote site"), NULL}, {N_("delete"), 1, gftp_text_delete, &gftp_text_remreq, - N_("Removes a remote file")}, + N_("Removes a remote file"), NULL}, {N_("get"), 1, gftp_text_mget_file, NULL, - N_("Downloads remote file(s)")}, + N_("Downloads remote file(s)"), NULL}, {N_("help"), 1, gftp_text_help, NULL, - N_("Shows this help screen")}, + N_("Shows this help screen"), NULL}, {N_("lcd"), 3, gftp_text_cd, &gftp_text_locreq, - N_("Changes the local working directory")}, + N_("Changes the local working directory"), NULL}, {N_("lchdir"), 4, gftp_text_cd, &gftp_text_locreq, - N_("Changes the local working directory")}, + N_("Changes the local working directory"), NULL}, {N_("lchmod"), 4, gftp_text_chmod, &gftp_text_locreq, - N_("Changes the permissions of a local file")}, + N_("Changes the permissions of a local file"), NULL}, {N_("ldelete"), 2, gftp_text_delete, &gftp_text_locreq, - N_("Removes a local file")}, + N_("Removes a local file"), NULL}, {N_("lls"), 2, gftp_text_ls, &gftp_text_locreq, - N_("Shows the directory listing for the current local directory")}, + N_("Shows the directory listing for the current local directory"), NULL}, {N_("lmkdir"), 2, gftp_text_mkdir, &gftp_text_locreq, - N_("Creates a local directory")}, + N_("Creates a local directory"), NULL}, {N_("lpwd"), 2, gftp_text_pwd, &gftp_text_locreq, - N_("Show current local directory")}, + N_("Show current local directory"), NULL}, {N_("lrename"), 3, gftp_text_rename, &gftp_text_locreq, - N_("Rename a local file")}, + N_("Rename a local file"), NULL}, {N_("lrmdir"), 3, gftp_text_rmdir, &gftp_text_locreq, - N_("Remove a local directory")}, + N_("Remove a local directory"), NULL}, {N_("ls"), 2, gftp_text_ls, &gftp_text_remreq, - N_("Shows the directory listing for the current remote directory")}, + N_("Shows the directory listing for the current remote directory"), NULL}, {N_("mget"), 2, gftp_text_mget_file, NULL, - N_("Downloads remote file(s)")}, + N_("Downloads remote file(s)"), NULL}, {N_("mkdir"), 2, gftp_text_mkdir, &gftp_text_remreq, - N_("Creates a remote directory")}, + N_("Creates a remote directory"), NULL}, {N_("mput"), 2, gftp_text_mput_file, NULL, - N_("Uploads local file(s)")}, + N_("Uploads local file(s)"), NULL}, {N_("open"), 1, gftp_text_open, &gftp_text_remreq, - N_("Opens a connection to a remote site")}, + N_("Opens a connection to a remote site"), NULL}, {N_("put"), 2, gftp_text_mput_file, NULL, - N_("Uploads local file(s)")}, + N_("Uploads local file(s)"), NULL}, {N_("pwd"), 2, gftp_text_pwd, &gftp_text_remreq, - N_("Show current remote directory")}, + N_("Show current remote directory"), NULL}, {N_("quit"), 1, gftp_text_quit, NULL, - N_("Exit from gFTP")}, + N_("Exit from gFTP"), NULL}, {N_("rename"), 2, gftp_text_rename, &gftp_text_remreq, - N_("Rename a remote file")}, + N_("Rename a remote file"), NULL}, {N_("rmdir"), 2, gftp_text_rmdir, &gftp_text_remreq, - N_("Remove a remote directory")}, + N_("Remove a remote directory"), NULL}, {N_("set"), 1, gftp_text_set, NULL, - N_("Show configuration file variables. You can also set variables by set var=val")}, + N_("Show configuration file variables. You can also set variables by set var=val"), gftp_text_set_show_subhelp}, {NULL, 0, NULL, NULL, NULL}}; int @@ -554,9 +556,11 @@ int gftp_text_ls (gftp_request * request, char *command, gpointer *data) { + GList * files, * templist, * delitem; char *color, buf[20], *filespec; + int sortcol, sortasds; + gftp_file * fle; time_t curtime; - gftp_file fle; time (&curtime); if (!GFTP_IS_CONNECTED (request)) @@ -570,39 +574,82 @@ if (gftp_list_files (request) != 0) return (1); - while (gftp_get_next_file (request, filespec, &fle) > 0) + files = NULL; + fle = g_malloc0 (sizeof (*fle)); + while (gftp_get_next_file (request, NULL, fle) > 0) { - if (strcmp (fle.file, ".") == 0) + if (strcmp (fle->file, ".") == 0) { - gftp_file_destroy (&fle); + gftp_file_destroy (fle); continue; } + files = g_list_prepend (files, fle); + fle = g_malloc0 (sizeof (*fle)); + } + g_free (fle); - if (*fle.attribs == 'd') + if (request == gftp_text_locreq) + { + sortcol = local_sortcol; + sortasds = local_sortasds; + } + else + { + sortcol = remote_sortcol; + sortasds = remote_sortasds; + } + + files = gftp_sort_filelist (files, sortcol, sortasds); + delitem = NULL; + for (templist = files; templist != NULL; templist = templist->next) + { + if (delitem != NULL) + { + fle = delitem->data; + gftp_file_destroy (fle); + g_free (fle); + delitem = NULL; + } + + fle = templist->data; + + if (*fle->attribs == 'd') color = COLOR_BLUE; - else if (*fle.attribs == 'l') + else if (*fle->attribs == 'l') color = COLOR_WHITE; - else if (strchr (fle.attribs, 'x') != NULL) + else if (strchr (fle->attribs, 'x') != NULL) color = COLOR_GREEN; else color = COLOR_DEFAULT; - if (curtime > fle.datetime + 6 * 30 * 24 * 60 * 60 || - curtime < fle.datetime - 60 * 60) - strftime (buf, sizeof (buf), "%b %d %Y", localtime (&fle.datetime)); + if (curtime > fle->datetime + 6 * 30 * 24 * 60 * 60 || + curtime < fle->datetime - 60 * 60) + strftime (buf, sizeof (buf), "%b %d %Y", localtime (&fle->datetime)); else - strftime (buf, sizeof (buf), "%b %d %H:%M", localtime (&fle.datetime)); + strftime (buf, sizeof (buf), "%b %d %H:%M", localtime (&fle->datetime)); #if defined (_LARGEFILE_SOURCE) printf ("%s %8s %8s %10lld %s %s%s%s\n", #else printf ("%s %8s %8s %10ld %s %s%s%s\n", #endif - fle.attribs, fle.user, fle.group, - fle.size, buf, color, fle.file, COLOR_DEFAULT); - gftp_file_destroy (&fle); + fle->attribs, fle->user, fle->group, + fle->size, buf, color, fle->file, COLOR_DEFAULT); + delitem = templist; } gftp_end_transfer (request); + + if (delitem != NULL) + { + fle = delitem->data; + gftp_file_destroy (fle); + g_free (fle); + delitem = NULL; + } + + if (files != NULL) + g_list_free (files); + return (1); } @@ -898,10 +945,21 @@ int gftp_text_help (gftp_request * request, char *command, gpointer *data) { - int i, j, ele, numrows, numcols = 6; + int i, j, ele, numrows, numcols = 6, handled; + char *pos; if (command != NULL && *command != '\0') { + for (pos = command; *pos != ' ' && *pos != '\0'; pos++); + if (*pos == ' ') + { + *pos++ = '\0'; + if (*pos == '\0') + pos = NULL; + } + else + pos = NULL; + for (i=0; gftp_text_methods[i].command != NULL; i++) { if (strcmp (gftp_text_methods[i].command, command) == 0) @@ -909,7 +967,15 @@ } if (gftp_text_methods[i].cmd_description != NULL) - printf ("%s\n", _(gftp_text_methods[i].cmd_description)); + { + if (pos != NULL && gftp_text_methods[i].subhelp_func != NULL) + handled = gftp_text_methods[i].subhelp_func (pos); + else + handled = 0; + + if (!handled) + printf ("%s\n", _(gftp_text_methods[i].cmd_description)); + } else *command = '\0'; } @@ -950,6 +1016,9 @@ { for (i=0; config_file_vars[i].key != NULL; i++) { + if (!(config_file_vars[i].ports_shown & GFTP_PORT_TEXT)) + continue; + switch (config_file_vars[i].type) { case CONFIG_CHARTEXT: @@ -988,6 +1057,7 @@ { if (strcmp (config_file_vars[i].key, command) == 0) break; + } if (config_file_vars[i].key == NULL) @@ -997,6 +1067,13 @@ return (1); } + if (!(config_file_vars[i].ports_shown & GFTP_PORT_TEXT)) + { + gftp_text_log (gftp_logging_error, NULL, + _("Error: Variable %s is not available in the text port of gFTP\n"), command); + return (1); + } + configuration_changed = 1; switch (config_file_vars[i].type) { @@ -1025,6 +1102,17 @@ } +int +gftp_text_clear (gftp_request * request, char *command, gpointer *data) +{ + if (strcasecmp (command, "cache") == 0) + gftp_clear_cache_files (); + else + gftp_text_log (gftp_logging_error, NULL, "Invalid argument\n"); + return (1); +} + + char * gftp_text_ask_question (const char *question, int echo, char *buf, size_t size) { @@ -1158,6 +1246,37 @@ } +int +gftp_text_set_show_subhelp (char *topic) +{ + int i; + + for (i=0; config_file_vars[i].key != NULL; i++) + { + if (strcmp (topic, config_file_vars[i].key) == 0) + { + printf ("%s\n", config_file_vars[i].comment); + return (1); + } + } + + return (0); +} + + +int +gftp_text_clear_show_subhelp (char *topic) +{ + if (strcmp (topic, "cache") == 0) + { + printf (_("Clear the directory cache\n")); + return (1); + } + + return (0); +} + + #if !defined (HAVE_GETADDRINFO) || !defined (HAVE_GAI_STRERROR) struct hostent *
--- a/src/text/gftp-text.h Tue Oct 08 02:19:46 2002 +0000 +++ b/src/text/gftp-text.h Mon Oct 14 02:46:14 2002 +0000 @@ -47,6 +47,7 @@ int (*func)(gftp_request * request, char *command, gpointer *data); gftp_request ** request; char *cmd_description; + int (*subhelp_func) (char *topic); }; /* gftp-text.h */ @@ -108,6 +109,9 @@ int gftp_text_set ( gftp_request * request, char *command, gpointer *data); +int gftp_text_clear ( gftp_request * request, + char *command, + gpointer *data); char *gftp_text_ask_question ( const char *question, int echo, char *buf, @@ -116,6 +120,8 @@ void gftp_text_calc_kbs ( gftp_transfer * tdata, ssize_t num_read ); void sig_child ( int signo ); +int gftp_text_set_show_subhelp ( char *topic ); +int gftp_text_clear_show_subhelp ( char *topic ); #endif