From c3352fb24a999d5d1cf8f998621673efe5936a93 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Sun, 25 Apr 2010 11:09:18 -0600 Subject: [PATCH] Clean up progress bar current status after copy/move action Also ensure that final progress bar current status is set to completed value when the copy blocks method completes. --- src/Dialog_Progress.cc | 8 ++++---- src/GParted_Core.cc | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index 0e141634..84971fc4 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -1,5 +1,5 @@ /* Copyright (C) 2004 Bart - * Copyright (C) 2008, 2009 Curtis Gedak + * Copyright (C) 2008, 2009, 2010 Curtis Gedak * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -181,10 +181,10 @@ void Dialog_Progress::dispatcher_on_update_gui_elements() label_current_sub .set_markup( "" + label_current_sub_text + "\n" ) ; if ( operationdetail .fraction >= 0 ) - { progressbar_current .set_fraction( operationdetail .fraction > 1.0 ? 1.0 : operationdetail .fraction ) ; - progressbar_current .set_text( operationdetail .progress_text ) ; - } + + //To ensure progress bar height remains the same, add a space in case message is empty + progressbar_current .set_text( operationdetail .progress_text + " " ) ; } void Dialog_Progress::on_signal_show() diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 0a1453ed..358044ef 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -2450,6 +2450,12 @@ bool GParted_Core::copy_blocks( const Glib::ustring & src_device, timer_progress_timeout .reset() ; } } + //set progress bar current info on completion + set_progress_info( length, + llabs( done ), + timer_total, + operationdetail .get_last_child() .get_last_child(), + readonly ) ; free( buf ) ; }