OSDN Git Service

enable retry to escape NLS keys only on fail by timeout v0.02
authorU-i7\gimy <gimy@users.sourceforge.jp>
Sat, 29 Aug 2009 16:04:11 +0000 (01:04 +0900)
committerU-i7\gimy <gimy@users.sourceforge.jp>
Sat, 29 Aug 2009 16:04:11 +0000 (01:04 +0900)
mayu.cpp
mayu.rc
mayurc.h

index f83f19e..e2c65e0 100644 (file)
--- a/mayu.cpp
+++ b/mayu.cpp
@@ -481,12 +481,23 @@ private:
 \r
                        case WM_APP_escapeNLSKeysFailed:\r
                                if (i_lParam) {\r
+                                       int ret;\r
+\r
                                        This->m_log << _T("escape NLS keys done code=") << i_wParam << std::endl;\r
-                                       if (i_wParam != YAMY_SUCCESS && i_wParam != YAMY_ERROR_RETRY_INJECTION_SUCCESS) {\r
-                                               int ret = This->errorDialogWithCode(IDS_escapeNlsKeysFailed, i_wParam, MB_RETRYCANCEL | MB_ICONSTOP);\r
+                                       switch (i_wParam) {\r
+                                       case YAMY_SUCCESS:\r
+                                       case YAMY_ERROR_RETRY_INJECTION_SUCCESS:\r
+                                               // escape NLS keys success\r
+                                               break;\r
+                                       case YAMY_ERROR_TIMEOUT_INJECTION:\r
+                                               ret = This->errorDialogWithCode(IDS_escapeNlsKeysRetry, i_wParam, MB_RETRYCANCEL | MB_ICONSTOP);\r
                                                if (ret == IDRETRY) {\r
                                                        This->m_fixScancodeMap.escape(true);\r
                                                }\r
+                                               break;\r
+                                       default:\r
+                                               This->errorDialogWithCode(IDS_escapeNlsKeysFailed, i_wParam, MB_OK);\r
+                                               break;\r
                                        }\r
                                } else {\r
                                        This->m_log << _T("restore NLS keys done with code=") << i_wParam << std::endl;\r
diff --git a/mayu.rc b/mayu.rc
index 43707cb..f1fd923 100755 (executable)
--- a/mayu.rc
+++ b/mayu.rc
@@ -245,7 +245,8 @@ BEGIN
     IDS_readFromHomeDirectory "(\83z\81[\83\80\83f\83B\83\8c\83N\83g\83\8a\82©\82ç)"\r
     IDS_cannotInvoke        "%s \82ð\8bN\93®\82Å\82«\82Ü\82¹\82ñ(0x%08x)"\r
     IDS_cannotPermitStandardUser "\95W\8f\80\83\86\81[\83U\82Ö\82Ì\8b\96\89Â\82É\8e¸\94s\82µ\82Ü\82µ\82½(\83G\83\89\81[\83R\81[\83h=%d)"\r
-    IDS_escapeNlsKeysFailed "NLS\83L\81[\82Ì\83G\83X\83P\81[\83v\82É\8e¸\94s\82µ\82Ü\82µ\82½(\83G\83\89\81[\83R\81[\83h=%d) \8dÄ\8e\8e\8ds\82µ\82Ü\82·\82©\81H"\r
+    IDS_escapeNlsKeysFailed "NLS\83L\81[\82Ì\83G\83X\83P\81[\83v\82É\8e¸\94s\82µ\82Ü\82µ\82½(\83G\83\89\81[\83R\81[\83h=%d)"\r
+    IDS_escapeNlsKeysRetry  "NLS\83L\81[\82Ì\83G\83X\83P\81[\83v\82É\8e¸\94s\82µ\82Ü\82µ\82½(\83G\83\89\81[\83R\81[\83h=%d) \8dÄ\8e\8e\8ds\82µ\82Ü\82·\82©\81H"\r
 END\r
 \r
 STRINGTABLE DISCARDABLE \r
@@ -491,7 +492,8 @@ BEGIN
     IDS_readFromHomeDirectory "(from home directory)"\r
     IDS_cannotInvoke        "can't invoke %s(0x%08x)"\r
     IDS_cannotPermitStandardUser "failed to permit standard user(error code=%d)"\r
-    IDS_escapeNlsKeysFailed "failed to escape NLS keys(error code=%d), retry?"\r
+    IDS_escapeNlsKeysFailed "failed to escape NLS keys(error code=%d)"\r
+    IDS_escapeNlsKeysRetry  "failed to escape NLS keys(error code=%d), retry?"\r
 END\r
 \r
 STRINGTABLE DISCARDABLE \r
index 191f362..6a52971 100644 (file)
--- a/mayurc.h
+++ b/mayurc.h
@@ -30,6 +30,7 @@
 #define IDS_cannotInvoke                30\r
 #define IDS_cannotPermitStandardUser    31\r
 #define IDS_escapeNlsKeysFailed         32\r
+#define IDS_escapeNlsKeysRetry          33\r
 #define IDC_CURSOR_target               101\r
 #define IDD_DIALOG_editSetting          102\r
 #define IDD_DIALOG_investigate          103\r