[gparted] Warn partition move queued that might break boot process (#627199)



commit aa14b25f1b1cf2eeaff8ea18b3ee1a2c78a221b1
Author: Curtis Gedak <gedakc gmail com>
Date:   Wed Sep 1 13:54:00 2010 -0600

    Warn partition move queued that might break boot process (#627199)

 src/Win_GParted.cc |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 52d4269..d49388c 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -1424,6 +1424,30 @@ void Win_GParted::activate_resize()
 			operation ->icon = render_icon( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_MENU );
 
 			Add_Operation( operation ) ;
+
+			//Display notification if move operation has been queued
+			if ( operation ->partition_original .sector_start != operation ->partition_new .sector_start )
+			{
+				//Warn that move operation might break boot process
+				Gtk::MessageDialog dialog( *this
+				                           /*TO TRANSLATORS: looks like   You queued an operation to move the start sector of partition /dev/sda3. */
+				                         , String::ucompose( _( "You have queued an operation to move the start sector of partition %1." ), operation ->partition_original .get_path() )
+				                         , false
+				                         , Gtk::MESSAGE_WARNING
+				                         , Gtk::BUTTONS_OK
+				                         , true
+				                         ) ;
+				Glib::ustring tmp_msg = _( "Moving a partition might cause your operating system to fail to boot." ) ;
+				tmp_msg += "  Failure to boot is most likely to occur if you move the GNU/Linux partition containing /boot, or if you move the Windows system partition C:." ;
+				tmp_msg += "\n" ;
+				tmp_msg += _( "You can learn how to repair the boot configuration in the GParted FAQ." ) ;
+				tmp_msg += "\n" ;
+				tmp_msg += "http://gparted.sourceforge.net/faq.php"; ;
+				tmp_msg += "\n\n" ;
+				tmp_msg += "Moving a partition might take a very long time to apply." ;
+				dialog .set_secondary_text( tmp_msg ) ;
+				dialog .run() ;
+			}
 		}
 	}
 }



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