From 90b42d5268ddf18789020f657535037028f5fc25 Mon Sep 17 00:00:00 2001 From: "U-i7\\gimy" Date: Sun, 30 Aug 2009 01:04:11 +0900 Subject: [PATCH] enable retry to escape NLS keys only on fail by timeout --- mayu.cpp | 15 +++++++++++++-- mayu.rc | 6 ++++-- mayurc.h | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mayu.cpp b/mayu.cpp index f83f19e..e2c65e0 100644 --- a/mayu.cpp +++ b/mayu.cpp @@ -481,12 +481,23 @@ private: case WM_APP_escapeNLSKeysFailed: if (i_lParam) { + int ret; + This->m_log << _T("escape NLS keys done code=") << i_wParam << std::endl; - if (i_wParam != YAMY_SUCCESS && i_wParam != YAMY_ERROR_RETRY_INJECTION_SUCCESS) { - int ret = This->errorDialogWithCode(IDS_escapeNlsKeysFailed, i_wParam, MB_RETRYCANCEL | MB_ICONSTOP); + switch (i_wParam) { + case YAMY_SUCCESS: + case YAMY_ERROR_RETRY_INJECTION_SUCCESS: + // escape NLS keys success + break; + case YAMY_ERROR_TIMEOUT_INJECTION: + ret = This->errorDialogWithCode(IDS_escapeNlsKeysRetry, i_wParam, MB_RETRYCANCEL | MB_ICONSTOP); if (ret == IDRETRY) { This->m_fixScancodeMap.escape(true); } + break; + default: + This->errorDialogWithCode(IDS_escapeNlsKeysFailed, i_wParam, MB_OK); + break; } } else { This->m_log << _T("restore NLS keys done with code=") << i_wParam << std::endl; diff --git a/mayu.rc b/mayu.rc index 43707cb..f1fd923 100755 --- a/mayu.rc +++ b/mayu.rc @@ -245,7 +245,8 @@ BEGIN IDS_readFromHomeDirectory "(ƒz[ƒ€ƒfƒBƒŒƒNƒgƒŠ‚©‚ç)" IDS_cannotInvoke "%s ‚ð‹N“®‚Å‚«‚Ü‚¹‚ñ(0x%08x)" IDS_cannotPermitStandardUser "•W€ƒ†[ƒU‚Ö‚Ì‹–‰Â‚ÉŽ¸”s‚µ‚Ü‚µ‚½(ƒGƒ‰[ƒR[ƒh=%d)" - IDS_escapeNlsKeysFailed "NLSƒL[‚̃GƒXƒP[ƒv‚ÉŽ¸”s‚µ‚Ü‚µ‚½(ƒGƒ‰[ƒR[ƒh=%d) ÄŽŽs‚µ‚Ü‚·‚©H" + IDS_escapeNlsKeysFailed "NLSƒL[‚̃GƒXƒP[ƒv‚ÉŽ¸”s‚µ‚Ü‚µ‚½(ƒGƒ‰[ƒR[ƒh=%d)" + IDS_escapeNlsKeysRetry "NLSƒL[‚̃GƒXƒP[ƒv‚ÉŽ¸”s‚µ‚Ü‚µ‚½(ƒGƒ‰[ƒR[ƒh=%d) ÄŽŽs‚µ‚Ü‚·‚©H" END STRINGTABLE DISCARDABLE @@ -491,7 +492,8 @@ BEGIN IDS_readFromHomeDirectory "(from home directory)" IDS_cannotInvoke "can't invoke %s(0x%08x)" IDS_cannotPermitStandardUser "failed to permit standard user(error code=%d)" - IDS_escapeNlsKeysFailed "failed to escape NLS keys(error code=%d), retry?" + IDS_escapeNlsKeysFailed "failed to escape NLS keys(error code=%d)" + IDS_escapeNlsKeysRetry "failed to escape NLS keys(error code=%d), retry?" END STRINGTABLE DISCARDABLE diff --git a/mayurc.h b/mayurc.h index 191f362..6a52971 100644 --- a/mayurc.h +++ b/mayurc.h @@ -30,6 +30,7 @@ #define IDS_cannotInvoke 30 #define IDS_cannotPermitStandardUser 31 #define IDS_escapeNlsKeysFailed 32 +#define IDS_escapeNlsKeysRetry 33 #define IDC_CURSOR_target 101 #define IDD_DIALOG_editSetting 102 #define IDD_DIALOG_investigate 103 -- 2.11.0