Add "Allow clickable link" option in large file restriction
And enhance large file restriction UI Close #12369
This commit is contained in:
parent
7e080a46bb
commit
cd6a6ac3bb
|
@ -549,12 +549,12 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||
<SubDialog>
|
||||
<Item id="2204" name="Bold"/>
|
||||
<Item id="2205" name="Italic"/>
|
||||
<Item id="2206" name="Foreground colour"/>
|
||||
<Item id="2207" name="Background colour"/>
|
||||
<Item id="2206" name="Foreground color"/>
|
||||
<Item id="2207" name="Background color"/>
|
||||
<Item id="2208" name="Font name:"/>
|
||||
<Item id="2209" name="Font size:"/>
|
||||
<Item id="2211" name="Style:"/>
|
||||
<Item id="2212" name="Colour Style"/>
|
||||
<Item id="2212" name="Color Style"/>
|
||||
<Item id="2213" name="Font Style"/>
|
||||
<Item id="2214" name="Default ext.:"/>
|
||||
<Item id="2216" name="User ext.:"/>
|
||||
|
@ -562,8 +562,8 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||
<Item id="2219" name="Default keywords"/>
|
||||
<Item id="2221" name="User-defined keywords"/>
|
||||
<Item id="2225" name="Language:"/>
|
||||
<Item id="2226" name="Enable global foreground colour"/>
|
||||
<Item id="2227" name="Enable global background colour"/>
|
||||
<Item id="2226" name="Enable global foreground color"/>
|
||||
<Item id="2227" name="Enable global background color"/>
|
||||
<Item id="2228" name="Enable global font"/>
|
||||
<Item id="2229" name="Enable global font size"/>
|
||||
<Item id="2230" name="Enable global bold font style"/>
|
||||
|
@ -668,12 +668,12 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||
<Item id="44107" name="Switch to Folder as Workspace"/>
|
||||
<Item id="44109" name="Switch to Document List"/>
|
||||
<Item id="44108" name="Switch to Function List"/>
|
||||
<Item id="44110" name="Remove Tab Colour"/>
|
||||
<Item id="44111" name="Apply Tab Colour 1"/>
|
||||
<Item id="44112" name="Apply Tab Colour 2"/>
|
||||
<Item id="44113" name="Apply Tab Colour 3"/>
|
||||
<Item id="44114" name="Apply Tab Colour 4"/>
|
||||
<Item id="44115" name="Apply Tab Colour 5"/>
|
||||
<Item id="44110" name="Remove Tab Color"/>
|
||||
<Item id="44111" name="Apply Tab Color 1"/>
|
||||
<Item id="44112" name="Apply Tab Color 2"/>
|
||||
<Item id="44113" name="Apply Tab Color 3"/>
|
||||
<Item id="44114" name="Apply Tab Color 4"/>
|
||||
<Item id="44115" name="Apply Tab Color 5"/>
|
||||
<Item id="11002" name="Sort By Name A to Z"/>
|
||||
<Item id="11003" name="Sort By Name Z to A"/>
|
||||
<Item id="11004" name="Sort By Path A to Z"/>
|
||||
|
@ -708,8 +708,8 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||
<Item id="20016" name="Export..."/>
|
||||
<StylerDialog title="Styler Dialog">
|
||||
<Item id="25030" name="Font options:"/>
|
||||
<Item id="25006" name="Foreground colour"/>
|
||||
<Item id="25007" name="Background colour"/>
|
||||
<Item id="25006" name="Foreground color"/>
|
||||
<Item id="25007" name="Background color"/>
|
||||
<Item id="25031" name="Name:"/>
|
||||
<Item id="25032" name="Size:"/>
|
||||
<Item id="25001" name="Bold"/>
|
||||
|
@ -881,7 +881,7 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||
<Item id="6107" name="Reduce"/>
|
||||
<Item id="6108" name="Lock (no drag and drop)"/>
|
||||
<Item id="6109" name="Darken inactive tabs"/>
|
||||
<Item id="6110" name="Draw a coloured bar on active tab"/>
|
||||
<Item id="6110" name="Draw a colored bar on active tab"/>
|
||||
|
||||
<Item id="6111" name="Show status bar"/>
|
||||
<Item id="6112" name="Show close button on each tab"/>
|
||||
|
@ -1036,11 +1036,11 @@ You can define several column markers by using white space to separate the diffe
|
|||
|
||||
<Print title="Print">
|
||||
<Item id="6601" name="Print line number"/>
|
||||
<Item id="6602" name="Colour Options"/>
|
||||
<Item id="6602" name="Color Options"/>
|
||||
<Item id="6603" name="WYSIWYG"/>
|
||||
<Item id="6604" name="Invert"/>
|
||||
<Item id="6605" name="Black on white"/>
|
||||
<Item id="6606" name="No background colour"/>
|
||||
<Item id="6606" name="No background color"/>
|
||||
<Item id="6607" name="Margin Settings (Unit:mm)"/>
|
||||
<Item id="6612" name="Left"/>
|
||||
<Item id="6613" name="Top"/>
|
||||
|
@ -1158,7 +1158,6 @@ You can define several column markers by using white space to separate the diffe
|
|||
|
||||
<Performance title="Performance">
|
||||
<Item id="7141" name="Large File Restriction"/>
|
||||
<Item id="7142" name="While opening a large file, some features are turned off for optimizing the performance. You can customize them here."/>
|
||||
<Item id="7143" name="Enable Large File Restriction (no syntax highlighting)"/>
|
||||
<Item id="7144" name="Define Large File Size:"/>
|
||||
<Item id="7146" name="MB (1 - 4096)"/>
|
||||
|
@ -1166,6 +1165,7 @@ You can define several column markers by using white space to separate the diffe
|
|||
<Item id="7148" name="Allow Auto-Completion"/>
|
||||
<Item id="7149" name="Allow Smart Highlighting"/>
|
||||
<Item id="7150" name="Deactivate Word Wrap globally"/>
|
||||
<Item id="7151" name="Allow URL Clickable Link"/>
|
||||
</Performance>
|
||||
|
||||
<Cloud title="Cloud & Link">
|
||||
|
@ -1605,9 +1605,12 @@ Find in all files but exclude all folders log or logs recursively:
|
|||
<contextMenu-styleAlloccurrencesOfToken value="Style all occurrences of token" />
|
||||
<contextMenu-styleOneToken value="Style one token" />
|
||||
<contextMenu-clearStyle value="Clear style" />
|
||||
<enable-disable-largeFileRestriction-tip value="Toggling "Enable Large File Restriction" takes effect only after closing and re-opening the large file" />
|
||||
<change-largeFileRestriction_fileLength-tip value="Modifying file size value takes effect only after closing and re-opening the large file" />
|
||||
<largeFileRestriction_wordWrap-tip value="Enabling "Deactivate Word Wrap globally" option will deactivate Word Wrap for all opened documents after opening a large file. You can reactivate Word Wrap feature manually." />
|
||||
<largeFileRestriction-tip value="Some features may slow performance in large files. These features can be auto-disabled on opening a large file. You can customize them here.
|
||||
|
||||
NOTE:
|
||||
1. Modifying options here requires re-open currently opened large files to get proper behavior.
|
||||
|
||||
2. If "Deactivate Word Wrap globally" is checked and you open a large file, "Word Wrap" will be disabled for all files. You can re-enable it via menu "View->Word Wrap"." />
|
||||
</MiscStrings>
|
||||
</Native-Langue>
|
||||
</NotepadPlus>
|
||||
|
|
|
@ -1158,7 +1158,6 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour
|
|||
|
||||
<Performance title="Performance">
|
||||
<Item id="7141" name="Restriction des fichiers volumineux"/>
|
||||
<Item id="7142" name="Lors de l'ouverture d'un fichier volumineux, certaines fonctionnalités sont désactivées pour optimiser les performances. Vous pouvez les personnaliser ici."/>
|
||||
<Item id="7143" name="Activer la restriction des fichiers volumineux (pas de coloration syntaxique)"/>
|
||||
<Item id="7144" name="Définir la taille du fichier volumineux :"/>
|
||||
<Item id="7146" name="Mo (1 - 4096)"/>
|
||||
|
@ -1166,6 +1165,7 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour
|
|||
<Item id="7148" name="Permettre d'activer la complétion automatique"/>
|
||||
<Item id="7149" name="Permettre d'activer le coloriage automatique"/>
|
||||
<Item id="7150" name="Désactiver le retour automatique à la ligne globalement"/>
|
||||
<Item id="7151" name="Permettre d'activer le lien cliquable"/>
|
||||
</Performance>
|
||||
|
||||
<Cloud title="Cloud & Lien">
|
||||
|
@ -1606,9 +1606,12 @@ Rechercher dans tous les fichiers mais pas dans les dossiers log ou logs récurs
|
|||
<contextMenu-styleOneToken value="Appliquer le style à 1 seul occurrence" />
|
||||
<contextMenu-clearStyle value="Dégager le style" />
|
||||
<contextMenu-PluginCommands value="Modules d'extension" />
|
||||
<enable-disable-largeFileRestriction-tip value="Basculer "Activer la restriction des fichiers volumineux" ne prend effet qu'après la fermeture et la réouverture du fichier volumineux" />
|
||||
<change-largeFileRestriction_fileLength-tip value="La modification de la valeur de la taille du fichier ne prend effet qu'après la fermeture et la réouverture du fichier volumineux" />
|
||||
<largeFileRestriction_wordWrap-tip value="L'activation de l'option "Désactiver Retour automatique à la ligne globalement" désactivera « Retour automatique à la ligne » pour tous les documents ouverts après l'ouverture d'un fichier volumineux. Vous pouvez réactiver la fonctionnalité « Retour automatique à la ligne » manuellement." />
|
||||
<largeFileRestriction-tip value="Certaines fonctionnalités peuvent ralentir les performances lors de l'ouverture du fichier volumineux. Ces fonctionnalités peuvent être automatiquement désactivées à l'ouverture d'un fichier volumineux. Vous pouvez les personnaliser ici.
|
||||
|
||||
REMARQUE:
|
||||
1. Modification ies options ici nécessite de rouvrir les fichiers volumineux actuellement ouverts pour obtenir un résultat correct.
|
||||
|
||||
2. Si "Désactiver Retour automatique à la ligne globalement" est cochée et vous ouvrez un fichier volumineux, "Retour automatique à la ligne" sera désactivé pour tous les fichiers. Vous pouvez le réactiver via le menu "Affichage->Retour automatique à la ligne"." />
|
||||
</MiscStrings>
|
||||
</Native-Langue>
|
||||
</NotepadPlus>
|
||||
|
|
|
@ -1143,7 +1143,6 @@
|
|||
|
||||
<Performance title="性能">
|
||||
<Item id="7141" name="大型檔案限制"/>
|
||||
<Item id="7142" name="在開啟大型文件時,為了優化性能,一些功能會被關閉。 你可以在此處自開啟它們。"/>
|
||||
<Item id="7143" name="啟動大型檔案限制(沒有語法醒目提示)"/>
|
||||
<Item id="7144" name="定義大型檔案文件長度大小:"/>
|
||||
<Item id="7146" name="MB (1 - 4096)"/>
|
||||
|
@ -1151,6 +1150,7 @@
|
|||
<Item id="7148" name="允許自動完成功能"/>
|
||||
<Item id="7149" name="允許智慧醒目提示"/>
|
||||
<Item id="7150" name="停用自動換行"/>
|
||||
<Item id="7151" name="允許可點擊連結"/>
|
||||
</Performance>
|
||||
|
||||
<Cloud title="雲端與連結">
|
||||
|
@ -1547,9 +1547,12 @@
|
|||
<contextMenu-styleOneToken value="僅樣式化選擇的字串" />
|
||||
<contextMenu-clearStyle value="清除樣式" />
|
||||
<contextMenu-PluginCommands value="外掛模組" />
|
||||
<enable-disable-largeFileRestriction-tip value="切換「啟動大型檔案限制」 僅在關閉並重新打開大型文件後生效" />
|
||||
<change-largeFileRestriction_fileLength-tip value="修改大型檔案長度大小值只有在關閉並重新打開大文件後生效" />
|
||||
<largeFileRestriction_wordWrap-tip value="啟用「停用自動換行」選項將在打開大型文件後為所有打開的文檔停用自動換行。 您可以自行重新啟動自動換行功能。" />
|
||||
<largeFileRestriction-tip value="某些功能會降低開啟大型文件的速度,這些功能在開啟大型文件時自動停用。你可以在此處重新開啟或關閉這些功能。
|
||||
|
||||
注意:
|
||||
1. 修改這些選項需要重新開啟已開啟的大型文件以達到預期的效果。
|
||||
|
||||
2. 如果「停用自動換行」被啟動,在開啟一個大型文件時,「自動換行」將對所有文件停用。 你可以通過選單「檢視->自動換行」重新啟動這個功能。" />
|
||||
</MiscStrings>
|
||||
</Native-Langue>
|
||||
</NotepadPlus>
|
||||
|
|
|
@ -3011,12 +3011,12 @@ bool isUrl(TCHAR * text, int textLen, int start, int* segmentLen)
|
|||
|
||||
void Notepad_plus::addHotSpot(ScintillaEditView* view)
|
||||
{
|
||||
Buffer* currentBuf = _pEditView->getCurrentBuffer();
|
||||
if (currentBuf->isLargeFile())
|
||||
return;
|
||||
|
||||
ScintillaEditView* pView = view ? view : _pEditView;
|
||||
|
||||
Buffer* currentBuf = pView->getCurrentBuffer();
|
||||
if (!currentBuf->allowClickableLink())
|
||||
return;
|
||||
|
||||
int urlAction = (NppParameters::getInstance()).getNppGUI()._styleURL;
|
||||
LPARAM indicStyle = (urlAction == urlNoUnderLineFg) || (urlAction == urlNoUnderLineBg) ? INDIC_HIDDEN : INDIC_PLAIN;
|
||||
LPARAM indicHoverStyle = (urlAction == urlNoUnderLineBg) || (urlAction == urlUnderLineBg) ? INDIC_FULLBOX : INDIC_EXPLORERLINK;
|
||||
|
|
|
@ -499,7 +499,7 @@ private:
|
|||
intptr_t findMachedBracePos(size_t startPos, size_t endPos, char targetSymbol, char matchedSymbol);
|
||||
void maintainIndentation(TCHAR ch);
|
||||
|
||||
void addHotSpot(ScintillaEditView* view = NULL);
|
||||
void addHotSpot(ScintillaEditView* view = nullptr);
|
||||
|
||||
void bookmarkAdd(intptr_t lineno) const {
|
||||
if (lineno == -1)
|
||||
|
|
|
@ -5418,6 +5418,12 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
|||
else
|
||||
_nppGUI._largeFileRestriction._allowSmartHilite = false;
|
||||
|
||||
boolVal = element->Attribute(TEXT("allowClickableLink"));
|
||||
if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes")))
|
||||
_nppGUI._largeFileRestriction._allowClickableLink = true;
|
||||
else
|
||||
_nppGUI._largeFileRestriction._allowClickableLink = false;
|
||||
|
||||
boolVal = element->Attribute(TEXT("deactivateWordWrap"));
|
||||
if (boolVal != NULL && !lstrcmp(boolVal, TEXT("no")))
|
||||
_nppGUI._largeFileRestriction._deactivateWordWrap = false;
|
||||
|
@ -6644,7 +6650,7 @@ void NppParameters::createXmlTreeFromGUIParams()
|
|||
GUIConfigElement->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), _nppGUI._delimiterSelectionOnEntireDocument ? TEXT("yes") : TEXT("no"));
|
||||
}
|
||||
|
||||
// <GUIConfig name="largeFileRestriction" fileSizeMB="200" isEnabled="yes" allowAutoCompletion="no" allowBraceMatch="no" deactivateWordWrap="yes" allowWordWrap="no" />
|
||||
// <GUIConfig name="largeFileRestriction" fileSizeMB="200" isEnabled="yes" allowAutoCompletion="no" allowBraceMatch="no" deactivateWordWrap="yes" allowClickableLink="no" />
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("largeFileRestriction"));
|
||||
|
@ -6653,6 +6659,7 @@ void NppParameters::createXmlTreeFromGUIParams()
|
|||
GUIConfigElement->SetAttribute(TEXT("allowAutoCompletion"), _nppGUI._largeFileRestriction._allowAutoCompletion ? TEXT("yes") : TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("allowBraceMatch"), _nppGUI._largeFileRestriction._allowBraceMatch ? TEXT("yes") : TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("allowSmartHilite"), _nppGUI._largeFileRestriction._allowSmartHilite ? TEXT("yes") : TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("allowClickableLink"), _nppGUI._largeFileRestriction._allowClickableLink ? TEXT("yes") : TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("deactivateWordWrap"), _nppGUI._largeFileRestriction._deactivateWordWrap ? TEXT("yes") : TEXT("no"));
|
||||
}
|
||||
|
||||
|
|
|
@ -733,6 +733,7 @@ struct LargeFileRestriction final
|
|||
bool _allowBraceMatch = false;
|
||||
bool _allowAutoCompletion = false;
|
||||
bool _allowSmartHilite = false;
|
||||
bool _allowClickableLink = false;
|
||||
};
|
||||
|
||||
struct NppGUI final
|
||||
|
|
|
@ -562,6 +562,12 @@ bool Buffer::allowSmartHilite() const
|
|||
return (!_isLargeFile || nppGui._largeFileRestriction._allowSmartHilite) || !nppGui._largeFileRestriction._isEnabled;
|
||||
}
|
||||
|
||||
bool Buffer::allowClickableLink() const
|
||||
{
|
||||
NppGUI& nppGui = NppParameters::getInstance().getNppGUI();
|
||||
return (!_isLargeFile || nppGui._largeFileRestriction._allowClickableLink) || !nppGui._largeFileRestriction._isEnabled;
|
||||
}
|
||||
|
||||
//filemanager
|
||||
|
||||
FileManager::~FileManager()
|
||||
|
|
|
@ -318,6 +318,7 @@ public:
|
|||
bool allowBraceMach() const;
|
||||
bool allowAutoCompletion() const;
|
||||
bool allowSmartHilite() const;
|
||||
bool allowClickableLink() const;
|
||||
|
||||
private:
|
||||
int indexOfReference(const ScintillaEditView * identifier) const;
|
||||
|
|
|
@ -479,8 +479,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
|||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Large File Restriction",IDC_GROUPSTATIC_PERFORMANCE_RESTRICTION,73,7,301,151,BS_CENTER
|
||||
LTEXT "While opening a large file, some features are turned off for optimizing the performance. You can customize them here.",IDC_STATIC_PERFORMANCE_TIP,90,19,280,16
|
||||
CONTROL "Enable Large File Restriction (no syntax highlighting)",IDC_CHECK_PERFORMANCE_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,100,41,260,10
|
||||
PUSHBUTTON "?",IDD_PERFORMANCE_TIP_QUESTION_BUTTON,215,21,16,14
|
||||
CONTROL "Enable Large File Restriction (no syntax highlighting)",IDC_CHECK_PERFORMANCE_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,100,41,260,10
|
||||
RTEXT "Define Large File Size:",IDC_STATIC_PERFORMANCE_FILESIZE,75,59,125,8
|
||||
EDITTEXT IDC_EDIT_PERFORMANCE_FILESIZE,201,57,24,14,ES_RIGHT | ES_NUMBER
|
||||
LTEXT "MB (1 - 4096)",IDC_STATIC_PERFORMANCE_MB,228,59,90,8
|
||||
|
@ -488,6 +488,7 @@ BEGIN
|
|||
CONTROL "Allow Auto-Completion",IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,95,200,10
|
||||
CONTROL "Allow Smart Highlighting",IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,110,200,10
|
||||
CONTROL "Allow Brace Match", IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 127, 125, 200, 10
|
||||
CONTROL "Allow URL Clickable Link", IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 127, 140, 200, 10
|
||||
END
|
||||
|
||||
IDD_PREFERENCE_SUB_MISC DIALOGEX 0, 0, 455, 200
|
||||
|
|
|
@ -264,10 +264,8 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||
{
|
||||
NppDarkMode::autoThemeChildControls(_hSelf);
|
||||
|
||||
if (_performanceSubDlg._enableLargeFileRestrictionTip)
|
||||
NppDarkMode::setDarkTooltips(_performanceSubDlg._enableLargeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
if (_performanceSubDlg._changeLargeFileLengthTip)
|
||||
NppDarkMode::setDarkTooltips(_performanceSubDlg._changeLargeFileLengthTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
if (_performanceSubDlg._largeFileRestrictionTip)
|
||||
NppDarkMode::setDarkTooltips(_performanceSubDlg._largeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -4928,6 +4926,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
|
|||
::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH, BM_SETCHECK, nppGUI._largeFileRestriction._allowBraceMatch ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION, BM_SETCHECK, nppGUI._largeFileRestriction._allowAutoCompletion ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE, BM_SETCHECK, nppGUI._largeFileRestriction._allowSmartHilite ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK, BM_SETCHECK, nppGUI._largeFileRestriction._allowClickableLink ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP, BM_SETCHECK, nppGUI._largeFileRestriction._deactivateWordWrap ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
|
||||
bool largeFileRestrictionEnabled = isCheckedOrNot(IDC_CHECK_PERFORMANCE_ENABLE);
|
||||
|
@ -4935,15 +4934,12 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
|
|||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP), largeFileRestrictionEnabled);
|
||||
|
||||
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
|
||||
generic_string enablePerfTip = pNativeSpeaker->getLocalizedStrFromID("enable-disable-largeFileRestriction-tip", TEXT("Toggling \"Enable Large File Restriction\" takes effect only after closing and re-opening the large file"));
|
||||
generic_string fileLenTip = pNativeSpeaker->getLocalizedStrFromID("change-largeFileRestriction_fileLength-tip", TEXT("Modifying file size value takes effect only after closing and re-opening the large file"));
|
||||
generic_string wordWrapLenTip = pNativeSpeaker->getLocalizedStrFromID("largeFileRestriction_wordWrap-tip", TEXT("Enabling \"Deactivate Word Wrap globally\" option will deactivate Word Wrap for all opened documents after opening a large file. You can reactivate Word Wrap feature manually."));
|
||||
_enableLargeFileRestrictionTip = CreateToolTip(IDC_CHECK_PERFORMANCE_ENABLE, _hSelf, _hInst, const_cast<PTSTR>(enablePerfTip.c_str()), false);
|
||||
_changeLargeFileLengthTip = CreateToolTip(IDC_EDIT_PERFORMANCE_FILESIZE, _hSelf, _hInst, const_cast<PTSTR>(fileLenTip.c_str()), false);
|
||||
_deactivateWordWrapTip = CreateToolTip(IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP, _hSelf, _hInst, const_cast<PTSTR>(wordWrapLenTip.c_str()), false);
|
||||
generic_string enablePerfTip = pNativeSpeaker->getLocalizedStrFromID("largeFileRestriction-tip", TEXT("Some features may slow performance in large files. These features can be auto-disabled on opening a large file. You can customize them here.\n\nNOTE:\n1. Modifying options here requires re-open currently opened large files to get proper behavior.\n\n2. If \"Deactivate Word Wrap globally\" is checked and you open a large file, \"Word Wrap\" will be disabled for all files. You can re-enable it via menu \"View->Word Wrap\""));
|
||||
_largeFileRestrictionTip = CreateToolTip(IDD_PERFORMANCE_TIP_QUESTION_BUTTON, _hSelf, _hInst, const_cast<PTSTR>(enablePerfTip.c_str()), false);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5011,6 +5007,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
|
|||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK), largeFileRestrictionEnabled);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP), largeFileRestrictionEnabled);
|
||||
|
||||
redraw();
|
||||
|
@ -5020,6 +5017,10 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
|
|||
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_CLEANSMARTHILITING, 0, 0);
|
||||
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_CLEANBRACEMATCH, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessage(::GetParent(_hParent), NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
@ -5048,6 +5049,15 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
|
|||
}
|
||||
return TRUE;
|
||||
|
||||
case IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK:
|
||||
{
|
||||
bool isAllowed = isCheckedOrNot(int(wParam));
|
||||
nppGUI._largeFileRestriction._allowClickableLink = isAllowed;
|
||||
if (isAllowed)
|
||||
SendMessage(::GetParent(_hParent), NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP:
|
||||
{
|
||||
bool isDeactivated = isCheckedOrNot(int(wParam));
|
||||
|
|
|
@ -258,20 +258,14 @@ friend class PreferenceDlg;
|
|||
public :
|
||||
PerformanceSubDlg() = default;
|
||||
~PerformanceSubDlg() {
|
||||
if (_enableLargeFileRestrictionTip)
|
||||
::DestroyWindow(_enableLargeFileRestrictionTip);
|
||||
if (_changeLargeFileLengthTip)
|
||||
::DestroyWindow(_changeLargeFileLengthTip);
|
||||
if (_deactivateWordWrapTip)
|
||||
::DestroyWindow(_deactivateWordWrapTip);
|
||||
if (_largeFileRestrictionTip)
|
||||
::DestroyWindow(_largeFileRestrictionTip);
|
||||
};
|
||||
|
||||
private :
|
||||
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
HWND _enableLargeFileRestrictionTip = nullptr;
|
||||
HWND _changeLargeFileLengthTip = nullptr;
|
||||
HWND _deactivateWordWrapTip = nullptr;
|
||||
HWND _largeFileRestrictionTip = nullptr;
|
||||
};
|
||||
|
||||
class PreferenceDlg : public StaticDialog
|
||||
|
|
|
@ -437,7 +437,7 @@
|
|||
|
||||
#define IDD_PREFERENCE_SUB_PERFORMANCE 7140 //(IDD_PREFERENCE_BOX + 1100)
|
||||
#define IDC_GROUPSTATIC_PERFORMANCE_RESTRICTION (IDD_PREFERENCE_SUB_PERFORMANCE + 1)
|
||||
#define IDC_STATIC_PERFORMANCE_TIP (IDD_PREFERENCE_SUB_PERFORMANCE + 2)
|
||||
#define IDD_PERFORMANCE_TIP_QUESTION_BUTTON (IDD_PREFERENCE_SUB_PERFORMANCE + 2)
|
||||
#define IDC_CHECK_PERFORMANCE_ENABLE (IDD_PREFERENCE_SUB_PERFORMANCE + 3)
|
||||
#define IDC_STATIC_PERFORMANCE_FILESIZE (IDD_PREFERENCE_SUB_PERFORMANCE + 4)
|
||||
#define IDC_EDIT_PERFORMANCE_FILESIZE (IDD_PREFERENCE_SUB_PERFORMANCE + 5)
|
||||
|
@ -446,4 +446,5 @@
|
|||
#define IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION (IDD_PREFERENCE_SUB_PERFORMANCE + 8)
|
||||
#define IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE (IDD_PREFERENCE_SUB_PERFORMANCE + 9)
|
||||
#define IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP (IDD_PREFERENCE_SUB_PERFORMANCE + 10)
|
||||
#define IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK (IDD_PREFERENCE_SUB_PERFORMANCE + 11)
|
||||
#endif //PREFERENCE_RC_H
|
||||
|
|
Loading…
Reference in New Issue