#include <optsinet.h>
Inheritance diagram for InternetTab:
Public Member Functions | |
virtual BOOL | HandleMsg (DialogMsg *Msg) |
Handles all the Internet options tabs messages. | |
virtual BOOL | InitSection () |
Sets initial values for the Page section of the options dialog box. This section includes the:-. | |
virtual BOOL | CommitSection () |
Effect any changes made to the Internet settings. | |
virtual CDlgResID | GetPageID () |
virtual BOOL | IsDocumentOption () |
virtual BOOL | IsProgramOption () |
Definition at line 121 of file optsinet.h.
|
Effect any changes made to the Internet settings.
Implements OptionsTabs. Definition at line 125 of file optsinet.cpp. 00126 { 00127 ERROR2IF(pPrefsDlg==NULL,FALSE,"GridTab::CommitSection() - pPrefsDlg==NULL"); 00128 if (pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_INTERNET))==FALSE) 00129 return TRUE; // just return with no error 00130 00131 // Read in the new potential cache size 00132 BOOL Valid = TRUE; 00133 UINT32 lCacheSize = pPrefsDlg->GetMemoryGadgetValue(_R(IDC_CACHESIZE),1024,UINT32_MAX,_R(IDS_INVALIDCACHESIZE),&Valid); 00134 00135 if ((lCacheSize < 500 * SIZEOFKILOBYTE) || (lCacheSize == UINT32_MAX)) 00136 { 00137 InformWarning(_R(IDS_INVALIDCACHESIZE)); 00138 00139 if (lCacheSize < 500 * SIZEOFKILOBYTE) 00140 { 00141 lCacheSize = 500 * SIZEOFKILOBYTE; 00142 } 00143 else 00144 { 00145 lCacheSize = UINT32_MAX; 00146 } 00147 00148 pPrefsDlg->SetMemoryGadgetValue(_R(IDC_CACHESIZE), lCacheSize); 00149 } 00150 00151 if(!Valid) return FALSE; 00152 00153 if (Valid && !DownloadCache::SetSize(lCacheSize)) 00154 { 00155 InformError(_R(IDS_INSUFFICIENT_DISK_SPACE)); 00156 return FALSE; 00157 } 00158 00159 UINT32 lCacheUsage = DownloadCache::GetUsage(); 00160 pPrefsDlg->SetLongGadgetValue(_R(IDC_CACHEUSAGE), lCacheUsage); 00161 00162 // Sort out the connection type 00163 if (pPrefsDlg->GetBoolGadgetSelected(_R(IDC_14K))) 00164 InternetManager::SetConnectionType(CONNECTION_SLOWMODEM); 00165 else if (pPrefsDlg->GetBoolGadgetSelected(_R(IDC_28K))) 00166 InternetManager::SetConnectionType(CONNECTION_FASTMODEM); 00167 else if (pPrefsDlg->GetBoolGadgetSelected(_R(IDC_56K))) 00168 InternetManager::SetConnectionType(CONNECTION_X2); 00169 else if (pPrefsDlg->GetBoolGadgetSelected(_R(IDC_ISDN))) 00170 InternetManager::SetConnectionType(CONNECTION_ISDN); 00171 return TRUE; 00172 }
|
|
Implements OptionsTabs. Definition at line 135 of file optsinet.h. 00135 {return _R(IDD_OPTSTAB_INTERNET);} // Return section/page id system
|
|
Handles all the Internet options tabs messages.
Implements OptionsTabs. Definition at line 190 of file optsinet.cpp. 00191 { 00192 ERROR2IF(Msg == NULL,FALSE,"Null message received"); 00193 ERROR2IF(pPrefsDlg == NULL,FALSE,"HandleMsg called with no dialog pointer"); 00194 00195 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_INTERNET)); // The Page page identifier 00196 if (!ok) 00197 return TRUE; // page not present 00198 00199 switch(Msg->DlgMsg) 00200 { 00201 case DIM_CREATE: // Initialise controls 00202 ok = InitSection(); 00203 if (!ok) 00204 InformError(); 00205 break; 00206 case DIM_TEXT_CHANGED: 00207 OptionsTabs::SetApplyNowState(TRUE); 00208 OptionsTabs::UngreyApplyNow(); 00209 break; 00210 case DIM_LFT_BN_CLICKED: 00211 switch (Msg->GadgetID) 00212 { 00213 case _R(IDC_FLUSHCACHE): 00214 { 00215 DownloadCache::Flush(); 00216 UINT32 lCacheUsage = DownloadCache::GetUsage(); 00217 pPrefsDlg->SetMemoryGadgetValue(_R(IDC_CACHEUSAGE), lCacheUsage); 00218 } 00219 break; 00220 default: 00221 OptionsTabs::SetApplyNowState(TRUE); 00222 } 00223 break; 00224 } 00225 return TRUE; 00226 }
|
|
Sets initial values for the Page section of the options dialog box. This section includes the:-.
Implements OptionsTabs. Definition at line 245 of file optsinet.cpp. 00246 { 00247 ERROR2IF(pPrefsDlg == NULL,FALSE,"InitSection called with no dialog pointer"); 00248 00249 // Fill in the data regardless of whether the proxy is enabled or not 00250 // Now get the current settings 00251 TCHAR szHostName[INTERNET_MAX_PATH_LENGTH]; 00252 SERVENT proxyEntry = {szHostName, NULL, 0x0000, NULL}; 00253 bool bProxyEnabled; 00254 00255 String_256 strProxyNote(_T("")); 00256 00257 if (!InternetManager::GetProxyServer(&proxyEntry, &bProxyEnabled)) 00258 { 00259 // failed to read proxy settings 00260 String_256 strProxyError(_R(IDS_PROXY_SUB_ERROR)); 00261 strProxyNote.MakeMsg(_R(IDS_PROXY_NOTE), static_cast<TCHAR *>(strProxyError)); 00262 } 00263 else 00264 { 00265 // read settings ok 00266 if (bProxyEnabled) 00267 { 00268 // proxy server enabled 00269 String_256 strProxyEnabled; 00270 strProxyEnabled.MakeMsg(_R(IDS_PROXY_SUB_ENABLED), proxyEntry.s_name, proxyEntry.s_port); 00271 strProxyNote.MakeMsg(_R(IDS_PROXY_NOTE), static_cast<TCHAR *>(strProxyEnabled)); 00272 } 00273 else 00274 { 00275 // proxy server disabled 00276 String_256 strProxyDisabled(_R(IDS_PROXY_SUB_DISABLED)); 00277 strProxyNote.MakeMsg(_R(IDS_PROXY_NOTE), static_cast<TCHAR *>(strProxyDisabled)); 00278 } 00279 } 00280 00281 pPrefsDlg->SetStringGadgetValue(_R(IDC_PROXY_DETAILS), &strProxyNote); 00282 00283 // Sort out the connection type 00284 UINT32 nSelID; 00285 switch (InternetManager::GetConnectionType()) 00286 { 00287 case CONNECTION_SLOWMODEM: 00288 nSelID = _R(IDC_14K); 00289 break; 00290 case CONNECTION_FASTMODEM: 00291 nSelID = _R(IDC_28K); 00292 break; 00293 case CONNECTION_X2: 00294 nSelID = _R(IDC_56K); 00295 break; 00296 case CONNECTION_ISDN: 00297 nSelID = _R(IDC_ISDN); 00298 } 00299 pPrefsDlg->SetBoolGadgetSelected(nSelID, TRUE); 00300 00301 00302 // Sort out the download cache section. 00303 UINT32 lCacheUsage = DownloadCache::GetUsage(); 00304 pPrefsDlg->SetLongGadgetValue(_R(IDC_CACHEUSAGE), lCacheUsage); 00305 00306 UINT32 lCacheSize = DownloadCache::GetSize(); 00307 pPrefsDlg->SetMemoryGadgetValue(_R(IDC_CACHESIZE), lCacheSize); 00308 return TRUE; 00309 }
|
|
Implements OptionsTabs. Definition at line 137 of file optsinet.h. 00137 {return FALSE;} // Return True if document option
|
|
Implements OptionsTabs. Definition at line 139 of file optsinet.h. 00139 {return TRUE;} // Return True if program option
|