OSDN Git Service

Merge with stable
authorsdottaka <sdottaka@users.sourceforge.net>
Sat, 21 Feb 2015 14:51:24 +0000 (23:51 +0900)
committersdottaka <sdottaka@users.sourceforge.net>
Sat, 21 Feb 2015 14:51:24 +0000 (23:51 +0900)
1  2 
Src/Common/LanguageSelect.cpp
Src/Common/LanguageSelect.h
Src/MainFrm.cpp
Src/MainFrm.h
Src/Merge.cpp
Src/Merge.h
Src/Merge.vcxproj
Src/Merge.vcxproj.filters
Src/PropGeneral.cpp
Src/PropGeneral.h
Translations/WinMerge/English.pot

@@@ -7,22 -7,9 +7,11 @@@
  #include "StdAfx.h"
  #include "LanguageSelect.h"
  #include <locale.h>
- #include <sstream>
- #include "OptionsDef.h"
- #include "OptionsMgr.h"
- #include "Merge.h"
  #include "version.h"
- #include "resource.h"
  #include "BCMenu.h"
- #include "MainFrm.h"
- #include "OpenFrm.h"
- #include "ChildFrm.h"
- #include "DirFrame.h"
- #include "HexMergeFrm.h"
- #include "ImgMergeFrm.h"
 +#include "paths.h"
  #include "Environment.h"
 +#include "unicoder.h"
  
  // Escaped character constants in range 0x80-0xFF are interpreted in current codepage
  // Using C locale gets us direct mapping to Unicode codepoints
@@@ -796,14 -758,12 +764,13 @@@ BOOL CLanguageSelect::LoadLanguageFile(
                FreeLibrary(m_hCurrentDll);
                m_hCurrentDll = 0;
                m_strarray.clear();
 +              m_map_lineno.clear();
                m_codepage = 0;
-               if (m_hWnd)
+               if (bShowError)
                {
-                       std_tchar(ostringstream) stm;
-                       stm << _T("Unresolved or mismatched references detected when ")
-                               _T("attempting to read translations from\n") << strPath.c_str();
-                       AfxMessageBox(stm.str().c_str(), MB_ICONSTOP);
+                       String str = _T("Unresolved or mismatched references detected when ")
+                               _T("attempting to read translations from\n") + strPath;
+                       AfxMessageBox(str.c_str(), MB_ICONSTOP);
                }
                return FALSE;
        }
@@@ -1102,173 -1024,11 +1043,11 @@@ std::wstring CLanguageSelect::LoadDialo
  /**
   * @brief Load languages available on disk, and display in list, and select current
   */
- void CLanguageSelect::LoadAndDisplayLanguages()
+ std::vector<std::pair<LANGID, String> > CLanguageSelect::GetAvailableLanguages() const
  {
 -      String path = env_GetProgPath().append(szRelativePath);
 -      String pattern = path + _T("*.po");
+       std::vector<std::pair<LANGID, String> > list;
 +      String path = paths_ConcatPath(env_GetProgPath(), szRelativePath);
 +      String pattern = paths_ConcatPath(path, _T("*.po"));
        WIN32_FIND_DATA ff;
        HANDLE h = INVALID_HANDLE_VALUE;
        do
                LangFileInfo &lfi =
                        h == INVALID_HANDLE_VALUE
                ?       LangFileInfo(wSourceLangId)
 -              :       LangFileInfo((path + ff.cFileName).c_str());
 +              :       LangFileInfo(paths_ConcatPath(path, ff.cFileName).c_str());
-               std_tchar(ostringstream) stm;
-               stm << lfi.GetString(LOCALE_SLANGUAGE).c_str();
-               stm << _T(" - ");
-               stm << lfi.GetString(LOCALE_SNATIVELANGNAME|LOCALE_USE_CP_ACP).c_str();
-               stm << _T(" (");
-               stm << lfi.GetString(LOCALE_SNATIVECTRYNAME|LOCALE_USE_CP_ACP).c_str();
-               stm << _T(")");
-               /*stm << _T(" - ");
-               stm << lfi.GetString(LOCALE_SABBREVLANGNAME|LOCALE_USE_CP_ACP).c_str();
-               stm << _T(" (");
-               stm << lfi.GetString(LOCALE_SABBREVCTRYNAME|LOCALE_USE_CP_ACP).c_str();
-               stm << _T(") ");*/
-               stm << _T(" - ");
-               stm << lfi.GetString(LOCALE_SENGLANGUAGE).c_str();
-               stm << _T(" (");
-               stm << lfi.GetString(LOCALE_SENGCOUNTRY).c_str();
-               stm << _T(")");
-               int i = m_ctlLangList.AddString(stm.str().c_str());
-               m_ctlLangList.SetItemData(i, lfi.id);
-               if (lfi.id == m_wCurLanguage)
-                       m_ctlLangList.SetCurSel(i);
+               String str;
+               str += lfi.GetString(LOCALE_SLANGUAGE);
+               str += _T(" - ");
+               str += lfi.GetString(LOCALE_SNATIVELANGNAME | LOCALE_USE_CP_ACP);
+               str += _T(" (");
+               str += lfi.GetString(LOCALE_SNATIVECTRYNAME | LOCALE_USE_CP_ACP);
+               str += _T(")");
+               str += _T(" - ");
+               str += lfi.GetString(LOCALE_SENGLANGUAGE);
+               str += _T(" (");
+               str += lfi.GetString(LOCALE_SENGCOUNTRY);
+               str += _T(")");
+               list.emplace_back(lfi.id, str);
        } while ((h = FindFile(h, pattern.c_str(), &ff)) != INVALID_HANDLE_VALUE);
