| OLD | NEW |
| 1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
| 2 #include "PluginUserSettings.h" | 2 #include "PluginUserSettings.h" |
| 3 #include <algorithm> | 3 #include <algorithm> |
| 4 #include "PluginSettings.h" | 4 #include "PluginSettings.h" |
| 5 #include "PluginClient.h" | 5 #include "PluginClient.h" |
| 6 #include "../shared/Dictionary.h" | 6 #include "../shared/Dictionary.h" |
| 7 | 7 |
| 8 static const CString s_GetMessage = L"GetMessage"; | 8 static const CString s_GetMessage = L"GetMessage"; |
| 9 static const CString s_GetLanguageCount = L"GetLanguageCount"; | 9 static const CString s_GetLanguageCount = L"GetLanguageCount"; |
| 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; | 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 pVarResult->vt = VT_BSTR; | 325 pVarResult->vt = VT_BSTR; |
| 326 pVarResult->bstrVal = SysAllocString(settings->GetDocumentationLink()); | 326 pVarResult->bstrVal = SysAllocString(settings->GetDocumentationLink()); |
| 327 } | 327 } |
| 328 else if (s_IsAcceptableAdsEnabled == method) | 328 else if (s_IsAcceptableAdsEnabled == method) |
| 329 { | 329 { |
| 330 if (0 != pDispparams->cArgs) | 330 if (0 != pDispparams->cArgs) |
| 331 return DISP_E_BADPARAMCOUNT; | 331 return DISP_E_BADPARAMCOUNT; |
| 332 | 332 |
| 333 pVarResult->vt = VT_BOOL; | 333 pVarResult->vt = VT_BOOL; |
| 334 pVarResult->boolVal = CPluginClient::GetInstance()->IsAcceptableAdsEnabled()
; | 334 pVarResult->boolVal = CPluginClient::GetInstance()->IsAcceptableAdsEnabled()
? VARIANT_TRUE : VARIANT_FALSE; |
| 335 } | 335 } |
| 336 else if (s_SetAcceptableAdsEnabled == method) | 336 else if (s_SetAcceptableAdsEnabled == method) |
| 337 { | 337 { |
| 338 if (1 != pDispparams->cArgs) | 338 if (1 != pDispparams->cArgs) |
| 339 return DISP_E_BADPARAMCOUNT; | 339 return DISP_E_BADPARAMCOUNT; |
| 340 | 340 |
| 341 if (VT_BOOL != pDispparams->rgvarg[0].vt) | 341 if (VT_BOOL != pDispparams->rgvarg[0].vt) |
| 342 return DISP_E_TYPEMISMATCH; | 342 return DISP_E_TYPEMISMATCH; |
| 343 | 343 |
| 344 bool enable = pDispparams->rgvarg[0].boolVal; | 344 bool enable = VARIANT_FALSE != pDispparams->rgvarg[0].boolVal; |
| 345 | 345 |
| 346 if (enable) | 346 if (enable) |
| 347 { | 347 { |
| 348 CPluginClient* client = CPluginClient::GetInstance(); | 348 CPluginClient* client = CPluginClient::GetInstance(); |
| 349 client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L"
")); | 349 client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L"
")); |
| 350 } | 350 } |
| 351 else | 351 else |
| 352 { | 352 { |
| 353 CPluginClient* client = CPluginClient::GetInstance(); | 353 CPluginClient* client = CPluginClient::GetInstance(); |
| 354 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl",
L"")); | 354 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl",
L"")); |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 else if (s_IsUpdate == method) | 357 else if (s_IsUpdate == method) |
| 358 { | 358 { |
| 359 if (0 != pDispparams->cArgs) | 359 if (0 != pDispparams->cArgs) |
| 360 return DISP_E_BADPARAMCOUNT; | 360 return DISP_E_BADPARAMCOUNT; |
| 361 | 361 |
| 362 pVarResult->vt = VT_BOOL; | 362 pVarResult->vt = VT_BOOL; |
| 363 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayUpdateP
age", false); | 363 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayUpdateP
age", false); |
| 364 } | 364 } |
| 365 else | 365 else |
| 366 return DISP_E_MEMBERNOTFOUND; | 366 return DISP_E_MEMBERNOTFOUND; |
| 367 | 367 |
| 368 return S_OK; | 368 return S_OK; |
| 369 } | 369 } |
| 370 | 370 |
| OLD | NEW |