From ea9228ecad193d53a4beba2432e619ff8756873d Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Thu, 9 Mar 2006 20:03:12 +0000 Subject: [PATCH] only allow 'swapon' on real partitions * src/Win_GParted.cc: only allow 'swapon' on real partitions --- ChangeLog | 4 ++++ src/Win_GParted.cc | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3d2de4e..a7d2c582 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-09 Bart Hakvoort + + * src/Win_GParted.cc: only allow 'swapon' on real partitions + 2006-03-09 Bart Hakvoort * include/Win_GParted.h, diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 4b57fe6a..4e128168 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -666,10 +666,9 @@ bool Win_GParted::Quit_Check_Operations() void Win_GParted::set_valid_operations() { - //FIXME: we shouldn't allow NEW partitions to be activated (swap/mount) allow_new( false ); allow_delete( false ); allow_resize( false ); allow_copy( false ); - allow_paste( false ); allow_format( false ); allow_info( false ) ; - allow_toggle_swap_mount_state( false ) ; + allow_paste( false ); allow_format( false ); allow_toggle_swap_mount_state( false ) ; + allow_info( false ) ; dynamic_cast(menu_partition .items()[ 10 ] .get_child() ) ->set_label( _("unmount") ) ; @@ -683,7 +682,8 @@ void Win_GParted::set_valid_operations() //deal with swap... if ( selected_partition .filesystem == GParted::FS_LINUX_SWAP ) { - allow_toggle_swap_mount_state( true ) ; + if ( selected_partition .status == GParted::STAT_REAL ) + allow_toggle_swap_mount_state( true ) ; if ( selected_partition .busy ) {