removed inheritance from sigc::trackable. (this is already done by

* include/Frame_Resizer_Base.h: removed inheritance from sigc::trackable. (this is already done by Glib::Object). * src/Dialog_Partition_Copy.cc, src/Frame_Resizer_Base.cc: fixed issues with resizing reiserfs filesystems.
This commit is contained in:
Bart Hakvoort 2004-10-08 19:53:35 +00:00
parent c65731a497
commit bcb05b8540
4 changed files with 36 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2004-10-08 Bart Hakvoort <gparted@users.sf.net>
* include/Frame_Resizer_Base.h: removed inheritance from sigc::trackable. (this is already done by Glib::Object)
* src/Dialog_Partition_Copy.cc,
src/Frame_Resizer_Base.cc: fixed issues with resizing reiserfs filesystems.
2004-10-08 Bart Hakvoort <gparted@users.sf.net> 2004-10-08 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_About.cc: updated translatorcomment. * src/Dialog_About.cc: updated translatorcomment.

View File

@ -25,7 +25,7 @@
#define BORDER 8 #define BORDER 8
class Frame_Resizer_Base : public Gtk::Frame, virtual public sigc::trackable class Frame_Resizer_Base : public Gtk::Frame
{ {
public: public:

View File

@ -39,13 +39,17 @@ void Dialog_Partition_Copy::Set_Data( Partition & selected_partition, Partition
START = selected_partition.sector_start ; START = selected_partition.sector_start ;
total_length = selected_partition.sector_end - selected_partition.sector_start ; total_length = selected_partition.sector_end - selected_partition.sector_start ;
TOTAL_MB = selected_partition .Get_Length_MB() ; TOTAL_MB = selected_partition .Get_Length_MB() ;
MB_PER_PIXEL = (double) TOTAL_MB / 500 ; MB_PER_PIXEL = (double) TOTAL_MB / 500 ;
//now calculate proportional length of partition //now calculate proportional length of partition
frame_resizer_base ->set_x_start( 0 ) ; frame_resizer_base ->set_x_start( 0 ) ;
frame_resizer_base ->set_x_end( ( Round( (double) (copied_partition.sector_end - copied_partition.sector_start) / ( (double)total_length/500) )) ) ; frame_resizer_base ->set_x_end( ( Round( (double) (copied_partition.sector_end - copied_partition.sector_start) / ( (double)total_length/500) )) ) ;
frame_resizer_base ->set_used( frame_resizer_base ->get_x_end() ) ; frame_resizer_base ->set_used( frame_resizer_base ->get_x_end() ) ;
//used to store current positions (see Dialog_Base_Partition::on_signal_resize)
this ->x_start = frame_resizer_base ->get_x_start( ) ;
this ->x_end = frame_resizer_base ->get_x_end( ) ;
//set values of spinbutton_before //set values of spinbutton_before
spinbutton_before .set_range( 0, TOTAL_MB - copied_partition .Get_Length_MB() -1 ) ;//mind the -1 !! spinbutton_before .set_range( 0, TOTAL_MB - copied_partition .Get_Length_MB() -1 ) ;//mind the -1 !!
spinbutton_before .set_value( 0 ) ; spinbutton_before .set_value( 0 ) ;
@ -55,14 +59,14 @@ void Dialog_Partition_Copy::Set_Data( Partition & selected_partition, Partition
if ( copied_partition.filesystem == "fat16" && Sector_To_MB( total_length ) > 1023 ) if ( copied_partition.filesystem == "fat16" && Sector_To_MB( total_length ) > 1023 )
UPPER = 1023 ; UPPER = 1023 ;
else else
UPPER = TOTAL_MB; UPPER = TOTAL_MB ;
spinbutton_size .set_range( copied_partition .Get_Length_MB() +1, UPPER ) ; spinbutton_size .set_range( copied_partition .Get_Length_MB() +1, UPPER ) ;
spinbutton_size .set_value( copied_partition .Get_Length_MB() ) ; spinbutton_size .set_value( copied_partition .Get_Length_MB() ) ;
//set values of spinbutton_after //set values of spinbutton_after
spinbutton_after .set_range( 0, TOTAL_MB - copied_partition .Get_Length_MB() -1 ) ; spinbutton_after .set_range( 0, TOTAL_MB - copied_partition .Get_Length_MB() -1 ) ;
spinbutton_after .set_value( TOTAL_MB - copied_partition .Get_Length_MB() ) ; spinbutton_after .set_value( TOTAL_MB - copied_partition .Get_Length_MB() ) ;
//set contents of label_minmax //set contents of label_minmax
Set_MinMax_Text( copied_partition .Get_Length_MB() +1, UPPER ) ; Set_MinMax_Text( copied_partition .Get_Length_MB() +1, UPPER ) ;

View File

@ -61,14 +61,14 @@ void Frame_Resizer_Base::init()
void Frame_Resizer_Base::set_rgb_partition_color( const Gdk::Color & color ) void Frame_Resizer_Base::set_rgb_partition_color( const Gdk::Color & color )
{ {
this ->get_colormap() ->free_colors( color_partition, 1 ) ; this ->get_colormap() ->free_colors( color_partition, 1 ) ;
this->color_partition = color ; this ->color_partition = color ;
this ->get_colormap() ->alloc_color( color_partition ) ; this ->get_colormap() ->alloc_color( color_partition ) ;
} }
void Frame_Resizer_Base::override_default_rgb_unused_color( const Gdk::Color & color ) void Frame_Resizer_Base::override_default_rgb_unused_color( const Gdk::Color & color )
{ {
this ->get_colormap() ->free_colors( color_unused, 1 ) ; this ->get_colormap() ->free_colors( color_unused, 1 ) ;
this->color_unused = color ; this ->color_unused = color ;
this ->get_colormap() ->alloc_color( color_unused ) ; this ->get_colormap() ->alloc_color( color_unused ) ;
} }
@ -142,7 +142,7 @@ bool Frame_Resizer_Base::drawingarea_on_mouse_motion( GdkEventMotion *ev )
drawingarea .get_parent_window() ->set_cursor( *cursor_resize ) ; drawingarea .get_parent_window() ->set_cursor( *cursor_resize ) ;
else if ( ev ->x >= X_END && ev ->x <= X_END + 10 && ev ->y >= 5 && ev ->y <= 45 ) //right grip else if ( ev ->x >= X_END && ev ->x <= X_END + 10 && ev ->y >= 5 && ev ->y <= 45 ) //right grip
drawingarea .get_parent_window() ->set_cursor( *cursor_resize ) ; drawingarea .get_parent_window() ->set_cursor( *cursor_resize ) ;
else if ( ! fixed_start && ev ->x >= X_START && ev ->x <= X_END ) //move grip else if ( ! fixed_start && ev ->x >= X_START && ev ->x <= X_END ) //move grip
drawingarea .get_parent_window() ->set_cursor( *cursor_move ) ; drawingarea .get_parent_window() ->set_cursor( *cursor_move ) ;
else //normal pointer else //normal pointer
drawingarea .get_parent_window() ->set_cursor( *cursor_normal ) ; drawingarea .get_parent_window() ->set_cursor( *cursor_normal ) ;
@ -152,7 +152,7 @@ bool Frame_Resizer_Base::drawingarea_on_mouse_motion( GdkEventMotion *ev )
//here's where the real work is done ;-) //here's where the real work is done ;-)
if ( GRIP_LEFT || GRIP_RIGHT || GRIP_MOVE) if ( GRIP_LEFT || GRIP_RIGHT || GRIP_MOVE)
{ {
if ( GRIP_LEFT && ev ->x >= 10 && ev ->x <= X_END - USED - BORDER * 2 ) if ( GRIP_LEFT && ev ->x >= 10 && ev ->x <= X_END - USED - BORDER * 2 )
{ {
X_START =(int) ev -> x ; X_START =(int) ev -> x ;
signal_resize.emit( X_START -10, X_END -26, ARROW_LEFT) ; //-10/-26 to get the real value ( this way gripper calculations are invisible outside this class ) signal_resize.emit( X_START -10, X_END -26, ARROW_LEFT) ; //-10/-26 to get the real value ( this way gripper calculations are invisible outside this class )
@ -216,29 +216,29 @@ bool Frame_Resizer_Base::drawingarea_on_leave_notify( GdkEventCrossing *ev )
return true; return true;
} }
void Frame_Resizer_Base::Draw_Partition( ) void Frame_Resizer_Base::Draw_Partition( )
{ {
UNUSED = X_END - X_START - BORDER * 2 - USED ; UNUSED = X_END - X_START - BORDER * 2 - USED ;
if ( UNUSED < 0 ) if ( UNUSED < 0 )
UNUSED = 0 ; UNUSED = 0 ;
drawingarea .get_window() ->clear () ; drawingarea .get_window() ->clear() ;
//the two rectangles on each side of the partition //the two rectangles on each side of the partition
gc ->set_foreground( color_arrow_rectangle ); gc ->set_foreground( color_arrow_rectangle );
drawingarea .get_window() ->draw_rectangle( gc, true, 0,0,10,50 ); drawingarea .get_window() ->draw_rectangle( gc, true, 0,0,10,50 );
drawingarea .get_window() ->draw_rectangle( gc, true, 526,0,10,50 ); drawingarea .get_window() ->draw_rectangle( gc, true, 526,0,10,50 );
//partition //partition
gc ->set_foreground( color_partition ); gc ->set_foreground( color_partition );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START,0,X_END - X_START,50 ); drawingarea .get_window() ->draw_rectangle( gc, true, X_START,0,X_END - X_START,50 );
//used //used
gc ->set_foreground( color_used ); gc ->set_foreground( color_used );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER, BORDER, USED ,34 ); drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER, BORDER, USED ,34 );
//unused //unused
gc ->set_foreground( color_unused ); gc ->set_foreground( color_unused );
drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER +USED, BORDER, UNUSED,34 ); drawingarea .get_window() ->draw_rectangle( gc, true, X_START + BORDER +USED, BORDER, UNUSED,34 );
//resize grips //resize grips
@ -253,26 +253,26 @@ void Frame_Resizer_Base::Draw_Resize_Grip( ArrowType arrow_type )
{ {
if ( arrow_type == ARROW_LEFT ) if ( arrow_type == ARROW_LEFT )
{ {
arrow_points[0] .set_x( X_START) ; arrow_points[0] .set_x( X_START ) ;
arrow_points[1] .set_x( X_START -10) ; arrow_points[1] .set_x( X_START -10 ) ;
arrow_points[2] .set_x( X_START) ; arrow_points[2] .set_x( X_START ) ;
} }
else else
{ {
arrow_points[0] .set_x( X_END) ; arrow_points[0] .set_x( X_END ) ;
arrow_points[1] .set_x( X_END +10) ; arrow_points[1] .set_x( X_END +10 ) ;
arrow_points[2] .set_x( X_END) ; arrow_points[2] .set_x( X_END ) ;
} }
//attach resize arrows to the partition //attach resize arrows to the partition
gc ->set_foreground( color_arrow_rectangle ); gc ->set_foreground( color_arrow_rectangle );
if ( arrow_type == ARROW_LEFT ) if ( arrow_type == ARROW_LEFT )
drawingarea .get_window() ->draw_rectangle( gc, false, X_START -10 , 5, 9 , 40 ); drawingarea .get_window() ->draw_rectangle( gc, false, X_START -10 , 5, 9, 40 );
else else
drawingarea .get_window() ->draw_rectangle( gc, false, X_END +1, 5, 9 , 40 ); drawingarea .get_window() ->draw_rectangle( gc, false, X_END +1, 5, 9, 40 );
gc ->set_foreground( color_arrow ); gc ->set_foreground( color_arrow );
drawingarea .get_window() ->draw_polygon( gc , true, arrow_points ); drawingarea .get_window() ->draw_polygon( gc , true, arrow_points );
} }