diff --git a/far/changelog b/far/changelog index 8ee9ecbba8..bed4abd474 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- +drkns 04.08.2021 18:55:09 +0100 - build 5868 + +1. Continue 5866. + -------------------------------------------------------------------------------- drkns 03.08.2021 17:48:48 +0100 - build 5867 diff --git a/far/disabled_warnings.hpp b/far/disabled_warnings.hpp index 160a3a2d3e..8afbf86432 100644 --- a/far/disabled_warnings.hpp +++ b/far/disabled_warnings.hpp @@ -96,6 +96,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma warning(disable: 5052) // Keyword 'char8_t' was introduced in C++20 and requires use of the '/std:c++latest' command-line option #endif +#ifdef _DEBUG +// Happens only after "Apply code changes" +#pragma warning(disable: 4599) // command line argument number number does not match precompiled header +#endif + #endif diff --git a/far/editor.cpp b/far/editor.cpp index 965c13608a..0a821b6424 100644 --- a/far/editor.cpp +++ b/far/editor.cpp @@ -3459,7 +3459,7 @@ bool Editor::Search(bool Next) const auto strSearchStrLower = Case? strSearchStr : lower(strSearchStr); const time_check TimeCheck; - single_progress const Progress(msg(lng::MEditSearchTitle), format(msg(lng::MEditSearchingFor), QuotedStr), 0); + std::optional Progress; int StartLine = m_it_CurLine.Number(); SCOPED_ACTION(taskbar::indeterminate); SCOPED_ACTION(wakeful); @@ -3475,10 +3475,13 @@ bool Editor::Search(bool Next) break; } + if (!Progress) + Progress.emplace(msg(lng::MEditSearchTitle), format(msg(lng::MEditSearchingFor), QuotedStr), 0); + SetCursorType(false, -1); const auto Total = FindAllReferences? Lines.size() : ReverseSearch? StartLine : Lines.size() - StartLine; const auto Current = abs(CurPtr.Number() - StartLine); - Progress.update(Total > 0? Current * 100 / Total : 100); + Progress->update(Total > 0? Current * 100 / Total : 100); taskbar::set_value(Current,Total); } diff --git a/far/fileedit.cpp b/far/fileedit.cpp index 9a04f47b13..f54276c23f 100644 --- a/far/fileedit.cpp +++ b/far/fileedit.cpp @@ -1639,7 +1639,7 @@ bool FileEditor::LoadFile(const string& Name,int &UserBreak, error_state_ex& Err LOGWARNING(L"GetSize({}): {}"sv, EditFile.GetName(), last_error()); } - single_progress const Progress(msg(lng::MEditTitle), format(msg(lng::MEditReading), Name), 0); + std::optional Progress; const time_check TimeCheck; @@ -1669,6 +1669,9 @@ bool FileEditor::LoadFile(const string& Name,int &UserBreak, error_state_ex& Err return false; } + if (!Progress) + Progress.emplace(msg(lng::MEditTitle), format(msg(lng::MEditReading), Name), 0); + SetCursorType(false, 0); const auto CurPos = EditFile.GetPointer(); auto Percent = FileSize? CurPos * 100 / FileSize : 0; @@ -1685,7 +1688,7 @@ bool FileEditor::LoadFile(const string& Name,int &UserBreak, error_state_ex& Err Percent = FileSize? std::min(CurPos * 100 / FileSize, 100ull) : 100; } - Progress.update(Percent); + Progress->update(Percent); } if (m_editor->GlobalEOL == eol::none && Str.Eol != eol::none) @@ -2036,8 +2039,7 @@ int FileEditor::SaveFile(const string& Name,int Ask, bool bSaveAs, error_state_e if (!bSaveAs) AddSignature = m_bAddSignature; - single_progress const Progress(msg(lng::MEditTitle), format(msg(lng::MEditSaving), Name), 0); - + std::optional Progress; const time_check TimeCheck; // We've already validated the codepage above @@ -2051,7 +2053,10 @@ int FileEditor::SaveFile(const string& Name,int Ask, bool bSaveAs, error_state_e if (TimeCheck) { - Progress.update(LineNumber * 100 / m_editor->Lines.size()); + if (!Progress) + Progress.emplace(msg(lng::MEditTitle), format(msg(lng::MEditSaving), Name), 0); + + Progress->update(LineNumber * 100 / m_editor->Lines.size()); } const auto& SaveStr = Line.GetString(); diff --git a/far/filelist.cpp b/far/filelist.cpp index dd64e15060..5331ca6233 100644 --- a/far/filelist.cpp +++ b/far/filelist.cpp @@ -5074,8 +5074,6 @@ void FileList::CountDirSize(bool IsRealNames) //Рефреш текущему времени для фильтра перед началом операции m_Filter->UpdateCurrentTime(); - time_check TimeCheck; - struct { unsigned long long Items; @@ -5083,16 +5081,20 @@ void FileList::CountDirSize(bool IsRealNames) } Total{}; - dirinfo_progress const DirinfoProgress(msg(lng::MDirInfoViewTitle)); + time_check TimeCheck; + std::optional DirinfoProgress; const auto DirInfoCallback = [&](string_view const Name, unsigned long long const ItemsCount, unsigned long long const Size) { if (!TimeCheck) return; - DirinfoProgress.set_name(Name); - DirinfoProgress.set_count(Total.Items + ItemsCount); - DirinfoProgress.set_size(Total.Size + Size); + if (!DirinfoProgress) + DirinfoProgress.emplace(msg(lng::MDirInfoViewTitle)); + + DirinfoProgress->set_name(Name); + DirinfoProgress->set_count(Total.Items + ItemsCount); + DirinfoProgress->set_size(Total.Size + Size); }; for (auto& i: m_ListData) diff --git a/far/plugapi.cpp b/far/plugapi.cpp index 509c547ac5..cdb6e36530 100644 --- a/far/plugapi.cpp +++ b/far/plugapi.cpp @@ -1661,16 +1661,19 @@ intptr_t WINAPI apiGetPluginDirList(const UUID* PluginId, HANDLE hPlugin, const // BUGBUG This is API, shouldn't the callback be empty? const time_check TimeCheck; - dirinfo_progress const DirinfoProgress(msg(lng::MPreparingList)); + std::optional DirinfoProgress; const auto DirInfoCallback = [&](string_view const Name, unsigned long long const ItemsCount, unsigned long long const Size) { if (!TimeCheck) return; - DirinfoProgress.set_name(Name); - DirinfoProgress.set_count(ItemsCount); - DirinfoProgress.set_size(Size); + if (!DirinfoProgress) + DirinfoProgress.emplace(msg(lng::MPreparingList)); + + DirinfoProgress->set_name(Name); + DirinfoProgress->set_count(ItemsCount); + DirinfoProgress->set_size(Size); }; const auto Result = GetPluginDirList(UuidToPlugin(PluginId), hPlugin, Dir, nullptr, *Items, DirInfoCallback); diff --git a/far/qview.cpp b/far/qview.cpp index e1fe376011..b3c11019f9 100644 --- a/far/qview.cpp +++ b/far/qview.cpp @@ -401,16 +401,19 @@ void QuickView::ShowFile(string_view const FileName, const UserDataItem* const U if (hDirPlugin || os::fs::is_directory(strCurFileName)) { const time_check TimeCheck; - dirinfo_progress const DirinfoProgress(msg(lng::MQuickViewTitle)); + std::optional DirinfoProgress; const auto DirInfoCallback = [&](string_view const Name, unsigned long long const ItemsCount, unsigned long long const Size) { if (!TimeCheck) return; - DirinfoProgress.set_name(Name); - DirinfoProgress.set_count(ItemsCount); - DirinfoProgress.set_size(Size); + if (!DirinfoProgress) + DirinfoProgress.emplace(msg(lng::MQuickViewTitle)); + + DirinfoProgress->set_name(Name); + DirinfoProgress->set_count(ItemsCount); + DirinfoProgress->set_size(Size); }; if (SameFile && !hDirPlugin) diff --git a/far/scrobj.cpp b/far/scrobj.cpp index fc047b7b12..ccfa79b5bf 100644 --- a/far/scrobj.cpp +++ b/far/scrobj.cpp @@ -189,6 +189,7 @@ void ScreenObjectWithShadow::Shadow(bool Full) { ShadowSaveScr = std::make_unique(rectangle{ 0, 0, ScrX, ScrY }); MakeShadow({ 0, 0, ScrX, ScrY }); + DropShadow(m_Where); } } else diff --git a/far/stddlg.cpp b/far/stddlg.cpp index 65611de7e8..a2e2d416ff 100644 --- a/far/stddlg.cpp +++ b/far/stddlg.cpp @@ -900,6 +900,8 @@ void progress_impl::init(span const Items, rectangle const Positio m_Dialog->SetPosition(Position); m_Dialog->SetCanLoseFocus(true); m_Dialog->Process(); + + Global->WindowManager->PluginCommit(); } struct single_progress_detail diff --git a/far/vbuild.m4 b/far/vbuild.m4 index a328b99f49..8029a14b02 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -5867 +5868 diff --git a/far/viewer.cpp b/far/viewer.cpp index 9d69d34617..deba4935c1 100644 --- a/far/viewer.cpp +++ b/far/viewer.cpp @@ -3376,7 +3376,7 @@ void Viewer::Search(int Next,const Manager::Key* FirstChar) SCOPED_ACTION(taskbar::indeterminate); SetCursorType(false, 0); - single_progress const Progress(msg(lng::MViewSearchTitle), concat(msg(SearchHex? lng::MViewSearchingHex : lng::MViewSearchingFor), L' ', strMsgStr), 0); + std::optional Progress; const time_check TimeCheck; for (;;) @@ -3452,7 +3452,10 @@ void Viewer::Search(int Next,const Manager::Key* FirstChar) percent = static_cast(done*100/total); } - Progress.update(percent); + if (!Progress) + Progress.emplace(msg(lng::MViewSearchTitle), concat(msg(SearchHex? lng::MViewSearchingHex : lng::MViewSearchingFor), L' ', strMsgStr), 0); + + Progress->update(percent); } } }