diff lib/rfc959.c @ 227:a85a097bbb02

2003-7-20 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h - added compare_function to gftp_config_vars structure. (gftp_set_global_option) use the compare function to see if the value was actually changed, and if so set the gftp_configuration_changed variable * lib/misc.c lib/gftp.h - For glib 1.2, added my version of g_build_path() since it's not there * lib/misc.c - GLIB/GTK+ 1.2 fixes * lib/protocols.c (gftp_fd_open) - cleaned up some * lib/rfc959.c (rfc959_init) - if the email address is blank, get the users address here instead of in register_module. It was being blanked out when the config file was being read * lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - mark the config variables that can show up in the bookmarks editor * src/text/gftp-text.c src/gtk/options_dialog.c - use gftp_set_global_option() to set the new configuration values * src/gtk/bookmarks.c - fixed crash in bookmarks dialog. Added notebook widget to the dialog as well. The options that can be edited for this site will show up in other tabs * src/gtk/gftp-gtk.c - fixes to the calls to gftp_set_global_option() * src/gtk/options_dialog.c - added gftp_gtk_setup_bookmark_options() to display all the editable options for this bookmark
author masneyb
date Mon, 21 Jul 2003 00:26:43 +0000
parents 0098dae654a5
children afbbc72b73e2
line wrap: on
line diff
--- a/lib/rfc959.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/rfc959.c	Mon Jul 21 00:26:43 2003 +0000
@@ -35,11 +35,11 @@
 
 static gftp_config_vars config_vars[] = 
 {
-  {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL, 0, NULL, 
-   GFTP_PORT_GTK, NULL},
+  {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
 
   {"email", N_("Email address:"), 
-   gftp_option_type_text, "", NULL, 0,
+   gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("This is the password that will be used whenever you log into a remote FTP server as anonymous"), 
    GFTP_PORT_ALL, NULL},
   {"ftp_proxy_host", N_("Proxy hostname:"), 
@@ -65,15 +65,18 @@
    GFTP_PORT_ALL, NULL},
 
   {"passive_transfer", N_("Passive file transfers"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("If this is enabled, then the remote FTP server will open up a port for the data connection. If you are behind a firewall, you will need to enable this. Generally, it is a good idea to keep this enabled unless you are connecting to an older FTP server that doesn't support this. If this is disabled, then gFTP will open up a port on the client side and the remote server will attempt to connect to it."),
    GFTP_PORT_ALL, NULL},
   {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The remote FTP server will attempt to resolve symlinks in the directory listings. Generally, this is a good idea to leave enabled. The only time you will want to disable this is if the remote FTP server doesn't support the -L option to LIST"), 
    GFTP_PORT_ALL, NULL},
   {"ascii_transfers", N_("Transfer files in ASCII mode"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("If you are transfering a text file from Windows to UNIX box or vice versa, then you should enable this. Each system represents newlines differently for text files. If you are transfering from UNIX to UNIX, then it is safe to leave this off. If you are downloading binary data, you will want to disable this."), 
    GFTP_PORT_ALL, NULL},
 
@@ -1630,27 +1633,7 @@
 void 
 rfc959_register_module (void)
 {
-  struct hostent *hent;
-  struct utsname unme;
-  struct passwd *pw;
-  char *tempstr;
-
   gftp_register_config_vars (config_vars);
-
-  gftp_lookup_global_option ("email", &tempstr);
-  if (tempstr == NULL || *tempstr == '\0')
-    {
-      /* If there is no email address specified, then we'll just use the
-         currentuser@currenthost */
-      uname (&unme);
-      pw = getpwuid (geteuid ());
-      hent = gethostbyname (unme.nodename);
-      if (strchr (unme.nodename, '.') == NULL && hent != NULL)
-        tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL);
-      else
-        tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL);
-      gftp_set_global_option ("email", tempstr);
-    }
 }
 
 
@@ -1673,9 +1656,29 @@
 rfc959_init (gftp_request * request)
 {
   rfc959_parms * parms;
+  struct hostent *hent;
+  struct utsname unme;
+  struct passwd *pw;
+  char *tempstr;
 
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
+  gftp_lookup_global_option ("email", &tempstr);
+  if (tempstr == NULL || *tempstr == '\0')
+    {
+      /* If there is no email address specified, then we'll just use the
+         currentuser@currenthost */
+      uname (&unme);
+      pw = getpwuid (geteuid ());
+      hent = gethostbyname (unme.nodename);
+      if (strchr (unme.nodename, '.') == NULL && hent != NULL)
+        tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL);
+      else
+        tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL);
+      gftp_set_global_option ("email", tempstr);
+      g_free (tempstr);
+    }
+
   request->protonum = GFTP_FTP_NUM;
   request->init = rfc959_init;
   request->destroy = rfc959_request_destroy;