From 1718c5d2fb1c7d02d4b56cbd96502f7110aaded0 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Mon, 12 Jun 2023 16:23:39 +0100 Subject: [PATCH] Clear progress bar text when starting it (#230) These operations use steps which generate progress bar bytes copied information text: * Partition move or copy using GParted's internal block copy * EXT2/3/4 partition move or copy * XFS partition copy The bytes copied text looks like this (after the copy completes and the time remaining is no longer included): 1.00 GiB of 1.00 GiB copied And these operations use steps which generate progress bar information without text (because the progress bar data only represents a fraction complete): * EXT2/3/4 partition resize * EXT2/3/4 partition create * EXT2/3/4 partition format * EXT2/3/4 partition check * NTFS partition resize * NTFS partition copy In the Applying pending operations dialog, while an operation is being applied there are 2 progress bars. The top progress bar displays either a pulse bar or the progress bar data for the current step. Additionally for the relevant steps the progress bar generates the bytes copied text. This text, when available, is displayed in small grey characters just above the progress bar itself. Copy a FAT partition and apply. Bytes copied text is displayed just above the top progress bar. Copy an NTFS partition and apply. The left behind bytes copied text from the previous operation is displayed, instead of nothing. Restart GParted and copy an NTFS partition and apply. As intended, this time there is no bytes copied text displayed just above the top progress bar. As there is just a single ProgressBar object, single_progressbar, fix this by clearing the progress bar text each time it is started. Closes #230 - Missing progress bar text reset when applying operation --- src/ProgressBar.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProgressBar.cc b/src/ProgressBar.cc index 85e5f7cb..5175299c 100644 --- a/src/ProgressBar.cc +++ b/src/ProgressBar.cc @@ -37,6 +37,7 @@ void ProgressBar::start( double target, ProgressBar_Text text_mode ) m_target = target; m_progress = 0.0; m_text_mode = text_mode; + m_text.clear(); m_timer.start(); do_update(); }