diff options
author | Sylvain Joubert <joubert.sy@gmail.com> | 2019-11-05 16:07:42 (GMT) |
---|---|---|
committer | Sylvain Joubert <joubert.sy@gmail.com> | 2019-11-16 07:27:32 (GMT) |
commit | 88cfef0821933dfa4e840c793cdb9352d4b4423b (patch) | |
tree | 47b496dfe637483adfc08a93d6ca1914deb0e296 /Source/CursesDialog/cmCursesLongMessageForm.cxx | |
parent | a10e11fd7c36a2086223384d35f3d5325ef84f05 (diff) | |
download | CMake-88cfef0821933dfa4e840c793cdb9352d4b4423b.zip CMake-88cfef0821933dfa4e840c793cdb9352d4b4423b.tar.gz CMake-88cfef0821933dfa4e840c793cdb9352d4b4423b.tar.bz2 |
ccmake: redirect stdout/stderr to the displayed logs
Use cmSystemTools to report some messages.
These should now be caught and displayed properly,
both in ccmake and cmake-gui
Avoid log display flickering during processing
- Don't clear the screen each time the long message form is rendered.
It always renders the whole screen again so clearing it only causes
flickering.
- Add scroll down capabilities to the long message form so that it can
draw itself directly in the correct state. This removes the need to
programatically scroll down just after that also caused flickering.
Fixes #19882
Fixes #13288
Diffstat (limited to 'Source/CursesDialog/cmCursesLongMessageForm.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesLongMessageForm.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index a69fdee..806e663 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -17,7 +17,9 @@ inline int ctrl(int z) } cmCursesLongMessageForm::cmCursesLongMessageForm( - std::vector<std::string> const& messages, const char* title) + std::vector<std::string> const& messages, const char* title, + ScrollBehavior scrollBehavior) + : Scrolling(scrollBehavior) { // Append all messages into on big string this->Messages = cmJoin(messages, "\n"); @@ -109,8 +111,6 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, const char* msg = this->Messages.c_str(); - curses_clear(); - if (this->Fields[0]) { free_field(this->Fields[0]); this->Fields[0] = nullptr; @@ -133,7 +133,11 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, } i++; } - form_driver(this->Form, REQ_BEG_FIELD); + if (this->Scrolling == ScrollBehavior::ScrollDown) { + form_driver(this->Form, REQ_END_FIELD); + } else { + form_driver(this->Form, REQ_BEG_FIELD); + } this->UpdateStatusBar(); touchwin(stdscr); @@ -174,13 +178,3 @@ void cmCursesLongMessageForm::HandleInput() wrefresh(stdscr); } } - -void cmCursesLongMessageForm::ScrollDown() -{ - if (this->Form) { - form_driver(this->Form, REQ_END_FIELD); - this->UpdateStatusBar(); - touchwin(stdscr); - wrefresh(stdscr); - } -} |