+       return list;
  }
  
  /**
@@@ -7,14 -7,12 +7,14 @@@
  
  #include <vector>
  #include <string>
 +#include <map>
 +#include "CMoveConstraint.h"
  
  /////////////////////////////////////////////////////////////////////////////
- // CLanguageSelect dialog
+ // CLanguageSelect class
  
  /**
-  * @brief Dialog for selecting GUI language.
+  * @brief Class for selecting GUI language.
   *
   * Language select dialog shows list of installed GUI languages and
   * allows user to select one for use.
diff --cc Src/MainFrm.cpp
Simple merge
diff --cc Src/MainFrm.h
Simple merge
diff --cc Src/Merge.cpp
Simple merge
diff --cc Src/Merge.h
Simple merge
Simple merge
Simple merge
@@@ -31,7 -31,7 +31,8 @@@
  #include "OptionsDef.h"
  #include "OptionsMgr.h"
  #include "OptionsPanel.h"
+ #include "LanguageSelect.h"
 +#include "DDXHelper.h"
  
  #ifdef _DEBUG
  #define new DEBUG_NEW
@@@ -26,17 -26,18 +26,18 @@@ public
  // Dialog Data
        //{{AFX_DATA(PropGeneral)
        enum { IDD = IDD_PROPPAGE_GENERAL };
 -      BOOL  m_bScroll;
 -      BOOL  m_bSingleInstance;
 -      BOOL  m_bVerifyPaths;
 -      BOOL  m_bCloseWindowWithEsc;
 -      BOOL  m_bAskMultiWindowClose;
 -      BOOL    m_bMultipleFileCmp;
 -      BOOL    m_bMultipleDirCmp;
 -      int             m_nAutoCompleteSource;
 -      BOOL    m_bPreserveFiletime;
 -      BOOL    m_bShowSelectFolderOnStartup;
 -      BOOL    m_bCloseWithOK;
 +      bool  m_bScroll;
 +      bool  m_bSingleInstance;
 +      bool  m_bVerifyPaths;
 +      bool  m_bCloseWindowWithEsc;
 +      bool  m_bAskMultiWindowClose;
 +      bool  m_bMultipleFileCmp;
 +      bool  m_bMultipleDirCmp;
 +      int   m_nAutoCompleteSource;
 +      bool  m_bPreserveFiletime;
 +      bool  m_bShowSelectFolderOnStartup;
 +      bool  m_bCloseWithOK;
+       CComboBox       m_ctlLangList;
        //}}AFX_DATA
  
  
@@@ -8,7 -8,7 +8,7 @@@ msgid "
  msgstr ""
  "Project-Id-Version: WinMerge\n"
  "Report-Msgid-Bugs-To: http://bugs.winmerge.org/\n"
- "POT-Creation-Date: 2015-02-17 15:14+0000\n"
 -"POT-Creation-Date: 2015-02-21 22:37+0000\n"
++"POT-Creation-Date: 2015-02-21 23:39+0000\n"
  "PO-Revision-Date: \n"
  "Last-Translator: \n"
  "Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"