[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
This commit is contained in:
Don Ho 2009-05-26 23:34:45 +00:00
parent c3da0f775f
commit 82f0d792f8
8 changed files with 65 additions and 11 deletions

View File

@ -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 <view source> 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

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<LexerStyles>
<LexerType name="searchResult" desc="Search result" ext="">
<WordsStyle name="DEFAULT" action="remove" />
<WordsStyle name="HEARDER" action="remove" />
<WordsStyle name="NUMBER" action="remove" />
<WordsStyle name="HIT WORD" action="remove" />
<WordsStyle name="KEYWORD1" action="remove" />
<WordsStyle name="KEYWORD2" action="remove" />
<WordsStyle name="SEARCH HEADER" action="remove" />
<WordsStyle name="FILE HEADER" action="remove" />
<WordsStyle name="LINE NUMBER" action="remove" />
<WordsStyle name="SELECTED LINE" action="remove" />
</LexerType>
</LexerStyles>
</NotepadPlus>

View File

@ -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

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -142,7 +142,7 @@
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>