[gparted] Re-enable ability to paste into an existing partition (#582101)



commit ef2fc4919cab87437f15bec93c6de5a80c2975dd
Author: Curtis Gedak <gedakc gmail com>
Date:   Wed Nov 25 12:36:43 2009 -0700

    Re-enable ability to paste into an existing partition (#582101)
    
    The ability to paste into an existing partition was disabled in
    v0.4.0.  This ability has been re-enabled along with a warning
    dialog that indicates the data in the existing partition will be
    lost if the copy and paste operation is applied.

 src/Win_GParted.cc |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 5f76acb..cb97d51 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -949,8 +949,7 @@ void Win_GParted::set_valid_operations()
 		if ( ! copied_partition .get_path() .empty() &&
 		     copied_partition .get_length() <= selected_partition .get_length() &&
 		     selected_partition .status == GParted::STAT_REAL &&
-		     copied_partition != selected_partition &&
-		     selected_partition .type == GParted::TYPE_UNALLOCATED )
+		     copied_partition != selected_partition )
 		     allow_paste( true ) ;
 
 		//see if we can somehow check/repair this file system....
@@ -1471,6 +1470,18 @@ void Win_GParted::activate_paste()
 		operation ->icon = render_icon( Gtk::Stock::COPY, Gtk::ICON_SIZE_MENU );
 
 		Add_Operation( operation ) ;
+
+		//Warn that paste operation will overwrite data in existing partition
+		Gtk::MessageDialog dialog( *this
+		                         , _( "You have pasted into an existing partition." )
+		                         , false
+		                         , Gtk::MESSAGE_WARNING
+		                         , Gtk::BUTTONS_OK
+		                         , true
+		                         ) ;
+		/*TO TRANSLATORS: looks like   The data in /dev/sda3 will be lost if you apply this operation. */
+		dialog .set_secondary_text( String::ucompose( _( "The data in %1 will be lost if you apply this operation."), partition_new .get_path() ) ) ;
+		dialog .run() ;
 	}
 }
 



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