diff options
author | elfmz <fenix1905@tut.by> | 2022-02-20 02:02:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-20 02:02:21 +0300 |
commit | e0f3f14fb3d648ba640e75cf25e257ac8fde4865 (patch) | |
tree | a88b1d0d075cd8a951a757e45114cf64a8cd6fb3 /far2l/src/mix | |
parent | dc2f6de4c2f438046b4d31cf4c2078b6ad65a5ce (diff) |
Language refactor (#1271)
optimized and refactored language files loader
got rid of MSG() macro and use Msg:: namespace instead
Diffstat (limited to 'far2l/src/mix')
-rw-r--r-- | far2l/src/mix/dirmix.cpp | 5 | ||||
-rw-r--r-- | far2l/src/mix/panelmix.cpp | 6 | ||||
-rw-r--r-- | far2l/src/mix/strmix.cpp | 3 |
3 files changed, 6 insertions, 8 deletions
diff --git a/far2l/src/mix/dirmix.cpp b/far2l/src/mix/dirmix.cpp index a7a7c51d..9439a818 100644 --- a/far2l/src/mix/dirmix.cpp +++ b/far2l/src/mix/dirmix.cpp @@ -38,7 +38,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cvtname.hpp" #include "message.hpp" #include "lang.hpp" -#include "language.hpp" #include "ctrlobj.hpp" #include "filepanels.hpp" #include "treelist.hpp" @@ -167,13 +166,13 @@ int CheckShortcutFolder(FARString *pTestPath,int IsHostFile, BOOL Silent) WINPORT(SetLastError)(ERROR_FILE_NOT_FOUND); if (!Silent) - Message(MSG_WARNING | MSG_ERRORTYPE, 1, MError, strTarget, MOk); + Message(MSG_WARNING | MSG_ERRORTYPE, 1, Msg::Error, strTarget, Msg::Ok); } else // попытка найти! { WINPORT(SetLastError)(ERROR_PATH_NOT_FOUND); - if (Silent || !Message(MSG_WARNING | MSG_ERRORTYPE, 2, MError, strTarget, MNeedNearPath, MHYes,MHNo)) + if (Silent || !Message(MSG_WARNING | MSG_ERRORTYPE, 2, Msg::Error, strTarget, Msg::NeedNearPath, Msg::HYes,Msg::HNo)) { FARString strTestPathTemp = *pTestPath; diff --git a/far2l/src/mix/panelmix.cpp b/far2l/src/mix/panelmix.cpp index 57fb8499..5394e2a5 100644 --- a/far2l/src/mix/panelmix.cpp +++ b/far2l/src/mix/panelmix.cpp @@ -581,15 +581,15 @@ const FARString FormatStr_Size(int64_t FileSize, int64_t PhysicalSize, const FAR if (!Physical && (FileAttributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_REPARSE_POINT)) && !ShowFolderSize) { - const wchar_t *PtrName=MSG(MListFolder); + const wchar_t *PtrName=Msg::ListFolder; if (TestParentFolderName(strName)) { - PtrName=MSG(MListUp); + PtrName=Msg::ListUp; } else if (FileAttributes&FILE_ATTRIBUTE_REPARSE_POINT) { - PtrName=MSG(MListSymLink); + PtrName=Msg::ListSymLink; } strResult<<fmt::Width(Width)<<fmt::Precision(Width); diff --git a/far2l/src/mix/strmix.cpp b/far2l/src/mix/strmix.cpp index 00dd62de..1e422050 100644 --- a/far2l/src/mix/strmix.cpp +++ b/far2l/src/mix/strmix.cpp @@ -36,7 +36,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "strmix.hpp" #include "lang.hpp" -#include "language.hpp" #include "config.hpp" #include "pathmix.hpp" #include "RegExp.hpp" @@ -676,7 +675,7 @@ void PrepareUnitStr() { for (int i=0; i<UNIT_COUNT; i++) { - far_wcsncpy(UnitStr[i][0],MSG(MListBytes+i),MAX_UNITSTR_SIZE); + far_wcsncpy(UnitStr[i][0], (Msg::ListBytes+i), MAX_UNITSTR_SIZE); wcscpy(UnitStr[i][1],UnitStr[i][0]); WINPORT(CharLower)(UnitStr[i][0]); WINPORT(CharUpper)(UnitStr[i][1]); |