Changeset abe53d3 for win32/admin/PropConn.cpp
- Timestamp:
- 2005-11-07T16:42:49Z (19 years ago)
- Branches:
- master
- Children:
- f56c491
- Parents:
- 99318ad
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
win32/admin/PropConn.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 4 #include "PropConn.h" 7 5 … … 57 55 void CPropConn::OnProxyEnabled() 58 56 { 59 // TODO: Add your control notification handler code here60 57 m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); 61 58 m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); … … 73 70 void CPropConn::OnOK() 74 71 { 72 CString tmp; 73 m_proxyhost.GetWindowText(tmp); 74 WriteProfileString("proxy_host", tmp); 75 76 m_proxyport.GetWindowText(tmp); 77 WriteProfileInt("proxy_port", atoi(tmp)); 78 75 79 if(!m_proxy_enabled.GetCheck()) { 76 proxytype = PROXY_NONE; 77 return; 80 WriteProfileInt("proxy_type", 0); 81 } else { 82 WriteProfileInt("proxy_type", m_proxytype.GetCurSel()+1); 78 83 } 79 84 80 CString tmp;81 m_proxyhost.GetWindowText(tmp);82 strcpy(proxyhost, tmp);83 84 m_proxyport.GetWindowText(tmp);85 proxyport = atoi(tmp);86 87 proxytype = m_proxytype.GetCurSel()+1;88 89 85 if(!m_proxy_auth_enabled.GetCheck()) { 90 strcpy(proxyuser, ""); 91 strcpy(proxypass, ""); 92 return; 86 WriteProfileString("proxy_user", ""); 87 WriteProfileString("proxy_password", ""); 88 } else { 89 m_proxyuser.GetWindowText(tmp); 90 WriteProfileString("proxy_user", tmp); 91 m_proxypass.GetWindowText(tmp); 92 WriteProfileString("proxy_password", tmp); 93 93 } 94 95 m_proxyuser.GetWindowText(tmp);96 strcpy(proxyuser, tmp);97 m_proxypass.GetWindowText(tmp);98 strcpy(proxypass, tmp);99 94 100 95 CPropertyPage::OnOK(); … … 105 100 char pp[20]; 106 101 CPropertyPage::OnInitDialog(); 102 int proxytype; 107 103 108 m_proxyhost.SetWindowText( proxyhost);109 m_proxyuser.SetWindowText( proxyuser);110 m_proxypass.SetWindowText( proxypass);111 g_snprintf(pp, 20, "%d", proxyport);104 m_proxyhost.SetWindowText(GetProfileString("proxy_host", "")); 105 m_proxyuser.SetWindowText(GetProfileString("proxy_user", "")); 106 m_proxypass.SetWindowText(GetProfileString("proxy_password", "")); 107 sprintf(pp, "%d", GetProfileInt("proxy_port", 3128)); 112 108 m_proxyport.SetWindowText(pp); 109 110 proxytype = GetProfileInt("proxy_type", 0); 113 111 114 112 m_proxytype.AddString("SOCKS 4"); … … 117 115 m_proxytype.SetCurSel(proxytype-1); 118 116 119 m_proxy_enabled.SetCheck(proxytype == PROXY_NONE?0:1);120 m_proxy_auth_enabled.SetCheck(strcmp( proxyuser, "")?1:0);117 m_proxy_enabled.SetCheck(proxytype == 0?0:1); 118 m_proxy_auth_enabled.SetCheck(strcmp(GetProfileString("proxy_user", ""), "")?1:0); 121 119 122 120 OnProxyEnabled();
Note: See TracChangeset
for help on using the changeset viewer.