[BUG_FIXED] Fix localization switching under Windows 7 problem (UAC issue).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@711 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 2010-11-20 21:13:47 +00:00
parent 38035762dd
commit 079353cd4c
2 changed files with 113 additions and 7 deletions

View File

@ -719,12 +719,18 @@ bool NppParameters::reloadStylers(TCHAR *stylePath)
bool NppParameters::reloadLang()
{
generic_string nativeLangPath(_nppPath);
// use user path
#ifdef UNICODE
generic_string nativeLangPath(_localizationSwitcher._nativeLangPath);
#else
generic_string nativeLangPath(_userPath);
PathAppend(nativeLangPath, generic_string(TEXT("nativeLang.xml")));
#endif
// if "nativeLang.xml" does not exist, use npp path
if (!PathFileExists(nativeLangPath.c_str()))
{
nativeLangPath = _userPath;
nativeLangPath = _nppPath;
PathAppend(nativeLangPath, generic_string(TEXT("nativeLang.xml")));
if (!PathFileExists(nativeLangPath.c_str()))
return false;
@ -833,7 +839,7 @@ bool NppParameters::load()
if (doRecover)
{
generic_string srcLangsPath(_userPath);
generic_string srcLangsPath(_nppPath);
PathAppend(srcLangsPath, TEXT("langs.model.xml"));
::CopyFile(srcLangsPath.c_str(), langs_xml_path.c_str(), FALSE);
}
@ -955,7 +961,12 @@ bool NppParameters::load()
//----------------------------------------------//
generic_string nativeLangPath(_userPath);
PathAppend(nativeLangPath, TEXT("nativeLang.xml"));
// LocalizationSwitcher should use always user path
#ifdef UNICODE
_localizationSwitcher._nativeLangPath = nativeLangPath;
#endif
if (!PathFileExists(nativeLangPath.c_str()))
{
nativeLangPath = _nppPath;
@ -971,9 +982,7 @@ bool NppParameters::load()
_pXmlNativeLangDocA = NULL;
isAllLaoded = false;
}
#ifdef UNICODE
_localizationSwitcher._nativeLangPath = nativeLangPath;
#endif
//---------------------------------//
// toolbarIcons.xml : for per user //
//---------------------------------//

View File

@ -390,6 +390,103 @@
CommandLine="copy ..\src\config.model.xml ..\installer\zipped.package.release\ansi\config.model.xml
copy ..\src\langs.model.xml ..\installer\zipped.package.release\ansi\langs.model.xml
copy ..\src\stylers.model.xml ..\installer\zipped.package.release\ansi\stylers.model.xml
copy ..\src\shortcuts.xml ..\installer\zipped.package.release\ansi\shortcuts.xml
copy ..\src\contextMenu.xml ..\installer\zipped.package.release\ansi\contextMenu.xml
..\misc\vistaIconTool\changeIcon.bat "..\misc\vistaIconTool\ReplaceVistaIcon.exe" "$(OutDir)\notepad++.exe"
"
/>
</Configuration>
<Configuration
Name="Old icon (Unicode Relase)|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops;.\no_ms_shit.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="0"
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL"
GeneratePreprocessedFile="0"
StringPooling="true"
ExceptionHandling="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="precompiledHeaders.h"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib shlwapi.lib shell32.lib Oleacc.lib"
ShowProgress="2"
OutputFile="$(OutDir)/notepad++.exe"
Version="1.0"
LinkIncremental="1"
TypeLibraryFile=""
TypeLibraryResourceID="1"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\npp.pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy ..\src\config.model.xml ..\bin\config.model.xml&#x0D;&#x0A;copy ..\src\langs.model.xml ..\bin\langs.model.xml&#x0D;&#x0A;copy ..\src\stylers.model.xml ..\bin\stylers.model.xml&#x0D;&#x0A;copy ..\src\shortcuts.xml ..\bin\shortcuts.xml&#x0D;&#x0A;copy ..\src\contextMenu.xml ..\bin\contextMenu.xml&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>