diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 6131cef09..21d83cbfc 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1642,6 +1642,7 @@ Find in all files but exclude all folders log or logs recursively: + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 4ea61bd52..2d82dc285 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1892,11 +1892,11 @@ bool Notepad_plus::replaceInFilelist(std::vector & fileNames) if (i == updateOnCount) { updateOnCount += filesPerPercent; - progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str()); + progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str(), nbTotal); } else { - progress.setInfo(fileNames.at(i).c_str()); + progress.setInfo(fileNames.at(i).c_str(), nbTotal); } } @@ -1977,11 +1977,11 @@ bool Notepad_plus::findInFinderFiles(FindersInfo *findInFolderInfo) if (i == updateOnCount) { updateOnCount += filesPerPercent; - progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str()); + progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str(), nbTotal); } else { - progress.setInfo(fileNames.at(i).c_str()); + progress.setInfo(fileNames.at(i).c_str(), nbTotal); } } progress.close(); @@ -2069,11 +2069,11 @@ bool Notepad_plus::findInFilelist(std::vector & fileNames) if (i == updateOnCount) { updateOnCount += filesPerPercent; - progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str()); + progress.setPercent(int32_t((i * 100) / filesCount), fileNames.at(i).c_str(), nbTotal); } else { - progress.setInfo(fileNames.at(i).c_str()); + progress.setInfo(fileNames.at(i).c_str(), nbTotal); } } diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 76b60bb8a..7f08ed77a 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -5573,12 +5573,30 @@ void Progress::close() } -void Progress::setPercent(unsigned percent, const TCHAR *fileName) const +void Progress::setPercent(unsigned percent, const TCHAR* fileName, int nbHitsSoFar) const { if (_hwnd) { ::PostMessage(_hPBar, PBM_SETPOS, percent, 0); - ::SendMessage(_hPText, WM_SETTEXT, 0, reinterpret_cast(fileName)); + ::SendMessage(_hPathText, WM_SETTEXT, 0, reinterpret_cast(fileName)); + TCHAR str[16]; + _itow(nbHitsSoFar, str, 10); + ::SendMessage(_hRunningHitsText, WM_SETTEXT, 0, reinterpret_cast(str)); + } +} + + +void Progress::setInfo(const TCHAR* info, int nbHitsSoFar) const +{ + if (_hwnd) + { + ::SendMessage(_hPathText, WM_SETTEXT, 0, reinterpret_cast(info)); + if (nbHitsSoFar != -1) + { + TCHAR str[16]; + _itow(nbHitsSoFar, str, 10); + ::SendMessage(_hRunningHitsText, WM_SETTEXT, 0, reinterpret_cast(str)); + } } } @@ -5646,14 +5664,24 @@ int Progress::createProgressWindow() int yTextPos = dpiManager.scaleY(5); auto ctrlWidth = width - widthPadding - xStartPos; - _hPText = ::CreateWindowEx(0, TEXT("STATIC"), TEXT(""), + _hPathText = ::CreateWindowEx(0, TEXT("STATIC"), TEXT(""), WS_CHILD | WS_VISIBLE | SS_PATHELLIPSIS, xStartPos, yTextPos, ctrlWidth, textHeight, _hwnd, NULL, _hInst, NULL); - HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); - if (hf) - ::SendMessage(_hPText, WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); + generic_string hits = pNativeSpeaker->getLocalizedStrFromID("progress-hits-title", TEXT("Hits:")); + _hRunningHitsStaticText = ::CreateWindowEx(0, TEXT("STATIC"), hits.c_str(), + WS_CHILD | WS_VISIBLE | SS_RIGHT, + xStartPos, yTextPos + textHeight * 2, + 75, textHeight, + _hwnd, NULL, _hInst, NULL); + + _hRunningHitsText = ::CreateWindowEx(0, TEXT("STATIC"), TEXT(""), + WS_CHILD | WS_VISIBLE, + xStartPos + 75 + 2, yTextPos + textHeight * 2, + 70, textHeight, + _hwnd, NULL, _hInst, NULL); _hPBar = ::CreateWindowEx(0, PROGRESS_CLASS, TEXT("Progress Bar"), WS_CHILD | WS_VISIBLE | PBS_SMOOTH, @@ -5673,7 +5701,6 @@ int Progress::createProgressWindow() ::SendMessage(_hPBar, PBM_SETBARCOLOR, 0, static_cast(NppDarkMode::getDarkerTextColor())); } - NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); generic_string cancel = pNativeSpeaker->getLocalizedStrFromID("progress-cancel-button", TEXT("Cancel")); _hBtn = ::CreateWindowEx(0, TEXT("BUTTON"), cancel.c_str(), @@ -5682,8 +5709,14 @@ int Progress::createProgressWindow() cBTNwidth, cBTNheight, _hwnd, NULL, _hInst, NULL); + HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); if (hf) + { + ::SendMessage(_hPathText, WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + ::SendMessage(_hRunningHitsStaticText, WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + ::SendMessage(_hRunningHitsText, WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); ::SendMessage(_hBtn, WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + } NppDarkMode::autoSubclassAndThemeChildControls(_hwnd); NppDarkMode::setDarkTitleBar(_hwnd); diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index 383cdb728..3fa49f1f4 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -568,13 +568,8 @@ public: return false; } - void setInfo(const TCHAR *info) const - { - if (_hwnd) - ::SendMessage(_hPText, WM_SETTEXT, 0, reinterpret_cast(info)); - } - - void setPercent(unsigned percent, const TCHAR *fileName) const; + void setPercent(unsigned percent, const TCHAR* fileName, int nbHitsSoFar) const; + void setInfo(const TCHAR* info, int nbHitsSoFar = -1) const; private: static const TCHAR cClassName[]; @@ -599,7 +594,9 @@ private: TCHAR _header[128] = {'\0'}; HANDLE _hThread = nullptr; HANDLE _hActiveState = nullptr; - HWND _hPText = nullptr; + HWND _hPathText = nullptr; + HWND _hRunningHitsStaticText = nullptr; + HWND _hRunningHitsText = nullptr; HWND _hPBar = nullptr; HWND _hBtn = nullptr; };