| 304 | |
| 305 | |
| 306 | void CSettingsPropertyPage::OnClickedEnableSavingPasswords() |
| 307 | { |
| 308 | |
| 309 | |
| 310 | SetControlChanged(IDC_ENABLE_SAVING_PASSWORDS); |
| 311 | |
| 312 | bool enablesavingpasswords = false; |
| 313 | CryptSettings::getInstance().GetSettingCurrent(ENABLE_SAVING_PASSWORDS, enablesavingpasswords); |
| 314 | |
| 315 | if (enablesavingpasswords) { |
| 316 | bool neversavehistory = false; |
| 317 | CryptSettings::getInstance().GetSettingCurrent(NEVER_SAVE_HISTORY, neversavehistory); |
| 318 | if (neversavehistory) { |
| 319 | MessageBox(LocUtils::GetStringFromResources(IDS_PASS_WILL_NOT_BE_SAVED).c_str(), |
| 320 | L"cppcryptfs", MB_OK | MB_ICONINFORMATION); |
| 321 | } |
| 322 | } else { |
| 323 | int numSavedPasswords = SavedPasswords::ClearSavedPasswords(FALSE); |
| 324 | if (numSavedPasswords < 0) { |
| 325 | MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_COUNT_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); |
| 326 | } else if (numSavedPasswords > 0) { |
| 327 | int result = MessageBox(LocUtils::GetStringFromResources(IDS_DELETE_ALL_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONWARNING | MB_YESNO); |
| 328 | if (result == IDYES) { |
| 329 | if (SavedPasswords::ClearSavedPasswords(TRUE) != numSavedPasswords) { |
| 330 | MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | |
| 338 | void CSettingsPropertyPage::OnClickedNeverSaveHistory() |
nothing calls this directly
no test coverage detected