fixed some resizing-issues with reiserfs.
* src/Dialog_Base_Partition.cc,src/Dialog_Partition_Resize_Move.cc: fixed some resizing-issues with reiserfs.
This commit is contained in:
parent
110868837b
commit
3bf218f8a0
|
@ -1,3 +1,8 @@
|
|||
2004-10-08 Bart Hakvoort <gparted@users.sf.net>
|
||||
|
||||
* src/Dialog_Base_Partition.cc,
|
||||
src/Dialog_Partition_Resize_Move.cc: fixed some resizing-issues with reiserfs.
|
||||
|
||||
2004-10-07 Bart Hakvoort <gparted@users.sf.net>
|
||||
|
||||
* src/Dialog_Base_Partition.cc,
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
namespace GParted
|
||||
{
|
||||
|
||||
Dialog_Base_Partition::Dialog_Base_Partition( )
|
||||
Dialog_Base_Partition::Dialog_Base_Partition( )
|
||||
{
|
||||
this ->set_has_separator( false ) ;
|
||||
|
||||
|
@ -147,7 +147,7 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
|
|||
{
|
||||
case NEW : this->add_button( Gtk::Stock::ADD,Gtk::RESPONSE_OK );
|
||||
break ;
|
||||
case RESIZE_MOVE: if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" )
|
||||
case RESIZE_MOVE: if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" || selected_partition.filesystem == "reiserfs")
|
||||
str_temp = _("Resize") ;
|
||||
else
|
||||
str_temp = _("Resize/Move") ;
|
||||
|
@ -225,7 +225,16 @@ void Dialog_Base_Partition::on_signal_resize( int x_start, int x_end, Frame_Resi
|
|||
return ;
|
||||
}
|
||||
|
||||
|
||||
//check for lower limit reiserfs
|
||||
if ( selected_partition.filesystem == "reiserfs" && ( x_end - x_start ) * MB_PER_PIXEL < 40 )
|
||||
{
|
||||
frame_resizer_base ->set_x_start( this ->x_start );
|
||||
frame_resizer_base ->set_x_end( this ->x_end );
|
||||
|
||||
frame_resizer_base ->Draw_Partition() ;
|
||||
GRIP = false ;
|
||||
return ;
|
||||
}
|
||||
|
||||
spinbutton_size .set_value( ( x_end - x_start ) * MB_PER_PIXEL ) ;
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
{
|
||||
|
||||
//see if we need a fixed_start
|
||||
if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" )
|
||||
if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" || selected_partition.filesystem == "reiserfs" )
|
||||
{
|
||||
this ->set_title( String::ucompose( _("Resize %1"), selected_partition .partition) ) ;
|
||||
this ->fixed_start = true;
|
||||
|
@ -85,8 +85,8 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
|
||||
Sector previous, next ;
|
||||
previous = next = 0 ;
|
||||
//also check the partitions filesystem ( if this is ext2/3 then previous should be 0 )
|
||||
if ( t >= 1 && partitions[t -1].type == GParted::UNALLOCATED && selected_partition.filesystem != "ext2" && selected_partition.filesystem != "ext3" && partitions[t -1] .inside_extended == selected_partition.inside_extended )
|
||||
//also check the partitions filesystem ( if this is ext2/3 or reiserfs then previous should be 0 )
|
||||
if ( t >= 1 && partitions[t -1].type == GParted::UNALLOCATED && selected_partition.filesystem != "ext2" && selected_partition.filesystem != "ext3" && selected_partition.filesystem != "reiserfs" && partitions[t -1] .inside_extended == selected_partition.inside_extended )
|
||||
{
|
||||
previous = partitions[t -1].sector_end - partitions[t -1].sector_start ;
|
||||
START = partitions[t -1].sector_start ;
|
||||
|
@ -117,10 +117,12 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
//set values of spinbutton_size
|
||||
//since some filesystems have upper and lower limits we need to check for this
|
||||
long LOWER, UPPER;
|
||||
if ( selected_partition.filesystem == "fat16" && selected_partition .Get_Used_MB() < 32 )
|
||||
if ( selected_partition.filesystem == "fat16" && selected_partition .Get_Used_MB() < 32 )
|
||||
LOWER = 32 +1 ;
|
||||
else if ( selected_partition.filesystem == "fat32" && selected_partition .Get_Used_MB() < 256 )
|
||||
else if ( selected_partition.filesystem == "fat32" && selected_partition .Get_Used_MB() < 256 )
|
||||
LOWER = 256 +1; //when shrinking to 256 the filesystem converts to fat16, thats why i added the 1
|
||||
else if ( selected_partition.filesystem == "reiserfs" && selected_partition .Get_Used_MB() < 40 )
|
||||
LOWER = 40 ;
|
||||
else
|
||||
LOWER = selected_partition .Get_Used_MB() +1;
|
||||
|
||||
|
@ -130,7 +132,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
UPPER = Sector_To_MB( total_length ) ;
|
||||
|
||||
spinbutton_size .set_range( LOWER , UPPER ) ;
|
||||
spinbutton_size .set_value( selected_partition .Get_Length_MB() ) ;
|
||||
spinbutton_size .set_value( selected_partition .Get_Length_MB() ) ;
|
||||
|
||||
//set values of spinbutton_after
|
||||
spinbutton_after .set_range( 0, Sector_To_MB( total_length ) - LOWER ) ;
|
||||
|
|
Loading…
Reference in New Issue