Fixed a crasher with the New Partition Dialog (thanks to Tino for

* src/Dialog_Partition_New.cc,
  src/Frame_Resizer_Base.cc: Fixed a crasher with the New Partition Dialog (thanks to Tino for reporting)
This commit is contained in:
Bart Hakvoort 2004-12-01 21:31:59 +00:00
parent 7c9d05b60c
commit 587c4af200
3 changed files with 41 additions and 35 deletions

View File

@ -1,3 +1,8 @@
2004-12-01 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_Partition_New.cc,
src/Frame_Resizer_Base.cc: Fixed a crasher with the New Partition Dialog (thanks to Tino for reporting)
2004-11-30 Bart Hakvoort <gparted@users.sf.net>
* src/fat16.cc,

View File

@ -207,7 +207,7 @@ void Dialog_Partition_New::optionmenu_changed( bool type )
spinbutton_before .set_range( 0, TOTAL_MB - MIN ) ;
spinbutton_size .set_range( MIN, MAX ) ;
spinbutton_after .set_range( 0, TOTAL_MB - MIN ) ;
//set contents of label_minmax
Set_MinMax_Text( MIN, MAX ) ;
}
@ -221,8 +221,7 @@ void Dialog_Partition_New::optionmenu_changed( bool type )
color_temp .set( Get_Color( FILESYSTEMS[ optionmenu_filesystem.get_history() ] .filesystem ) ) ;
frame_resizer_base ->set_rgb_partition_color( color_temp ) ;
if ( this ->is_realized( ) )
frame_resizer_base ->Draw_Partition( ) ;
frame_resizer_base ->Draw_Partition( ) ;
}
void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted )
@ -237,14 +236,6 @@ void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted )
//unformatted is always available
menu_filesystem .items( ) .back( ) .set_sensitive( true ) ;
//find and set first enabled filesystem
for ( unsigned int t = 0 ; t < menu_filesystem .items( ) .size( ) ; t++ )
if ( menu_filesystem .items( )[ t ] .sensitive( ) )
{
first_creatable_fs = t ;
break ;
}
//check if selected unallocated is big enough for fs'es with min. size
//fat16
if ( this ->selected_partition .Get_Length_MB() < 32 )
@ -256,6 +247,13 @@ void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted )
if ( this ->selected_partition .Get_Length_MB() < 40 )
menu_filesystem .items()[ 5 ] .set_sensitive( false ) ;
//find and set first enabled filesystem
for ( unsigned int t = 0 ; t < menu_filesystem .items( ) .size( ) ; t++ )
if ( menu_filesystem .items( )[ t ] .sensitive( ) )
{
first_creatable_fs = t ;
break ;
}
}

View File

@ -222,30 +222,33 @@ void Frame_Resizer_Base::Draw_Partition( )
if ( UNUSED < 0 )
UNUSED = 0 ;
drawingarea .get_window() ->clear() ;
//the two rectangles on each side of the partition
gc ->set_foreground( color_arrow_rectangle );
drawingarea .get_window() ->draw_rectangle( gc, true, 0,0,10,50 );
drawingarea .get_window() ->draw_rectangle( gc, true, 526,0,10,50 );
//partition
gc ->set_foreground( color_partition );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START,0,X_END - X_START,50 );
//used
gc ->set_foreground( color_used );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER, BORDER, USED ,34 );
//unused
gc ->set_foreground( color_unused );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER +USED, BORDER, UNUSED,34 );
//resize grips
if ( ! fixed_start )
Draw_Resize_Grip( ARROW_LEFT ) ;
Draw_Resize_Grip( ARROW_RIGHT ) ;
if ( drawingarea .get_window( ) )
{
drawingarea .get_window() ->clear() ;
//the two rectangles on each side of the partition
gc ->set_foreground( color_arrow_rectangle );
drawingarea .get_window() ->draw_rectangle( gc, true, 0,0,10,50 );
drawingarea .get_window() ->draw_rectangle( gc, true, 526,0,10,50 );
//partition
gc ->set_foreground( color_partition );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START,0,X_END - X_START,50 );
//used
gc ->set_foreground( color_used );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER, BORDER, USED ,34 );
//unused
gc ->set_foreground( color_unused );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER +USED, BORDER, UNUSED,34 );
//resize grips
if ( ! fixed_start )
Draw_Resize_Grip( ARROW_LEFT ) ;
Draw_Resize_Grip( ARROW_RIGHT ) ;
}
}