diff --git a/PowerEditor/bin/readme.txt b/PowerEditor/bin/readme.txt index 3218b4768..24186dab9 100644 --- a/PowerEditor/bin/readme.txt +++ b/PowerEditor/bin/readme.txt @@ -42,4 +42,4 @@ Author: ******* Don Ho - http://notepad-plus-plus.org/author + http://notepad-plus-plus.org/contributors/author.html diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index eb56ac177..c32648eb0 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -254,7 +254,7 @@ - + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 0467aba71..fa1ae58ba 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1619,7 +1619,7 @@ int Notepad_plus::doCloseOrNot(const TCHAR *fn) int Notepad_plus::doDeleteOrNot(const TCHAR *fn) { - TCHAR pattern[128] = TEXT("The file \"%s\"\rwill be deleted from your disk and this document will be closed.\rContinue?"); + TCHAR pattern[128] = TEXT("The file \"%s\"\rwill be moved to your Recycle Bin and this document will be closed.\rContinue?"); TCHAR phrase[512]; wsprintf(phrase, pattern, fn); return doActionOrNot(TEXT("Delete file"), phrase, MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL); @@ -5101,7 +5101,7 @@ struct Quote{ const char *_quote; }; -const int nbQuote = 98; +const int nbQuote = 99; Quote quotes[nbQuote] = { {"Notepad++", "Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size.\nBy optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment."}, {"Martin Golding", "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."}, @@ -5195,6 +5195,7 @@ Quote quotes[nbQuote] = { {"Anonymous #61", "Your mother is so fat,\nthe recursive function computing her mass causes a stack overflow."}, {"Anonymous #62", "Oral sex makes my day, but anal sex makes my hole weak."}, {"Anonymous #63", "I'm not saying I am Batman, I am just saying no one has ever seen me and Batman in the same room togather."}, +{"Anonymous #64", "I took a taxi today.\nThe driver told me \"I love my job, I own this car, I've got my own business, I'm my own boss, NO ONE tells me what to do!\"\nI said \"TURN LEFT HERE\".\n"}, {"Apple fan boy", "I'll buy a second iPhone 5 and buy a lot of iOS applications so that Apple will be able to buy Samsung (this shitty company) to shut it down and all the Apple haters will be forced to have an iPhone. Muhahaha..."}, {"Hustle Man", "Politicians are like sperm.\nOne in a million turn out to be an actual human being."}, {"Confucius", "It's good to meet girl in park.\nBut better to park meat in girl."}, diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index e113ca699..8af2222ce 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -206,7 +206,7 @@ BEGIN MENUITEM "&Close", IDM_FILE_CLOSE MENUITEM "Clos&e All", IDM_FILE_CLOSEALL MENUITEM "Close All but Active Document", IDM_FILE_CLOSEALL_BUT_CURRENT - MENUITEM "Delete from Disk", IDM_FILE_DELETE + MENUITEM "Move to Recycle Bin", IDM_FILE_DELETE MENUITEM SEPARATOR MENUITEM "Load Session...", IDM_FILE_LOADSESSION MENUITEM "Save Session...", IDM_FILE_SAVESESSION diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 7891bde4a..15f9eae05 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -318,7 +318,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVE, TEXT("Save"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVEAS, TEXT("Save As..."))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RENAME, TEXT("Rename"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_DELETE, TEXT("Delete"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_DELETE, TEXT("Move to Recycle Bin"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RELOAD, TEXT("Reload"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_PRINT, TEXT("Print"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index d51e962bf..bde5795b0 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -575,10 +575,26 @@ bool FileManager::reloadBufferDeferred(BufferID id) bool FileManager::deleteFile(BufferID id) { Buffer * buf = getBufferByID(id); - const TCHAR *fileNamePath = buf->getFullPathName(); - if (!PathFileExists(fileNamePath)) + generic_string fileNamePath = buf->getFullPathName(); + + // Make sure to form a string with double '\0' terminator. + fileNamePath.append(1, '\0'); + + if (!PathFileExists(fileNamePath.c_str())) return false; - return ::DeleteFile(fileNamePath) != 0; + //return ::DeleteFile(fileNamePath) != 0; + + SHFILEOPSTRUCT fileOpStruct = {0}; + fileOpStruct.hwnd = NULL; + fileOpStruct.pFrom = fileNamePath.c_str(); + fileOpStruct.pTo = NULL; + fileOpStruct.wFunc = FO_DELETE; + fileOpStruct.fFlags = FOF_ALLOWUNDO; + fileOpStruct.fAnyOperationsAborted = false; + fileOpStruct.hNameMappings = NULL; + fileOpStruct.lpszProgressTitle = NULL; + + return SHFileOperation(&fileOpStruct) == 0; } bool FileManager::moveFile(BufferID id, const TCHAR * newFileName)