From 61199d2f8068b409a13e3d17c87b0e8d6cbf5c0b Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Tue, 31 Jan 2023 22:40:05 -0800 Subject: [PATCH] [boot] Don't print 'ok' in status line until success Previously, status_line would show 'ok' until something went wrong. Now, show an empty box until either a warning or error happens, or the cleanup happens without an issue. --- src/boot/status.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/boot/status.cpp b/src/boot/status.cpp index 4968fd7..ed48fda 100644 --- a/src/boot/status.cpp +++ b/src/boot/status.cpp @@ -11,17 +11,19 @@ constexpr int num_boxes = 30; namespace boot { -static constexpr int level_ok = 0; -static constexpr int level_warn = 1; -static constexpr int level_fail = 2; +static constexpr int level_ok = 1; +static constexpr int level_warn = 2; +static constexpr int level_fail = 3; static const wchar_t *level_tags[] = { + L" ", L" ok ", L" warn ", L"failed" }; static const uefi::attribute level_colors[] = { + uefi::attribute::green, uefi::attribute::green, uefi::attribute::brown, uefi::attribute::light_red @@ -33,7 +35,7 @@ unsigned status_bar::s_count = 0; status_line::status_line(const wchar_t *message, const wchar_t *context, bool fails_clean) : status(fails_clean), - m_level(level_ok), + m_level(0), m_depth(0), m_outer(nullptr) { @@ -70,6 +72,12 @@ status_line::~status_line() m_outer->m_level = m_level; m_outer->print_status_tag(); } + + if (m_level < level_ok) { + m_level = level_ok; + print_status_tag(); + } + s_current = m_outer; }