[gparted] Clean up progress bar current status after copy/move action



commit c3352fb24a999d5d1cf8f998621673efe5936a93
Author: Curtis Gedak <gedakc gmail com>
Date:   Sun Apr 25 11:09:18 2010 -0600

    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 0e14163..84971fc 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( "<i>" + label_current_sub_text + "</i>\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 0a1453e..358044e 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 ) ;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]