Max, could you please commit this.
-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.
--- Begin Message ---
>On Thu, 2003-10-23 at 22:55, Jerry D. Hedden wrote:
>> One of the items on the TODO list for setup.exe is to save and load
>> proxy settings so the user doesn't have to keep entering them.
>> 
>> Below is a small patch to ConnectionSetting.cc to do just that:

--- From: [EMAIL PROTECTED]
>Please supply:
>- the patch as an attachment, created using -up on diff.

Attached.

>- A changelog.

2003-10-23  Jerry D. Hedden <[EMAIL PROTECTED]>

        * ConnectionSetting.cc (ConnectionSetting::load): Load proxy
settings.
        (ConnectionSetting::save): Save proxy settings.



=====
Jerry D. Hedden
<< If you're not having fun, then you're not doing it right! >>
--- setup-0/ConnectionSetting.cc        2003-07-30 05:04:27.000000000 -0400
+++ setup/ConnectionSetting.cc  2003-10-23 09:15:28.297445000 -0400
@@ -36,9 +36,15 @@ ConnectionSetting::load()
     {
       char localdir[1000];
       char *fg_ret = f->gets (localdir, 1000);
-      delete f;
       if (fg_ret)
         net_method = typeFromString(fg_ret);
+      fg_ret = f->gets (localdir, 1000);
+      if (fg_ret)
+        net_proxy_host = strdup(fg_ret);
+      fg_ret = f->gets (localdir, 1000);
+      if (fg_ret)
+        net_proxy_port = atoi(fg_ret);
+      delete f;
     }
   inited = 1;
 }
@@ -46,6 +52,7 @@ ConnectionSetting::load()
 void
 ConnectionSetting::save()
 {
+  char port_str[20];
   
   io_stream *f = UserSettings::Instance().settingFileForSave("last-connection");
   if (f)
@@ -59,7 +66,9 @@ ConnectionSetting::save()
             break;
         case IDC_NET_PROXY:
             f->write("Proxy\n",6);
-            // TODO: also write the proxy and port, and then parse them in load.
+            f->write(net_proxy_host,strlen(net_proxy_host));
+            sprintf(port_str, "\n%d\n", net_proxy_port);
+            f->write(port_str,strlen(port_str));
             break;
         default:
             break;

--- End Message ---

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to