From 82f0d792f86e83392042742463da415b2054c0f7 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 26 May 2009 23:34:45 +0000 Subject: [PATCH] [BUG_FIXED] Add ChangeMarkers in installer. Add theme description in installer. Update contextMenu.xml in installer. Fix lastRecentFileList localization issue. [NEW] Add readonly change status notification for plugin system. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@479 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/installer/nppSetup.nsi | 24 +++++++++++++++---- PowerEditor/installer/stylers_remove.xml | 17 +++++++++++++ .../MISC/PluginsManager/Notepad_plus_msgs.h | 5 ++++ PowerEditor/src/Notepad_plus.cpp | 13 ++++++++++ .../src/ScitillaComponent/FindReplaceDlg.h | 4 ---- PowerEditor/src/lastRecentFileList.cpp | 5 ++-- PowerEditor/src/lastRecentFileList.h | 6 +++++ PowerEditor/visual.net/notepadPlus.vcproj | 2 +- 8 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 PowerEditor/installer/stylers_remove.xml diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 7c84506f..b561d183 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -344,11 +344,13 @@ GLOBAL_INST: File "configModel.xml" File "stylesGlobalModel.xml" File "stylesLexerModel.xml" + File "stylers_remove.xml" + ;File "contextMenuModel.xml" + ;File "contextMenu_remove.xml" File "..\bin\langs.model.xml" File "..\bin\config.model.xml" File "..\bin\stylers.model.xml" - File "..\bin\stylers_remove.xml" ;UPGRATE $INSTDIR\langs.xml nsExec::ExecToStack '"$TEMP\xmlUpdater.exe" "$TEMP\langsModel.xml" "$TEMP\langs.model.xml" "$INSTDIR\langs.xml"' @@ -365,13 +367,15 @@ GLOBAL_INST: File "..\bin\langs.model.xml" File "..\bin\config.model.xml" File "..\bin\stylers.model.xml" - File "..\bin\stylers_remove.xml" SetOverwrite off File /oname=$INSTDIR\langs.xml "..\bin\langs.model.xml" - File "..\bin\contextMenu.xml" File "..\bin\shortcuts.xml" + Delete "$INSTDIR\contextMenu.backup.xml" + Rename "$INSTDIR\contextMenu.xml" "$INSTDIR\contextMenu.backup.xml" + File "..\bin\contextMenu.xml" + ; Set Section Files and Shortcuts SetOverwrite on @@ -665,7 +669,13 @@ SubSection "Plugins" Plugins Delete "$INSTDIR\plugins\docMonitor.dll" SetOutPath "$INSTDIR\plugins" File "..\bin\plugins\docMonitor.dll" - SectionEnd + SectionEnd + + Section "Change Markers" ChangeMarkers + Delete "$INSTDIR\plugins\NppPlugin_ChangeMarker.dll" + SetOutPath "$INSTDIR\plugins" + File "..\bin\plugins\NppPlugin_ChangeMarker.dll" + SectionEnd SubSectionEnd SubSection "Themes" Themes @@ -752,6 +762,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${explorerContextMenu} 'Explorer context menu entry for Notepad++ : Open whatever you want in Notepad++ from Windows Explorer.' !insertmacro MUI_DESCRIPTION_TEXT ${autoCompletionComponent} 'Install the API files you need for the auto-completion feature (Ctrl+Space).' !insertmacro MUI_DESCRIPTION_TEXT ${Plugins} 'You may need those plugins to extend the capacity of Notepad++.' + !insertmacro MUI_DESCRIPTION_TEXT ${Themes} 'The eye-candy to change visual effects. Use Theme selector to switch among them.' !insertmacro MUI_DESCRIPTION_TEXT ${htmlViewer} 'Open the html file in Notepad++ while you choose from IE.' !insertmacro MUI_DESCRIPTION_TEXT ${AutoUpdater} 'Keep your Notepad++ update: Check this option to install an update module which searches Notepad++ update on Internet and install it for you.' !insertmacro MUI_FUNCTION_DESCRIPTION_END @@ -971,6 +982,11 @@ SubSection un.Plugins Delete "$INSTDIR\plugins\ComparePlugin.dll" RMDir "$INSTDIR\plugins\" SectionEnd + + Section un.ChangeMarkers + Delete "$INSTDIR\plugins\NppPlugin_ChangeMarker.dll" + RMDir "$INSTDIR\plugins\" + SectionEnd SubSectionEnd SubSection un.Themes diff --git a/PowerEditor/installer/stylers_remove.xml b/PowerEditor/installer/stylers_remove.xml new file mode 100644 index 00000000..041502ca --- /dev/null +++ b/PowerEditor/installer/stylers_remove.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 22812aae..3fb59e3c 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -425,4 +425,9 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; + #define NPPN_READONLYCHANGED (NPPN_FIRST + 16) // To notify plugins that current document change the readonly status + //scnNotification->nmhdr.code = NPPN_READONLYCHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = isReadOnlyActivated; + #endif //NOTEPAD_PLUS_MSGS_H diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index d1446ab1..1539bc58 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -100,6 +100,7 @@ Notepad_plus::Notepad_plus(): Window(), _mainWindowStatus(0), _pDocTab(NULL), _p { const char * encodingStr = declaration->Encoding(); _nativeLangEncoding = getCpFromStringValue(encodingStr); + _lastRecentFileList.setLangEncoding(_nativeLangEncoding); } } } @@ -5114,6 +5115,7 @@ bool Notepad_plus::reloadLang() changeUserDefineLang(); } + _lastRecentFileList.setLangEncoding(_nativeLangEncoding); return true; } @@ -9741,6 +9743,17 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) { if (mask & (BufferChangeReadonly)) { checkDocState(); + + Buffer * curBuf = _pEditView->getCurrentBuffer(); + bool isSysReadOnly = curBuf->getFileReadOnly(); + bool isUserReadOnly = curBuf->getUserReadOnly(); + + // To notify plugins ro status is changed + SCNotification scnN; + scnN.nmhdr.code = NPPN_READONLYCHANGED; + scnN.nmhdr.hwndFrom = _hSelf; + scnN.nmhdr.idFrom = int(isSysReadOnly || isUserReadOnly); + _pluginsManager.notify(&scnN); } } diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index bb34c13a..58aaa4a3 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -284,10 +284,6 @@ public : _options._isWrapAround = isCheckedOrNot(IDWRAP); _isInSelection = isCheckedOrNot(IDC_IN_SELECTION_CHECK); - // Set Direction : Down by default - _options._whichDirection = DIR_DOWN; - ::SendMessage(::GetDlgItem(_hSelf, IDDIRECTIONDOWN), BM_SETCHECK, BST_CHECKED, 0); - _doPurge = isCheckedOrNot(IDC_PURGE_CHECK); _doMarkLine = isCheckedOrNot(IDC_MARKLINE_CHECK); _doStyleFoundToken = isCheckedOrNot(IDC_STYLEFOUND_CHECK); diff --git a/PowerEditor/src/lastRecentFileList.cpp b/PowerEditor/src/lastRecentFileList.cpp index faeb7940..7098c113 100644 --- a/PowerEditor/src/lastRecentFileList.cpp +++ b/PowerEditor/src/lastRecentFileList.cpp @@ -23,6 +23,7 @@ void LastRecentFileList::initMenu(HMENU hMenu, int idBase, int posBase) { _hMenu = hMenu; _idBase = idBase; _posBase = posBase; + _nativeLangEncoding = CP_ANSI_LATIN_1; for (int i = 0 ; i < sizeof(_idFreeArray) ; i++) _idFreeArray[i] = true; @@ -38,9 +39,9 @@ void LastRecentFileList::updateMenu() { ::InsertMenu(_hMenu, _posBase + 0, MF_BYPOSITION, UINT(-1), 0); #ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); - const wchar_t * openAllFileStrW = wmc->char2wchar(openAllFileStr, CP_ANSI_LATIN_1); + const wchar_t * openAllFileStrW = wmc->char2wchar(openAllFileStr, _nativeLangEncoding); ::InsertMenu(_hMenu, _posBase + 1, MF_BYPOSITION, IDM_OPEN_ALL_RECENT_FILE, openAllFileStrW); - const wchar_t * cleanFileListStrW = wmc->char2wchar(cleanFileListStr, CP_ANSI_LATIN_1); + const wchar_t * cleanFileListStrW = wmc->char2wchar(cleanFileListStr, _nativeLangEncoding); ::InsertMenu(_hMenu, _posBase + 2, MF_BYPOSITION, IDM_CLEAN_RECENT_FILE_LIST, cleanFileListStrW); #else ::InsertMenu(_hMenu, _posBase + 1, MF_BYPOSITION, IDM_OPEN_ALL_RECENT_FILE, openAllFileStr); diff --git a/PowerEditor/src/lastRecentFileList.h b/PowerEditor/src/lastRecentFileList.h index 8f1c039a..94ab43c4 100644 --- a/PowerEditor/src/lastRecentFileList.h +++ b/PowerEditor/src/lastRecentFileList.h @@ -52,10 +52,16 @@ public : void setLock(bool lock) { _locked = lock; }; + + void setLangEncoding(int nativeLangEncoding) { + _nativeLangEncoding = nativeLangEncoding; + }; + private: recentList _lrfl; int _userMax; int _size; + int _nativeLangEncoding; // For the menu HMENU _hMenu; diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index 425489dd..e7bce8a3 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -142,7 +142,7 @@ RuntimeLibrary="0" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" - WarningLevel="3" + WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />