mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #532 from RaiKoHoff/MiniPath_Lng
MiniPath enhancements
This commit is contained in:
commit
18cb9a511b
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0436</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0436</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0436</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0436</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0407</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0407</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0407</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0407</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0809</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0809</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0809</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0809</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0c0a</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0c0a</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0c0a</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0c0a</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x040c</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x040c</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x040c</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x040c</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0413</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -142,7 +142,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0413</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -172,7 +172,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0413</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -202,7 +202,7 @@
|
||||
<Message>MUI Split</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<Culture>0x0413</Culture>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -649,7 +649,8 @@ extern WCHAR g_wchIniFile[MAX_PATH];
|
||||
extern BOOL bSaveSettings;
|
||||
extern WCHAR szQuickview[MAX_PATH];
|
||||
extern WCHAR szQuickviewParams[MAX_PATH];
|
||||
extern WCHAR tchFavoritesDir[MAX_PATH];
|
||||
extern WCHAR g_tchFavoritesDir[MAX_PATH];
|
||||
extern BOOL bNP3sFavoritesSettings;
|
||||
extern BOOL bClearReadOnly;
|
||||
extern BOOL bRenameOnCollision;
|
||||
extern BOOL bSingleClick;
|
||||
@ -1119,7 +1120,7 @@ INT_PTR CALLBACK ProgPageProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
SHAutoComplete(GetDlgItem(hwnd,IDC_QUICKVIEW),SHACF_FILESYSTEM);
|
||||
|
||||
SendDlgItemMessage(hwnd,IDC_FAVORITES,EM_LIMITTEXT,MAX_PATH - 2,0);
|
||||
SetDlgItemText(hwnd,IDC_FAVORITES,tchFavoritesDir);
|
||||
SetDlgItemText(hwnd,IDC_FAVORITES,g_tchFavoritesDir);
|
||||
SHAutoComplete(GetDlgItem(hwnd,IDC_FAVORITES),SHACF_FILESYSTEM);
|
||||
}
|
||||
return TRUE;
|
||||
@ -1184,9 +1185,9 @@ INT_PTR CALLBACK ProgPageProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
GetDlgItemText(hwnd,IDC_FAVORITES,tch,COUNTOF(tch));
|
||||
StrTrim(tch,L" \"");
|
||||
|
||||
if (GetDirectory(hwnd,IDS_FAVORITES,tch,tch,FALSE))
|
||||
SetDlgItemText(hwnd,IDC_FAVORITES,tch);
|
||||
|
||||
if (GetDirectory(hwnd, IDS_FAVORITES, tch, tch, FALSE)) {
|
||||
SetDlgItemText(hwnd, IDC_FAVORITES, tch);
|
||||
}
|
||||
PostMessage(hwnd,WM_NEXTDLGCTL,1,0);
|
||||
}
|
||||
break;
|
||||
@ -1203,7 +1204,7 @@ INT_PTR CALLBACK ProgPageProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
case PSN_APPLY: {
|
||||
|
||||
WCHAR tch[MAX_PATH];
|
||||
WCHAR tch[MAX_PATH] = L"";
|
||||
|
||||
if (!GetDlgItemText(hwnd,IDC_QUICKVIEW,tch,MAX_PATH)) {
|
||||
|
||||
@ -1216,21 +1217,22 @@ INT_PTR CALLBACK ProgPageProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
else
|
||||
ExtractFirstArgument(tch,szQuickview,szQuickviewParams);
|
||||
|
||||
if (!GetDlgItemText(hwnd,IDC_FAVORITES,tchFavoritesDir,MAX_PATH))
|
||||
GetDefaultFavoritesDir(tchFavoritesDir,COUNTOF(tchFavoritesDir));
|
||||
lstrcpy(tch, g_tchFavoritesDir);
|
||||
if (!GetDlgItemText(hwnd, IDC_FAVORITES, g_tchFavoritesDir, MAX_PATH)) {
|
||||
GetDefaultFavoritesDir(g_tchFavoritesDir, COUNTOF(g_tchFavoritesDir));
|
||||
}
|
||||
else
|
||||
StrTrim(tchFavoritesDir,L" \"");
|
||||
StrTrim(g_tchFavoritesDir,L" \"");
|
||||
|
||||
if (lstrcmpi(tch, g_tchFavoritesDir) != 0) { bNP3sFavoritesSettings = FALSE; }
|
||||
|
||||
SetWindowLongPtr(hwnd,DWLP_MSGRESULT,PSNRET_NOERROR);
|
||||
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1168,7 +1168,7 @@ void PathCanonicalizeEx(LPWSTR lpSrc)
|
||||
//
|
||||
// This Expansion also searches the L"Favorites" folder
|
||||
//
|
||||
extern WCHAR tchFavoritesDir[MAX_PATH];
|
||||
extern WCHAR g_tchFavoritesDir[MAX_PATH];
|
||||
extern WCHAR szCurDir[MAX_PATH];
|
||||
|
||||
DWORD SearchPathEx(LPCWSTR lpPath,LPCWSTR lpFileName,LPCWSTR lpExtension,
|
||||
@ -1194,7 +1194,7 @@ DWORD SearchPathEx(LPCWSTR lpPath,LPCWSTR lpFileName,LPCWSTR lpExtension,
|
||||
|
||||
// Search L"Favorites" if no result
|
||||
if (!dwRetVal)
|
||||
dwRetVal = SearchPath(tchFavoritesDir,lpFileName,lpExtension,
|
||||
dwRetVal = SearchPath(g_tchFavoritesDir,lpFileName,lpExtension,
|
||||
nBufferLength,lpBuffer,lpFilePart);
|
||||
}
|
||||
|
||||
@ -1243,19 +1243,15 @@ int FormatNumberStr(LPWSTR lpNumberStr)
|
||||
//
|
||||
void GetDefaultFavoritesDir(LPWSTR lpFavDir,int cchFavDir)
|
||||
{
|
||||
|
||||
LPITEMIDLIST pidl;
|
||||
|
||||
if (NOERROR == SHGetSpecialFolderLocation(
|
||||
NULL,CSIDL_PERSONAL,&pidl))
|
||||
{
|
||||
SHGetPathFromIDList(pidl,lpFavDir);
|
||||
CoTaskMemFree(pidl);
|
||||
}
|
||||
|
||||
else
|
||||
GetWindowsDirectory(lpFavDir,cchFavDir);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -72,15 +72,18 @@ HISTORY mHistory;
|
||||
|
||||
WCHAR g_wchIniFile[MAX_PATH] = L"";
|
||||
WCHAR g_wchIniFile2[MAX_PATH] = L"";
|
||||
WCHAR g_wchNP3IniFile[MAX_PATH] = L"";
|
||||
|
||||
BOOL bSaveSettings;
|
||||
WCHAR szQuickview[MAX_PATH];
|
||||
WCHAR szQuickviewParams[MAX_PATH];
|
||||
WCHAR tchFavoritesDir[MAX_PATH];
|
||||
WCHAR tchOpenWithDir[MAX_PATH];
|
||||
WCHAR tchToolbarButtons[512];
|
||||
WCHAR tchToolbarBitmap[MAX_PATH];
|
||||
WCHAR tchToolbarBitmapHot[MAX_PATH];
|
||||
WCHAR tchToolbarBitmapDisabled[MAX_PATH];
|
||||
WCHAR szQuickview[MAX_PATH] = L"";
|
||||
WCHAR szQuickviewParams[MAX_PATH] = L"";
|
||||
WCHAR g_tchFavoritesDir[MAX_PATH] = L"";
|
||||
BOOL bNP3sFavoritesSettings = FALSE;
|
||||
WCHAR tchOpenWithDir[MAX_PATH] = L"";
|
||||
WCHAR tchToolbarButtons[512] = L"";
|
||||
WCHAR tchToolbarBitmap[MAX_PATH] = L"";
|
||||
WCHAR tchToolbarBitmapHot[MAX_PATH] = L"";
|
||||
WCHAR tchToolbarBitmapDisabled[MAX_PATH] = L"";
|
||||
BOOL bClearReadOnly;
|
||||
BOOL bRenameOnCollision;
|
||||
BOOL bSingleClick;
|
||||
@ -500,12 +503,12 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow)
|
||||
ErrorMessage(2,IDS_ERR_STARTUPDIR);
|
||||
}
|
||||
else
|
||||
DisplayPath(tchFavoritesDir,IDS_ERR_STARTUPDIR);
|
||||
DisplayPath(g_tchFavoritesDir,IDS_ERR_STARTUPDIR);
|
||||
}
|
||||
|
||||
// Favorites
|
||||
else if (flagGotoFavorites)
|
||||
DisplayPath(tchFavoritesDir,IDS_ERR_FAVORITES);
|
||||
DisplayPath(g_tchFavoritesDir,IDS_ERR_FAVORITES);
|
||||
|
||||
// Update Dirlist
|
||||
if (!ListView_GetItemCount(hwndDirList))
|
||||
@ -1970,7 +1973,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
case IDM_VIEW_FAVORITES:
|
||||
// Goto Favorites Directory
|
||||
DisplayPath(tchFavoritesDir,IDS_ERR_FAVORITES);
|
||||
DisplayPath(g_tchFavoritesDir,IDS_ERR_FAVORITES);
|
||||
break;
|
||||
|
||||
|
||||
@ -1981,7 +1984,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
sei.fMask = 0;
|
||||
sei.hwnd = hwnd;
|
||||
sei.lpVerb = NULL;
|
||||
sei.lpFile = tchFavoritesDir;
|
||||
sei.lpFile = g_tchFavoritesDir;
|
||||
sei.lpParameters = NULL;
|
||||
sei.lpDirectory = NULL;
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
@ -2043,7 +2046,6 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
BOOL bCreateFailure = FALSE;
|
||||
|
||||
if (lstrlen(g_wchIniFile) == 0) {
|
||||
|
||||
if (lstrlen(g_wchIniFile2) > 0) {
|
||||
if (CreateIniFileEx(g_wchIniFile2)) {
|
||||
lstrcpy(g_wchIniFile,g_wchIniFile2);
|
||||
@ -2052,13 +2054,12 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
else
|
||||
bCreateFailure = TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bCreateFailure) {
|
||||
|
||||
if (!bCreateFailure)
|
||||
{
|
||||
if (WritePrivateProfileString(L"Settings",L"WriteTest",L"ok",g_wchIniFile)) {
|
||||
BeginWaitCursor();
|
||||
SaveSettings(TRUE);
|
||||
@ -2826,11 +2827,17 @@ void LoadSettings()
|
||||
iStartupDir = IniSectionGetInt(pIniSection,L"StartupDirectory",2);
|
||||
iStartupDir = max(min(iStartupDir,2),0);
|
||||
|
||||
if (!IniSectionGetString(pIniSection,L"Favorites",L"",
|
||||
tchFavoritesDir,COUNTOF(tchFavoritesDir)))
|
||||
SHGetFolderPath(NULL,CSIDL_PERSONAL,NULL,SHGFP_TYPE_CURRENT,tchFavoritesDir);
|
||||
if (!IniSectionGetString(pIniSection, L"Favorites", L"",
|
||||
g_tchFavoritesDir, COUNTOF(g_tchFavoritesDir))) {
|
||||
// try to fetch Locale Name from Notepad3.ini
|
||||
GetPrivateProfileString(L"Settings", L"Favorites", L"",
|
||||
g_tchFavoritesDir, COUNTOF(g_tchFavoritesDir), g_wchNP3IniFile);
|
||||
if (lstrlen(g_wchNP3IniFile)) { bNP3sFavoritesSettings = TRUE; }
|
||||
}
|
||||
if (!lstrlen(g_tchFavoritesDir))
|
||||
SHGetFolderPath(NULL,CSIDL_PERSONAL,NULL,SHGFP_TYPE_CURRENT,g_tchFavoritesDir);
|
||||
else
|
||||
PathAbsoluteFromApp(tchFavoritesDir,NULL,COUNTOF(tchFavoritesDir),TRUE);
|
||||
PathAbsoluteFromApp(g_tchFavoritesDir,NULL,COUNTOF(g_tchFavoritesDir),TRUE);
|
||||
|
||||
if (!IniSectionGetString(pIniSection,L"Quikview.exe",L"",
|
||||
szQuickview,COUNTOF(szQuickview))) {
|
||||
@ -2997,8 +3004,10 @@ void SaveSettings(BOOL bSaveSettingsNow)
|
||||
IniSectionSetInt(pIniSection,L"StartupDirectory",iStartupDir);
|
||||
if (iStartupDir == 1)
|
||||
IniSectionSetString(pIniSection,L"MRUDirectory",szCurDir);
|
||||
PathRelativeToApp(tchFavoritesDir,wchTmp,COUNTOF(wchTmp),FALSE,TRUE,flagPortableMyDocs);
|
||||
IniSectionSetString(pIniSection,L"Favorites",wchTmp);
|
||||
if (!bNP3sFavoritesSettings) {
|
||||
PathRelativeToApp(g_tchFavoritesDir, wchTmp, COUNTOF(wchTmp), FALSE, TRUE, flagPortableMyDocs);
|
||||
IniSectionSetString(pIniSection, L"Favorites", wchTmp);
|
||||
}
|
||||
PathRelativeToApp(szQuickview,wchTmp,COUNTOF(wchTmp),FALSE,TRUE,flagPortableMyDocs);
|
||||
IniSectionSetString(pIniSection,L"Quikview.exe",wchTmp);
|
||||
IniSectionSetString(pIniSection,L"QuikviewParams",szQuickviewParams);
|
||||
@ -3183,8 +3192,13 @@ void LoadFlags()
|
||||
|
||||
LoadIniSection(L"Settings2",pIniSection,cchIniSection);
|
||||
|
||||
IniSectionGetString(pIniSection, L"PreferedLanguageLocaleName", L"",
|
||||
g_tchPrefLngLocName, COUNTOF(g_tchPrefLngLocName));
|
||||
if (!IniSectionGetString(pIniSection, L"PreferedLanguageLocaleName", L"",
|
||||
g_tchPrefLngLocName, COUNTOF(g_tchPrefLngLocName)))
|
||||
{
|
||||
// try to fetch Locale Name from Notepad3.ini
|
||||
GetPrivateProfileString(L"Settings2", L"PreferedLanguageLocaleName", L"",
|
||||
g_tchPrefLngLocName, COUNTOF(g_tchPrefLngLocName), g_wchNP3IniFile);
|
||||
}
|
||||
|
||||
if (!flagNoReuseWindow) {
|
||||
|
||||
@ -3224,6 +3238,15 @@ int CheckIniFile(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
lstrcpy(lpszFile,tchBuild);
|
||||
return(1);
|
||||
}
|
||||
// sub directory (.\np3\)
|
||||
lstrcpy(tchBuild,lpszModule);
|
||||
PathRemoveFileSpec(tchBuild);
|
||||
lstrcat(tchBuild,L"\\np3\\");
|
||||
lstrcat(tchBuild,tchFileExpanded);
|
||||
if (PathFileExists(tchBuild)) {
|
||||
lstrcpy(lpszFile,tchBuild);
|
||||
return(1);
|
||||
}
|
||||
// %appdata%
|
||||
if (S_OK == SHGetFolderPath(NULL,CSIDL_APPDATA,NULL,SHGFP_TYPE_CURRENT,tchBuild)) {
|
||||
PathAppend(tchBuild,tchFileExpanded);
|
||||
@ -3238,7 +3261,6 @@ int CheckIniFile(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
else if (PathFileExists(tchFileExpanded)) {
|
||||
lstrcpy(lpszFile,tchFileExpanded);
|
||||
return(1);
|
||||
@ -3247,10 +3269,10 @@ int CheckIniFile(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int CheckIniFileRedirect(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
int CheckIniFileRedirect(LPWSTR lpszAppName, LPWSTR lpszKeyName, LPWSTR lpszFile, LPCWSTR lpszModule)
|
||||
{
|
||||
WCHAR tch[MAX_PATH];
|
||||
if (GetPrivateProfileString(L"minipath",L"minipath.ini",L"",tch,COUNTOF(tch),lpszFile)) {
|
||||
if (GetPrivateProfileString(lpszAppName, lpszKeyName, L"", tch, COUNTOF(tch), lpszFile)) {
|
||||
if (CheckIniFile(tch,lpszModule)) {
|
||||
lstrcpy(lpszFile,tch);
|
||||
return(1);
|
||||
@ -3307,17 +3329,37 @@ int FindIniFile() {
|
||||
|
||||
if (bFound) {
|
||||
// allow two redirections: administrator -> user -> custom
|
||||
if (CheckIniFileRedirect(tchTest,tchModule))
|
||||
CheckIniFileRedirect(tchTest,tchModule);
|
||||
if (CheckIniFileRedirect(L"minipath", L"minipath.ini", tchTest, tchModule))
|
||||
CheckIniFileRedirect(L"minipath", L"minipath.ini", tchTest,tchModule);
|
||||
lstrcpy(g_wchIniFile,tchTest);
|
||||
}
|
||||
|
||||
else {
|
||||
lstrcpy(g_wchIniFile,tchModule);
|
||||
PathRenameExtension(g_wchIniFile,L".ini");
|
||||
}
|
||||
|
||||
return(1);
|
||||
// --- check for Notepad3.ini to synchronize some settings ---
|
||||
PathRemoveFileSpec(tchModule);
|
||||
lstrcat(tchModule, L"\\Notepad3.exe");
|
||||
lstrcpy(tchTest, PathFindFileName(tchModule));
|
||||
PathRenameExtension(tchTest, L".ini");
|
||||
bFound = CheckIniFile(tchTest,tchModule);
|
||||
if (!bFound) {
|
||||
lstrcpy(tchTest, L"notepad3.ini");
|
||||
bFound = CheckIniFile(tchTest,tchModule);
|
||||
}
|
||||
if (bFound) {
|
||||
// allow two redirections: administrator -> user -> custom
|
||||
if (CheckIniFileRedirect(L"notepad3", L"notepad3.ini", tchTest, tchModule)) {
|
||||
CheckIniFileRedirect(L"notepad3", L"notepad3.ini", tchTest, tchModule);
|
||||
}
|
||||
lstrcpy(g_wchNP3IniFile, tchTest);
|
||||
}
|
||||
else {
|
||||
lstrcpy(g_wchNP3IniFile, tchModule);
|
||||
PathRenameExtension(g_wchNP3IniFile, L".ini");
|
||||
}
|
||||
return (bFound ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
@ -3342,6 +3384,25 @@ int TestIniFile() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// --- test for Notepad3.ini ---
|
||||
if (PathIsDirectory(g_wchNP3IniFile) || *CharPrev(g_wchNP3IniFile, StrEnd(g_wchNP3IniFile)) == L'\\') {
|
||||
WCHAR wchModule[MAX_PATH];
|
||||
GetModuleFileName(NULL, wchModule, COUNTOF(wchModule));
|
||||
PathRemoveFileSpec(wchModule);
|
||||
lstrcat(wchModule, L"\\Notepad3.exe");
|
||||
PathAppend(g_wchNP3IniFile, PathFindFileName(wchModule));
|
||||
PathRenameExtension(g_wchNP3IniFile, L".ini");
|
||||
if (!PathFileExists(g_wchNP3IniFile)) {
|
||||
lstrcpy(PathFindFileName(g_wchNP3IniFile), L"notepad3.ini");
|
||||
if (!PathFileExists(g_wchNP3IniFile)) {
|
||||
lstrcpy(PathFindFileName(g_wchNP3IniFile), PathFindFileName(wchModule));
|
||||
PathRenameExtension(g_wchNP3IniFile, L".ini");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!PathFileExists(g_wchNP3IniFile) || PathIsDirectory(g_wchNP3IniFile)) {
|
||||
lstrcpy(g_wchNP3IniFile, L"");
|
||||
}
|
||||
|
||||
if (!PathFileExists(g_wchIniFile) || PathIsDirectory(g_wchIniFile)) {
|
||||
lstrcpy(g_wchIniFile2,g_wchIniFile);
|
||||
|
||||
@ -94,7 +94,7 @@ void SaveSettings(BOOL);
|
||||
void ParseCommandLine();
|
||||
void LoadFlags();
|
||||
int CheckIniFile(LPWSTR,LPCWSTR);
|
||||
int CheckIniFileRedirect(LPWSTR,LPCWSTR);
|
||||
int CheckIniFileRedirect(LPWSTR,LPWSTR,LPWSTR,LPCWSTR);
|
||||
int FindIniFile();
|
||||
int TestIniFile();
|
||||
int CreateIniFile();
|
||||
|
||||
@ -7464,10 +7464,10 @@ static bool __fastcall _CheckIniFile(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
}
|
||||
|
||||
|
||||
static bool __fastcall _CheckIniFileRedirect(LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
static bool __fastcall _CheckIniFileRedirect(LPWSTR lpszAppName, LPWSTR lpszKeyName, LPWSTR lpszFile,LPCWSTR lpszModule)
|
||||
{
|
||||
WCHAR tch[MAX_PATH] = { L'\0' };
|
||||
if (GetPrivateProfileString( L"" APPNAME, L"" APPNAME ".ini", L"",tch,COUNTOF(tch),lpszFile)) {
|
||||
if (GetPrivateProfileString(lpszAppName, lpszKeyName, L"", tch, COUNTOF(tch), lpszFile)) {
|
||||
if (_CheckIniFile(tch,lpszModule)) {
|
||||
StringCchCopy(lpszFile,MAX_PATH,tch);
|
||||
return true;
|
||||
@ -7530,9 +7530,9 @@ int FindIniFile() {
|
||||
if (bFound) {
|
||||
|
||||
// allow two redirections: administrator -> user -> custom
|
||||
if (_CheckIniFileRedirect(tchPath,tchModule))
|
||||
_CheckIniFileRedirect(tchPath,tchModule);
|
||||
|
||||
if (_CheckIniFileRedirect(L"" APPNAME, L"" APPNAME ".ini", tchPath, tchModule)) {
|
||||
_CheckIniFileRedirect(L"" APPNAME, L"" APPNAME ".ini", tchPath, tchModule);
|
||||
}
|
||||
StringCchCopy(g_wchIniFile,COUNTOF(g_wchIniFile),tchPath);
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user