[BUG_FIXED] Fix a bug while command argument is empty ("").
[NEW_FEATURE] Warn user while the amount of file to open is larger than 200. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@904 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
024c82e880
commit
1697b664b1
@ -190,11 +190,27 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly, int encodi
|
||||
fileNameStr += TEXT("\\");
|
||||
|
||||
getMatchedFileNames(fileNameStr.c_str(), patterns, fileNames, true, false);
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
size_t nbFiles2Open = fileNames.size();
|
||||
|
||||
bool ok2Open = true;
|
||||
if (nbFiles2Open > 200)
|
||||
{
|
||||
int answer = _nativeLangSpeaker.messageBox("NbFileToOpenImportantWaring",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("Number of files to open are too important.\rAre you sure to open them?"),
|
||||
TEXT("Number of files to open is too large"),
|
||||
MB_YESNO|MB_APPLMODAL);
|
||||
ok2Open = answer != IDYES;
|
||||
}
|
||||
|
||||
if (ok2Open)
|
||||
{
|
||||
for (size_t i = 0 ; i < nbFiles2Open ; i++)
|
||||
{
|
||||
doOpen(fileNames[i].c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
generic_string msg = TEXT("Can not open file \"");
|
||||
|
@ -244,6 +244,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||
for(size_t i = 0; i < nrFilesToOpen; i++)
|
||||
{
|
||||
currentFile = params.at(i);
|
||||
if (currentFile[0])
|
||||
{
|
||||
//check if relative or full path. Relative paths dont have a colon for driveletter
|
||||
BOOL isRelative = ::PathIsRelative(currentFile);
|
||||
quotFileName += TEXT("\"");
|
||||
@ -258,6 +260,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||
}
|
||||
quotFileName += TEXT("\" ");
|
||||
}
|
||||
}
|
||||
|
||||
//Only after loading all the file paths set the working directory
|
||||
::SetCurrentDirectory(NppParameters::getInstance()->getNppPath().c_str()); //force working directory to path of module, preventing lock
|
||||
|
Loading…
Reference in New Issue
Block a user