diff options
author | Brad King <brad.king@kitware.com> | 2020-04-09 12:10:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-09 12:12:12 (GMT) |
commit | 0e1313cdf4a2f8d5c2675188b55ecb7291446d1f (patch) | |
tree | 16295d8556ba58645735756b708e67a626dc992c /Source/CursesDialog/cmCursesMainForm.cxx | |
parent | 936225eb4501501e67d1c7896d432abb3e5d70b8 (diff) | |
parent | 60bfaa8fe61fe65b706a304ce4e48f85c13f7c15 (diff) | |
download | CMake-0e1313cdf4a2f8d5c2675188b55ecb7291446d1f.zip CMake-0e1313cdf4a2f8d5c2675188b55ecb7291446d1f.tar.gz CMake-0e1313cdf4a2f8d5c2675188b55ecb7291446d1f.tar.bz2 |
Merge topic 'ccmake_incremental_log_display'
60bfaa8fe6 ccmake: Use incremental rendering for the logs
e9b36731e9 cmCursesLongMessageForm: Factor out helper to draw message to form
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4573
Diffstat (limited to 'Source/CursesDialog/cmCursesMainForm.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 7752a68..df34283 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -454,11 +454,11 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) this->LastProgress.append(progressBarCompleted, '#'); this->LastProgress.append(progressBarWidth - progressBarCompleted, ' '); this->LastProgress += "] " + msg + "..."; + this->DisplayOutputs(std::string()); } else { this->Outputs.emplace_back(msg); + this->DisplayOutputs(msg); } - - this->DisplayOutputs(); } int cmCursesMainForm::Configure(int noconfigure) @@ -590,7 +590,7 @@ void cmCursesMainForm::AddError(const std::string& message, { this->Outputs.emplace_back(message); this->HasNonStatusOutputs = true; - this->DisplayOutputs(); + this->DisplayOutputs(message); } void cmCursesMainForm::RemoveEntry(const char* value) @@ -996,18 +996,22 @@ void cmCursesMainForm::ResetOutputs() this->LastProgress.clear(); } -void cmCursesMainForm::DisplayOutputs() +void cmCursesMainForm::DisplayOutputs(std::string const& newOutput) { int xi; int yi; getmaxyx(stdscr, yi, xi); - auto newLogForm = new cmCursesLongMessageForm( - this->Outputs, this->LastProgress.c_str(), - cmCursesLongMessageForm::ScrollBehavior::ScrollDown); - CurrentForm = newLogForm; - this->LogForm.reset(newLogForm); - this->LogForm->Render(1, 1, xi, yi); + if (CurrentForm != this->LogForm.get()) { + auto newLogForm = new cmCursesLongMessageForm( + this->Outputs, this->LastProgress.c_str(), + cmCursesLongMessageForm::ScrollBehavior::ScrollDown); + CurrentForm = newLogForm; + this->LogForm.reset(newLogForm); + this->LogForm->Render(1, 1, xi, yi); + } else { + this->LogForm->UpdateContent(newOutput, this->LastProgress); + } } const char* cmCursesMainForm::s_ConstHelpMessage = |