From 3b7184ffea14057d728a9f023c18d7bb3b1cf57e Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 26 Oct 2008 01:25:16 +0000 Subject: [PATCH] [RELEASE] v5.1 OR (save the earth action) : Add question dialog for removing incompatible plugins to prevent annoying message from the next launch time - that will reduce million click times by users for each new release. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@347 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/MISC/PluginsManager/PluginsManager.cpp | 18 ++++++++++++++---- PowerEditor/visual.net/notepadPlus.vcproj | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 31bc12e0d..5457df22b 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -18,8 +18,8 @@ #include #include "PluginsManager.h" -const TCHAR * USERMSG = TEXT("This plugin is not compatible with current version of Notepad++.\n\ -Remove this plugin from plugins directory if you don't want to see this message on the next launch time."); +const TCHAR * USERMSG = TEXT("This plugin is not compatible with current version of Notepad++.\n\n\ +Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?"); bool PluginsManager::loadPlugins(const TCHAR *dir) { @@ -27,6 +27,7 @@ bool PluginsManager::loadPlugins(const TCHAR *dir) return false; vector dllNames; + vector dll2Remove; const TCHAR *pNppPath = (NppParameters::getInstance())->getNppPath(); generic_string pluginsFullPathFilter = (dir && dir[0])?dir:pNppPath; @@ -175,7 +176,10 @@ bool PluginsManager::loadPlugins(const TCHAR *dir) { s += TEXT("\n\n"); s += USERMSG; - ::MessageBox(NULL, s.c_str(), dllNames[i].c_str(), MB_OK); + if (::MessageBox(NULL, s.c_str(), dllNames[i].c_str(), MB_YESNO) == IDYES) + { + dll2Remove.push_back(dllNames[i]); + } delete pi; } catch(...) @@ -183,12 +187,18 @@ bool PluginsManager::loadPlugins(const TCHAR *dir) generic_string msg = TEXT("Fail loaded"); msg += TEXT("\n\n"); msg += USERMSG; - ::MessageBox(NULL, msg.c_str(), dllNames[i].c_str(), MB_OK); + if (::MessageBox(NULL, msg.c_str(), dllNames[i].c_str(), MB_YESNO) == IDYES) + { + dll2Remove.push_back(dllNames[i]); + } delete pi; } } } + for (size_t j = 0 ; j < dll2Remove.size() ; j++) + ::DeleteFile(dll2Remove[j].c_str()); + return true; } diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index a780880d5..0e419a3ec 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -110,7 +110,7 @@ IntermediateDirectory="Release" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops;.\no_ms_shit.vsprops" - CharacterSet="2" + CharacterSet="1" WholeProgramOptimization="1" >