mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 16:24:27 +02:00
[NEW_FEATURE] (Author: Loreia) Add widecard capacity for command line arguments.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1192 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
fd800dcf20
commit
b63c4a0f6c
@ -62,7 +62,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly, int encodi
|
||||
if (test != BUFFER_INVALID)
|
||||
{
|
||||
//switchToFile(test);
|
||||
//Don't switch, not responsibility of doOpen, but of caller
|
||||
//Dont switch, not responsibility of doOpen, but of caller
|
||||
if (_pTrayIco)
|
||||
{
|
||||
if (_pTrayIco->isInTray())
|
||||
@ -89,7 +89,8 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly, int encodi
|
||||
isWow64Off = true;
|
||||
}
|
||||
|
||||
if (!PathFileExists(longFileName))
|
||||
bool globbing = wcsrchr(longFileName, TCHAR('*')) || wcsrchr(longFileName, TCHAR('?'));
|
||||
if (!PathFileExists(longFileName) && !globbing)
|
||||
{
|
||||
TCHAR str2display[MAX_PATH*2];
|
||||
generic_string longFileDir(longFileName);
|
||||
@ -167,7 +168,6 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly, int encodi
|
||||
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
PathRemoveFileSpec(longFileName);
|
||||
_linkTriggered = true;
|
||||
_isFileOpening = false;
|
||||
@ -180,29 +180,40 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly, int encodi
|
||||
}
|
||||
else
|
||||
{
|
||||
if (::PathIsDirectory(fileName))
|
||||
if (globbing || ::PathIsDirectory(fileName))
|
||||
{
|
||||
vector<generic_string> fileNames;
|
||||
vector<generic_string> patterns;
|
||||
patterns.push_back(TEXT("*.*"));
|
||||
if (globbing)
|
||||
{
|
||||
const TCHAR * substring = wcsrchr(fileName, TCHAR('\\'));
|
||||
size_t pos = substring - fileName;
|
||||
|
||||
patterns.push_back(substring + 1);
|
||||
generic_string dir(fileName, pos + 1);
|
||||
getMatchedFileNames(dir.c_str(), patterns, fileNames, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
generic_string fileNameStr = fileName;
|
||||
if (fileName[lstrlen(fileName) - 1] != '\\')
|
||||
fileNameStr += TEXT("\\");
|
||||
|
||||
patterns.push_back(TEXT("*"));
|
||||
getMatchedFileNames(fileNameStr.c_str(), patterns, fileNames, true, false);
|
||||
size_t nbFiles2Open = fileNames.size();
|
||||
}
|
||||
|
||||
bool ok2Open = true;
|
||||
size_t nbFiles2Open = fileNames.size();
|
||||
|
||||
if (nbFiles2Open > 200)
|
||||
{
|
||||
int answer = _nativeLangSpeaker.messageBox("NbFileToOpenImportantWarning",
|
||||
ok2Open = IDYES == _nativeLangSpeaker.messageBox("NbFileToOpenImportantWarning",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?"),
|
||||
TEXT("Amount of files to open is too large"),
|
||||
MB_YESNO|MB_APPLMODAL,
|
||||
nbFiles2Open);
|
||||
ok2Open = answer == IDYES;
|
||||
}
|
||||
|
||||
if (ok2Open)
|
||||
|
Loading…
x
Reference in New Issue
Block a user