cosmetics (mostly tabfixes)

* almost all files: cosmetics (mostly tabfixes)
This commit is contained in:
Bart Hakvoort 2004-10-01 21:09:19 +00:00
parent db243c870d
commit a1dfbee2b3
17 changed files with 221 additions and 231 deletions

View File

@ -1,3 +1,7 @@
2004-10-01 Bart Hakvoort <gparted@users.sf.net>
* almost all files: cosmetics (mostly tabfixes)
2004-10-01 Bart Hakvoort <gparted@users.sf.net> 2004-10-01 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_Partition_New.cc: marked 3 strings for translation. * src/Dialog_Partition_New.cc: marked 3 strings for translation.

View File

@ -85,14 +85,14 @@ private:
bool Resize_Extended( const Partition & partition, PedTimer *timer) ; bool Resize_Extended( const Partition & partition, PedTimer *timer) ;
std::vector<Partition> device_partitions; std::vector<Partition> device_partitions;
Sector length; Sector length;
long heads ; long heads ;
long sectors ; long sectors ;
long cylinders ; long cylinders ;
Glib::ustring model; Glib::ustring model;
Glib::ustring path; Glib::ustring path;
Glib::ustring realpath; Glib::ustring realpath;
Glib::ustring disktype; Glib::ustring disktype;
//private variables //private variables
PedDevice *device ; PedDevice *device ;

View File

@ -38,7 +38,7 @@ public:
private: private:
void Show_Credits() ; void Show_Credits() ;
Gtk::Label *label_temp ; Gtk::Label *label_temp ;
Gtk::Button button_credits; Gtk::Button button_credits;

View File

@ -44,15 +44,15 @@ public:
protected: protected:
enum SPINBUTTON { enum SPINBUTTON {
BEFORE = 0, BEFORE = 0,
SIZE = 1, SIZE = 1,
AFTER = 2 AFTER = 2
}; };
enum CONFIRMBUTTON { enum CONFIRMBUTTON {
RESIZE_MOVE = 0, RESIZE_MOVE = 0,
NEW = 1, NEW = 1,
PASTE = 2 PASTE = 2
}; };
void Set_Confirm_Button( CONFIRMBUTTON button_type ) ; void Set_Confirm_Button( CONFIRMBUTTON button_type ) ;

View File

@ -30,11 +30,11 @@ class Frame_Resizer_Base : public Gtk::Frame, virtual public sigc::trackable
public: public:
enum ArrowType { enum ArrowType {
ARROW_LEFT = 0, ARROW_LEFT = 0,
ARROW_RIGHT = 1 ARROW_RIGHT = 1
}; };
Frame_Resizer_Base( ) ; Frame_Resizer_Base( ) ;
~Frame_Resizer_Base() ; ~Frame_Resizer_Base() ;
void set_rgb_partition_color( const Gdk::Color & ) ; void set_rgb_partition_color( const Gdk::Color & ) ;
@ -46,8 +46,6 @@ public:
void set_fixed_start( bool ) ; void set_fixed_start( bool ) ;
void set_used_start( int used_start ) ; void set_used_start( int used_start ) ;
int get_used(); int get_used();
int get_x_start() ; int get_x_start() ;
int get_x_end() ; int get_x_end() ;
@ -64,8 +62,8 @@ protected:
bool GRIP_LEFT, GRIP_RIGHT, GRIP_MOVE ; bool GRIP_LEFT, GRIP_RIGHT, GRIP_MOVE ;
//signal handlers //signal handlers
void drawingarea_on_realize( ); void drawingarea_on_realize( );
bool drawingarea_on_expose( GdkEventExpose * ); bool drawingarea_on_expose( GdkEventExpose * );
virtual bool drawingarea_on_mouse_motion( GdkEventMotion* ) ; virtual bool drawingarea_on_mouse_motion( GdkEventMotion* ) ;
bool drawingarea_on_button_press_event( GdkEventButton* ) ; bool drawingarea_on_button_press_event( GdkEventButton* ) ;
bool drawingarea_on_button_release_event( GdkEventButton* ) ; bool drawingarea_on_button_release_event( GdkEventButton* ) ;

View File

@ -21,14 +21,10 @@
#include "../include/Frame_Resizer_Base.h" #include "../include/Frame_Resizer_Base.h"
class Frame_Resizer_Extended : public Frame_Resizer_Base class Frame_Resizer_Extended : public Frame_Resizer_Base
{ {
public: public:
Frame_Resizer_Extended( ) ; Frame_Resizer_Extended( ) ;
private: private:
@ -38,12 +34,6 @@ private:
virtual void Draw_Partition() ; virtual void Draw_Partition() ;
}; };
#endif // FRAME_RESIZER_EXTENDED #endif // FRAME_RESIZER_EXTENDED

View File

@ -29,11 +29,11 @@ namespace GParted
{ {
enum OperationType { enum OperationType {
DELETE = 0, DELETE = 0,
CREATE = 1, CREATE = 1,
RESIZE_MOVE = 2, RESIZE_MOVE = 2,
CONVERT = 3, CONVERT = 3,
COPY = 4 COPY = 4
}; };
class Operation class Operation
@ -46,7 +46,7 @@ public:
//this new list can be used to change the visual representation. For real writing to disk, see Apply_To_Disk() //this new list can be used to change the visual representation. For real writing to disk, see Apply_To_Disk()
std::vector<Partition> Apply_Operation_To_Visual( std::vector<Partition> & partitions ); std::vector<Partition> Apply_Operation_To_Visual( std::vector<Partition> & partitions );
void Apply_To_Disk( PedTimer * ); void Apply_To_Disk( PedTimer * timer );
//public variables //public variables
Device *device, *source_device; //source_device is only used in copy operations Device *device, *source_device; //source_device is only used in copy operations

View File

@ -75,10 +75,10 @@ inline Glib::ustring num_to_str( Sector number )
enum PartitionType { enum PartitionType {
PRIMARY = 0, PRIMARY = 0,
LOGICAL = 1, LOGICAL = 1,
EXTENDED = 2, EXTENDED = 2,
UNALLOCATED = 3 UNALLOCATED = 3
}; };
enum PartitionStatus { enum PartitionStatus {
@ -89,18 +89,18 @@ enum PartitionStatus {
/* /*
enum FileSystem { enum FileSystem {
ext2 = 0, ext2 = 0,
ext3 = 1, ext3 = 1,
linux_swap = 2, linux_swap = 2,
reiserfs = 3, reiserfs = 3,
hfs = 4, hfs = 4,
jfs = 5, jfs = 5,
hp_ufs = 6, hp_ufs = 6,
sun_ufs = 7, sun_ufs = 7,
xfs = 8, xfs = 8,
fat16 = 9, fat16 = 9,
fat32 = 10, fat32 = 10,
ntfs = 11 ntfs = 11
}; };
*/ */
class Partition class Partition
@ -110,15 +110,15 @@ public:
~Partition() ; ~Partition() ;
//simple Set-functions. only for convenience, since most members are public //simple Set-functions. only for convenience, since most members are public
void Set( const Glib::ustring & partition, void Set( const Glib::ustring & partition,
const int partition_number, const int partition_number,
const PartitionType type, const PartitionType type,
const Glib::ustring & filesystem, const Glib::ustring & filesystem,
const Sector & sector_start, const Sector & sector_start,
const Sector & sector_end, const Sector & sector_end,
const Sector & sectors_used, const Sector & sectors_used,
const bool inside_extended, const bool inside_extended,
const bool busy ) ; const bool busy ) ;
void Set_Unallocated( Sector sector_start, Sector sector_end, bool inside_extended ); void Set_Unallocated( Sector sector_start, Sector sector_end, bool inside_extended );

View File

@ -76,14 +76,14 @@ private:
//convenience functions //convenience functions
void allow_new( bool b ) { menu_popup.items()[0].set_sensitive( b ); toolbar_main.get_nth_item(0) ->set_sensitive( b ); } void allow_new( bool b ) { menu_popup.items()[0].set_sensitive( b ); toolbar_main.get_nth_item(0) ->set_sensitive( b ); }
void allow_delete( bool b ) { menu_popup.items()[1].set_sensitive( b ); toolbar_main.get_nth_item(1) ->set_sensitive( b ); } void allow_delete( bool b ) { menu_popup.items()[1].set_sensitive( b ); toolbar_main.get_nth_item(1) ->set_sensitive( b ); }
void allow_resize( bool b ) { menu_popup.items()[3].set_sensitive( b ); toolbar_main.get_nth_item(3) ->set_sensitive( b ); } void allow_resize( bool b ) { menu_popup.items()[3].set_sensitive( b ); toolbar_main.get_nth_item(3) ->set_sensitive( b ); }
void allow_copy( bool b ) { menu_popup.items()[5].set_sensitive( b ); toolbar_main.get_nth_item(5) ->set_sensitive( b ); } void allow_copy( bool b ) { menu_popup.items()[5].set_sensitive( b ); toolbar_main.get_nth_item(5) ->set_sensitive( b ); }
void allow_paste( bool b ) { menu_popup.items()[6].set_sensitive( b ); toolbar_main.get_nth_item(6) ->set_sensitive( b ); } void allow_paste( bool b ) { menu_popup.items()[6].set_sensitive( b ); toolbar_main.get_nth_item(6) ->set_sensitive( b ); }
void allow_convert( bool b ) { menu_popup.items()[8].set_sensitive( b ); } void allow_convert( bool b ) { menu_popup.items()[8].set_sensitive( b ); }
void allow_undo( bool b ) { toolbar_main.get_nth_item(8) ->set_sensitive( b ); } void allow_undo( bool b ) { toolbar_main.get_nth_item(8) ->set_sensitive( b ); }
void allow_apply( bool b ) { toolbar_main.get_nth_item(9) ->set_sensitive( b ); } void allow_apply( bool b ) { toolbar_main.get_nth_item(9) ->set_sensitive( b ); }
//signal handlers //signal handlers
void close_operationslist() ; void close_operationslist() ;
@ -96,7 +96,7 @@ private:
void menu_help_contents(); void menu_help_contents();
void menu_help_about(); void menu_help_about();
void mouse_click( GdkEventButton*, const Partition & ); void mouse_click( GdkEventButton*, const Partition & );
void activate_resize(); void activate_resize();
void activate_copy(); void activate_copy();

View File

@ -118,20 +118,20 @@ Device::Device( const Glib::ustring & device_path )
{ {
ped_exception_set_handler( PedException_Handler ) ; ped_exception_set_handler( PedException_Handler ) ;
this ->realpath = device_path ; //this one is used by open_device_and_disk this ->realpath = device_path ; //this one is used by open_device_and_disk
this ->length = 0;//lazy check.. if something goes wrong while reading the device, length will stay zero and i will know it ( see Win_GParted::Find_Devices ) this ->length = 0;//lazy check.. if something goes wrong while reading the device, length will stay zero and i will know it ( see Win_GParted::Find_Devices )
if ( ! open_device_and_disk() ) if ( ! open_device_and_disk() )
return ; return ;
this ->model = device ->model ; this ->model = device ->model ;
this ->path = get_sym_path( device ->path ) ; this ->path = get_sym_path( device ->path ) ;
this ->disktype = disk ->type ->name ; this ->disktype = disk ->type ->name ;
this ->heads = device ->bios_geom.heads ; this ->heads = device ->bios_geom.heads ;
this ->sectors = device ->bios_geom.sectors ; this ->sectors = device ->bios_geom.sectors ;
this ->cylinders = device ->bios_geom.cylinders ; this ->cylinders= device ->bios_geom.cylinders ;
this ->length = heads * sectors * cylinders ; this ->length = heads * sectors * cylinders ;
//get valid flags for this device //get valid flags for this device
for ( PedPartitionFlag flag = ped_partition_flag_next ( (PedPartitionFlag) 0 ) ; flag ; flag = ped_partition_flag_next ( flag ) ) for ( PedPartitionFlag flag = ped_partition_flag_next ( (PedPartitionFlag) 0 ) ; flag ; flag = ped_partition_flag_next ( flag ) )
@ -154,55 +154,54 @@ void Device::Read_Disk_Layout()
switch( c_partition ->type ) switch( c_partition ->type )
{ {
//NORMAL (PRIMARY) //NORMAL (PRIMARY)
case 0 : if ( c_partition ->fs_type ) case 0 : if ( c_partition ->fs_type )
temp = c_partition ->fs_type ->name ; temp = c_partition ->fs_type ->name ;
else else
{temp = "unknown" ; this ->error = (Glib::ustring) _( "Unable to detect filesystem! Possible reasons are:" ) + "\n-" + (Glib::ustring) _( "The filesystem is damaged" ) + "\n-" + (Glib::ustring) _( "The filesystem is unknown to libparted" ) + "\n-" + (Glib::ustring) _( "There is no filesystem available (unformatted)" ) ; } {temp = "unknown" ; this ->error = (Glib::ustring) _( "Unable to detect filesystem! Possible reasons are:" ) + "\n-" + (Glib::ustring) _( "The filesystem is damaged" ) + "\n-" + (Glib::ustring) _( "The filesystem is unknown to libparted" ) + "\n-" + (Glib::ustring) _( "There is no filesystem available (unformatted)" ) ; }
partition_temp.Set( os.str(),c_partition ->num , GParted::PRIMARY, temp, c_partition ->geom .start, c_partition ->geom .end, Get_Used_Sectors( c_partition , os.str() ) , false, ped_partition_is_busy( c_partition ) ); partition_temp.Set( os.str(),c_partition ->num , GParted::PRIMARY, temp, c_partition ->geom .start, c_partition ->geom .end, Get_Used_Sectors( c_partition , os.str() ) , false, ped_partition_is_busy( c_partition ) );
partition_temp .flags = Get_Flags( c_partition ) ; partition_temp .flags = Get_Flags( c_partition ) ;
partition_temp .error = this ->error ; partition_temp .error = this ->error ;
device_partitions.push_back( partition_temp ); device_partitions.push_back( partition_temp );
break; break;
//LOGICAL //LOGICAL
case 1: if ( c_partition ->fs_type ) case 1: if ( c_partition ->fs_type )
temp = c_partition ->fs_type ->name ; temp = c_partition ->fs_type ->name ;
else else
{temp = "unknown" ; this ->error = (Glib::ustring) _( "Unable to detect filesystem! Possible reasons are:" ) + "\n-" + (Glib::ustring) _( "The filesystem is damaged" ) + "\n-" + (Glib::ustring) _( "The filesystem is unknown to libparted" ) + "\n-" + (Glib::ustring) _( "There is no filesystem available (unformatted)" ) ; } {temp = "unknown" ; this ->error = (Glib::ustring) _( "Unable to detect filesystem! Possible reasons are:" ) + "\n-" + (Glib::ustring) _( "The filesystem is damaged" ) + "\n-" + (Glib::ustring) _( "The filesystem is unknown to libparted" ) + "\n-" + (Glib::ustring) _( "There is no filesystem available (unformatted)" ) ; }
partition_temp.Set( os.str(), c_partition ->num, GParted::LOGICAL, temp, c_partition ->geom .start, c_partition ->geom .end, Get_Used_Sectors( c_partition , os.str() ) , true, ped_partition_is_busy( c_partition ) ); partition_temp.Set( os.str(), c_partition ->num, GParted::LOGICAL, temp, c_partition ->geom .start, c_partition ->geom .end, Get_Used_Sectors( c_partition , os.str() ) , true, ped_partition_is_busy( c_partition ) );
partition_temp .flags = Get_Flags( c_partition ) ; partition_temp .flags = Get_Flags( c_partition ) ;
partition_temp .error = this ->error ; partition_temp .error = this ->error ;
device_partitions.push_back( partition_temp ); device_partitions.push_back( partition_temp );
break; break;
//EXTENDED //EXTENDED
case 2: partition_temp.Set( os.str(), c_partition ->num, GParted::EXTENDED, "extended", c_partition ->geom .start, c_partition ->geom .end , -1, false, ped_partition_is_busy( c_partition ) ); case 2: partition_temp.Set( os.str(), c_partition ->num, GParted::EXTENDED, "extended", c_partition ->geom .start, c_partition ->geom .end , -1, false, ped_partition_is_busy( c_partition ) );
partition_temp .flags = Get_Flags( c_partition ) ; partition_temp .flags = Get_Flags( c_partition ) ;
partition_temp .error = this ->error ; partition_temp .error = this ->error ;
device_partitions.push_back( partition_temp ); device_partitions.push_back( partition_temp );
break;
break;
//FREESPACE OUTSIDE EXTENDED //FREESPACE OUTSIDE EXTENDED
case 4: if ( (c_partition ->geom .end - c_partition ->geom .start) > MEGABYTE ) case 4: if ( (c_partition ->geom .end - c_partition ->geom .start) > MEGABYTE )
{ {
partition_temp.Set_Unallocated( c_partition ->geom .start , c_partition ->geom .end, false ); partition_temp.Set_Unallocated( c_partition ->geom .start , c_partition ->geom .end, false );
device_partitions.push_back( partition_temp ); device_partitions.push_back( partition_temp );
} }
break ; break ;
//FREESPACE INSIDE EXTENDED //FREESPACE INSIDE EXTENDED
case 5: if ( (c_partition ->geom .end - c_partition ->geom .start) > MEGABYTE ) case 5: if ( (c_partition ->geom .end - c_partition ->geom .start) > MEGABYTE )
{ {
partition_temp.Set_Unallocated( c_partition ->geom .start , c_partition ->geom .end, true ); partition_temp.Set_Unallocated( c_partition ->geom .start , c_partition ->geom .end, true );
device_partitions.push_back( partition_temp ); device_partitions.push_back( partition_temp );
} }
break ; break ;
//METADATA (do nothing) //METADATA (do nothing)
default: break; default: break;
} }
@ -211,7 +210,7 @@ void Device::Read_Disk_Layout()
this ->error = ""; error_message = ""; os.str(""); this ->error = ""; error_message = ""; os.str("");
//next partition (if any) //next partition (if any)
c_partition = ped_disk_next_partition ( disk, c_partition ) ; c_partition = ped_disk_next_partition ( disk, c_partition ) ;
} }
} }
@ -237,8 +236,8 @@ int Device::Create_Empty_Partition( const Partition & new_partition, PedConstrai
//create new partition //create new partition
switch ( new_partition .type ) switch ( new_partition .type )
{ {
case 0 : type = PED_PARTITION_NORMAL; break; case 0 : type = PED_PARTITION_NORMAL; break;
case 1 : type = PED_PARTITION_LOGICAL; break; case 1 : type = PED_PARTITION_LOGICAL; break;
case 2 : type = PED_PARTITION_EXTENDED; break; case 2 : type = PED_PARTITION_EXTENDED; break;
default : type = PED_PARTITION_FREESPACE; break ; //will never happen ;) default : type = PED_PARTITION_FREESPACE; break ; //will never happen ;)
} }
@ -346,11 +345,11 @@ bool Device::Set_Partition_Filesystem( const Partition & new_partition, PedTimer
bool Device::Copy_Partition( Device *source_device, const Partition & source_partition, PedTimer * timer) bool Device::Copy_Partition( Device *source_device, const Partition & source_partition, PedTimer * timer)
{ {
PedPartition *c_part_src = NULL; PedPartition *c_part_src = NULL;
PedFileSystem *src_fs = NULL; PedFileSystem *src_fs = NULL;
PedPartition *c_part = NULL; PedPartition *c_part = NULL;
PedFileSystem *dst_fs = NULL; PedFileSystem *dst_fs = NULL;
PedFileSystemType* dst_fs_type = NULL; PedFileSystemType *dst_fs_type = NULL;
//prepare source for reading //prepare source for reading
if ( source_device ->Get_Path() == this ->path ) if ( source_device ->Get_Path() == this ->path )
@ -496,7 +495,7 @@ Sector Device::Get_Used_Sectors( PedPartition *c_partition, const Glib::ustring
/* This is quite an unreliable process, atm i try two different methods, but since both are far from perfect the results are /* This is quite an unreliable process, atm i try two different methods, but since both are far from perfect the results are
* questionable. * questionable.
* - first i try geometry.get_used() in libpartedpp, i implemented this function to check the minimal size when resizing a partition. Disadvantage * - first i try geometry.get_used() in libpartedpp, i implemented this function to check the minimal size when resizing a partition. Disadvantage
* of this method is the fact it won't work on mounted filesystems. Besides that, its SLOW * of this method is the fact it won't work on mounted filesystems. Besides that, its SLOW
* - if the former method fails ( result is -1 ) i'll try to read the output from the df command ( df -k --sync <partition path> ) * - if the former method fails ( result is -1 ) i'll try to read the output from the df command ( df -k --sync <partition path> )
* - if this fails the filesystem on the partition is ( more or less ) unknown to the operating system and therefore the unused sectors cannot be calcualted * - if this fails the filesystem on the partition is ( more or less ) unknown to the operating system and therefore the unused sectors cannot be calcualted
* - as soon as i have my internetconnection back i should ask people with more experience on this stuff for advice ! * - as soon as i have my internetconnection back i should ask people with more experience on this stuff for advice !

View File

@ -153,25 +153,24 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
{ {
switch( button_type ) switch( button_type )
{ {
case NEW : this->add_button( Gtk::Stock::ADD,Gtk::RESPONSE_OK ); case NEW : this->add_button( Gtk::Stock::ADD,Gtk::RESPONSE_OK );
break ; 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" )
label_temp = manage( new Gtk::Label( _("Resize") ) ) ; label_temp = manage( new Gtk::Label( _("Resize") ) ) ;
else else
label_temp = manage( new Gtk::Label( _("Resize/Move") ) ) ; label_temp = manage( new Gtk::Label( _("Resize/Move") ) ) ;
image_temp = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) ); image_temp = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) );
hbox_resize_move .pack_start( *image_temp, Gtk::PACK_EXPAND_PADDING ) ; hbox_resize_move .pack_start( *image_temp, Gtk::PACK_EXPAND_PADDING ) ;
hbox_resize_move .pack_start( *label_temp, Gtk::PACK_EXPAND_PADDING ) ; hbox_resize_move .pack_start( *label_temp, Gtk::PACK_EXPAND_PADDING ) ;
button_resize_move .add( hbox_resize_move ) ; button_resize_move .add( hbox_resize_move ) ;
this ->add_action_widget ( button_resize_move,Gtk::RESPONSE_OK ) ; this ->add_action_widget ( button_resize_move,Gtk::RESPONSE_OK ) ;
button_resize_move .set_sensitive( false ) ; button_resize_move .set_sensitive( false ) ;
break ; break ;
case PASTE : this->add_button( Gtk::Stock::PASTE,Gtk::RESPONSE_OK ); case PASTE : this->add_button( Gtk::Stock::PASTE,Gtk::RESPONSE_OK );
break ; break ;
} }
} }
@ -273,20 +272,20 @@ void Dialog_Base_Partition::on_spinbutton_value_changed( SPINBUTTON spinbutton
switch ( spinbutton ) switch ( spinbutton )
{ {
case BEFORE : spinbutton_after.set_value( TOTAL_MB - spinbutton_size.get_value() - before_value) ; case BEFORE : spinbutton_after.set_value( TOTAL_MB - spinbutton_size.get_value() - before_value) ;
spinbutton_size.set_value( TOTAL_MB - before_value - spinbutton_after.get_value( ) ) ; spinbutton_size.set_value( TOTAL_MB - before_value - spinbutton_after.get_value( ) ) ;
break; break;
case SIZE : spinbutton_after.set_value( TOTAL_MB - before_value - spinbutton_size.get_value() ); case SIZE : spinbutton_after.set_value( TOTAL_MB - before_value - spinbutton_size.get_value() );
if ( ! fixed_start ) if ( ! fixed_start )
spinbutton_before .set_value( TOTAL_MB - spinbutton_size.get_value() - spinbutton_after.get_value() ); spinbutton_before .set_value( TOTAL_MB - spinbutton_size.get_value() - spinbutton_after.get_value() );
break; break;
case AFTER : if ( ! fixed_start ) case AFTER : if ( ! fixed_start )
spinbutton_before .set_value( TOTAL_MB - spinbutton_size.get_value() - spinbutton_after.get_value() ); spinbutton_before .set_value( TOTAL_MB - spinbutton_size.get_value() - spinbutton_after.get_value() );
spinbutton_size.set_value( TOTAL_MB - before_value - spinbutton_after.get_value( ) ) ; spinbutton_size.set_value( TOTAL_MB - before_value - spinbutton_after.get_value( ) ) ;
break; break;
} }
@ -307,10 +306,10 @@ void Dialog_Base_Partition::on_spinbutton_value_changed( SPINBUTTON spinbutton
void Dialog_Base_Partition::Check_Change() void Dialog_Base_Partition::Check_Change()
{ {
if ( ORIG_BEFORE == spinbutton_before .get_value_as_int() && if ( ORIG_BEFORE == spinbutton_before .get_value_as_int() &&
ORIG_SIZE == spinbutton_size .get_value_as_int() && ORIG_SIZE == spinbutton_size .get_value_as_int() &&
ORIG_AFTER == spinbutton_after .get_value_as_int() ORIG_AFTER== spinbutton_after .get_value_as_int()
) )
button_resize_move .set_sensitive( false ) ; button_resize_move .set_sensitive( false ) ;
else else
button_resize_move .set_sensitive( true ) ; button_resize_move .set_sensitive( true ) ;

View File

@ -114,13 +114,13 @@ void Dialog_Partition_Info::init_drawingarea()
unused = 375 - used - (BORDER *2) ; unused = 375 - used - (BORDER *2) ;
//allocate some colors //allocate some colors
color_used.set( "#F8F8BA" ); this ->get_colormap() ->alloc_color( color_used ) ; color_used.set( "#F8F8BA" ); this ->get_colormap() ->alloc_color( color_used ) ;
partition .type == GParted::EXTENDED ? color_unused.set( "darkgrey" ) : color_unused.set( "white" ) ; partition .type == GParted::EXTENDED ? color_unused.set( "darkgrey" ) : color_unused.set( "white" ) ;
this ->get_colormap() ->alloc_color( color_unused ) ; this ->get_colormap() ->alloc_color( color_unused ) ;
color_text.set( "black" ); this ->get_colormap() ->alloc_color( color_text ) ; color_text.set( "black" ); this ->get_colormap() ->alloc_color( color_text ) ;
color_partition = partition.color ; this ->get_colormap() ->alloc_color( color_partition ) ; color_partition = partition.color ; this ->get_colormap() ->alloc_color( color_partition ) ;
//set text of pangolayout //set text of pangolayout
os << partition .partition <<"\n" << String::ucompose( _("%1 MB"), partition .Get_Length_MB() ) ; os << partition .partition <<"\n" << String::ucompose( _("%1 MB"), partition .Get_Length_MB() ) ;

View File

@ -82,7 +82,7 @@ void Dialog_Progress::Set_Progress_Current_Operation( )
progressbar_current.set_fraction( fraction_current ); progressbar_current.set_fraction( fraction_current );
if ( time_left > 59 && time_left < 120 ) if ( time_left > 59 && time_left < 120 )
progressbar_current.set_text( String::ucompose( _("about %1 minute and %2 seconds left"), time_left/60, time_left % 60 ) ) ; progressbar_current.set_text( String::ucompose( _("about %1 minute and %2 seconds left"), time_left/60, time_left % 60 ) ) ;
else else
progressbar_current.set_text( String::ucompose( _("about %1 minutes and %2 seconds left"), time_left/60, time_left % 60 ) ) ; progressbar_current.set_text( String::ucompose( _("about %1 minutes and %2 seconds left"), time_left/60, time_left % 60 ) ) ;
} }

View File

@ -36,18 +36,18 @@ void Frame_Resizer_Base::init()
this ->add( drawingarea ) ; this ->add( drawingarea ) ;
color_used.set( "#F8F8BA" ); this ->get_colormap() ->alloc_color( color_used ) ; color_used.set( "#F8F8BA" ); this ->get_colormap() ->alloc_color( color_used ) ;
color_unused.set( "white" ); this ->get_colormap() ->alloc_color( color_unused ) ; color_unused.set( "white" ); this ->get_colormap() ->alloc_color( color_unused ) ;
color_arrow.set( "black" ); this ->get_colormap() ->alloc_color( color_arrow ) ; color_arrow.set( "black" ); this ->get_colormap() ->alloc_color( color_arrow ) ;
color_background.set( "darkgrey" ); this ->get_colormap() ->alloc_color( color_background ) ; color_background.set( "darkgrey" ); this ->get_colormap() ->alloc_color( color_background ) ;
color_arrow_rectangle.set( "lightgrey" ); this ->get_colormap() ->alloc_color( color_arrow_rectangle ) ; color_arrow_rectangle.set( "lightgrey" ); this ->get_colormap() ->alloc_color( color_arrow_rectangle ) ;
cursor_resize = new Gdk::Cursor( Gdk::SB_H_DOUBLE_ARROW ) ; cursor_resize = new Gdk::Cursor( Gdk::SB_H_DOUBLE_ARROW ) ;
cursor_normal = new Gdk::Cursor( Gdk::LEFT_PTR ) ; cursor_normal = new Gdk::Cursor( Gdk::LEFT_PTR ) ;
cursor_move = new Gdk::Cursor( Gdk::FLEUR ) ; cursor_move = new Gdk::Cursor( Gdk::FLEUR ) ;
GRIP_MOVE = GRIP_LEFT = GRIP_RIGHT = false; GRIP_MOVE = GRIP_LEFT = GRIP_RIGHT = false;
X_END = 0; X_END = 0;
Gdk::Point p; Gdk::Point p;
p.set_y( 15); arrow_points.push_back( p ) ; p.set_y( 15); arrow_points.push_back( p ) ;
@ -138,9 +138,9 @@ bool Frame_Resizer_Base::drawingarea_on_mouse_motion( GdkEventMotion *ev )
if ( ! GRIP_LEFT && ! GRIP_RIGHT && ! GRIP_MOVE ) //no need to check this while resizing or moving if ( ! GRIP_LEFT && ! GRIP_RIGHT && ! GRIP_MOVE ) //no need to check this while resizing or moving
{ {
//check if pointer is over a gripper //check if pointer is over a gripper
if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip
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 ) ;
@ -155,7 +155,7 @@ bool Frame_Resizer_Base::drawingarea_on_mouse_motion( GdkEventMotion *ev )
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 )
} }
else if ( GRIP_RIGHT && ev ->x >= X_START + USED + BORDER *2 && ev ->x <= 526 ) else if ( GRIP_RIGHT && ev ->x >= X_START + USED + BORDER *2 && ev ->x <= 526 )
@ -191,9 +191,9 @@ bool Frame_Resizer_Base::drawingarea_on_button_press_event( GdkEventButton *ev )
{ {
GRIP_MOVE = false; GRIP_RIGHT = false; GRIP_LEFT = false ; GRIP_MOVE = false; GRIP_RIGHT = false; GRIP_LEFT = false ;
if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip
GRIP_LEFT = true ; GRIP_LEFT = true ;
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
GRIP_RIGHT = true ; GRIP_RIGHT = true ;
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
{ GRIP_MOVE = true ; X_START_MOVE = (int)ev ->x; } { GRIP_MOVE = true ; X_START_MOVE = (int)ev ->x; }

View File

@ -27,9 +27,9 @@ bool Frame_Resizer_Extended::drawingarea_on_mouse_motion( GdkEventMotion *ev )
if ( ! GRIP_LEFT && ! GRIP_RIGHT ) //no need to check this while resizing if ( ! GRIP_LEFT && ! GRIP_RIGHT ) //no need to check this while resizing
{ {
//check if pointer is over a gripper //check if pointer is over a gripper
if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip if ( ! fixed_start && ev ->x >= X_START -10 && ev ->x <= X_START && ev ->y >= 5 && ev ->y <= 45 ) //left grip
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 //normal pointer else //normal pointer
drawingarea .get_parent_window() ->set_cursor( *cursor_normal ) ; drawingarea .get_parent_window() ->set_cursor( *cursor_normal ) ;
@ -40,13 +40,13 @@ bool Frame_Resizer_Extended::drawingarea_on_mouse_motion( GdkEventMotion *ev )
if ( GRIP_LEFT && ev ->x >= 10 && ev ->x <= 510 && ev->x <= X_END - BORDER *2 && ( ev ->x <= USED_START || USED == 0 ) ) if ( GRIP_LEFT && ev ->x >= 10 && ev ->x <= 510 && ev->x <= X_END - BORDER *2 && ( ev ->x <= USED_START || USED == 0 ) )
{ {
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 )
} }
else if ( GRIP_RIGHT && ev ->x <= 526 && ev->x >= X_START + BORDER *2 && ev ->x >= USED_START + USED + BORDER *2 ) else if ( GRIP_RIGHT && ev ->x <= 526 && ev->x >= X_START + BORDER *2 && ev ->x >= USED_START + USED + BORDER *2 )
{ {
X_END = (int) ev ->x ; X_END = (int) ev ->x ;
signal_resize.emit( X_START -10, X_END -26, ARROW_RIGHT) ; //-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_RIGHT) ;//-10/-26 to get the real value ( this way gripper calculations are invisible outside this class )
} }
Draw_Partition() ; Draw_Partition() ;

View File

@ -27,14 +27,14 @@ Partition::Partition( )
} }
void Partition::Set( const Glib::ustring & partition, void Partition::Set( const Glib::ustring & partition,
const int partition_number, const int partition_number,
const PartitionType type, const PartitionType type,
const Glib::ustring & filesystem, const Glib::ustring & filesystem,
const Sector & sector_start, const Sector & sector_start,
const Sector & sector_end, const Sector & sector_end,
const Sector & sectors_used, const Sector & sectors_used,
const bool inside_extended, const bool inside_extended,
const bool busy ) const bool busy )
{ {
this->partition = partition; this->partition = partition;
this->partition_number = partition_number; this->partition_number = partition_number;
@ -61,29 +61,29 @@ void Partition::Set_Unallocated( Sector sector_start, Sector sector_end, bool in
Glib::ustring Partition::Get_Color( const Glib::ustring & filesystem ) Glib::ustring Partition::Get_Color( const Glib::ustring & filesystem )
{ // very ugly, but somehow i can't figure out a more efficient way. must be lack of sleep or so... :-) { // very ugly, but somehow i can't figure out a more efficient way. must be lack of sleep or so... :-)
//purple teints //purple teints
if ( filesystem == "ext2" ) return "#9DB8D2" ; if ( filesystem == "ext2" ) return "#9DB8D2" ;
else if ( filesystem == "ext3" ) return "#7590AE"; else if ( filesystem == "ext3" ) return "#7590AE";
//brown //brown
else if ( filesystem == "linux-swap" ) return "#C1665A" ; else if ( filesystem == "linux-swap" ) return "#C1665A" ;
//greenisch stuff.. //greenisch stuff..
else if ( filesystem == "fat16" ) return "green" ; else if ( filesystem == "fat16" ) return "green" ;
else if ( filesystem == "fat32" ) return "#18D918"; else if ( filesystem == "fat32" ) return "#18D918";
else if ( filesystem == "ntfs" ) return "#42E5AC"; else if ( filesystem == "ntfs" ) return "#42E5AC";
//blue //blue
else if ( filesystem == "reiserfs" ) return "blue" ; else if ( filesystem == "reiserfs" ) return "blue" ;
//libparted can only detect these, i decided to "yellow them" :^) //libparted can only detect these, i decided to "yellow them" :^)
else if ( filesystem == "HFS" ) return "yellow" ; else if ( filesystem == "HFS" ) return "yellow" ;
else if ( filesystem == "JFS" ) return "yellow" ; else if ( filesystem == "JFS" ) return "yellow" ;
else if ( filesystem == "UFS" ) return "yellow" ; else if ( filesystem == "UFS" ) return "yellow" ;
else if ( filesystem == "XFS" ) return "yellow" ; else if ( filesystem == "XFS" ) return "yellow" ;
//darkgrey and ligthblue //darkgrey and ligthblue
else if ( filesystem == "unallocated" ) return "darkgrey" ; else if ( filesystem == "unallocated" ) return "darkgrey" ;
else if ( filesystem == "extended" ) return "#7DFCFE" ; else if ( filesystem == "extended" ) return "#7DFCFE" ;
//unknown filesystem ( damaged, or simply unknown ) //unknown filesystem ( damaged, or simply unknown )
else return "black"; else return "black";
@ -91,7 +91,7 @@ Glib::ustring Partition::Get_Color( const Glib::ustring & filesystem )
void Partition::Update_Number( int new_number ) void Partition::Update_Number( int new_number )
{ //of course this fails when we have devicenames with numbers over 99 { //of course this fails when we have devicenames with numbers over 99
partition_number >= 10 ? partition = partition.substr( 0, partition.length() - 2 ) : partition = partition.substr( 0, partition.length() - 1 ) ; partition_number >= 10 ? partition = partition.substr( 0, partition.length() -2 ) : partition = partition.substr( 0, partition.length() -1 ) ;
partition_number = new_number; partition_number = new_number;
std::ostringstream os; std::ostringstream os;

View File

@ -110,7 +110,7 @@ void Win_GParted::init_toolbar()
//NEW and DELETE //NEW and DELETE
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::NEW)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::NEW));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_new) ); toolbar_main.append(*toolbutton); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_new) ); toolbar_main.append(*toolbutton);
toolbutton ->set_tooltip(tooltips, _("Create a new partition in the selected unallocated space") ); toolbutton ->set_tooltip(tooltips, _("Create a new partition in the selected unallocated space") );
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::DELETE)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::DELETE));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_delete) ); toolbar_main.append(*toolbutton); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_delete) ); toolbar_main.append(*toolbutton);
@ -126,19 +126,19 @@ void Win_GParted::init_toolbar()
//COPY and PASTE //COPY and PASTE
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::COPY)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::COPY));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_copy) ); toolbar_main.append(*toolbutton); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_copy) ); toolbar_main.append(*toolbutton);
toolbutton ->set_tooltip(tooltips, _("Copy the selected partition to the clipboard") ); toolbutton ->set_tooltip(tooltips, _("Copy the selected partition to the clipboard") );
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::PASTE)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::PASTE));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_paste) ); toolbar_main.append(*toolbutton); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_paste) ); toolbar_main.append(*toolbutton);
toolbutton ->set_tooltip(tooltips, _("Paste the partition from the clipboard") ); toolbutton ->set_tooltip(tooltips, _("Paste the partition from the clipboard") );
toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) ); toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) );
//UNDO and APPLY //UNDO and APPLY
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::UNDO)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::UNDO));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_undo) ); toolbar_main.append(*toolbutton); toolbutton ->set_sensitive( false ); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_undo) ); toolbar_main.append(*toolbutton); toolbutton ->set_sensitive( false );
toolbutton ->set_tooltip(tooltips, _("Undo last operation") ); toolbutton ->set_tooltip(tooltips, _("Undo last operation") );
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY)); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_apply) ); toolbar_main.append(*toolbutton); toolbutton ->set_sensitive( false ); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_apply) ); toolbar_main.append(*toolbutton); toolbutton ->set_sensitive( false );
toolbutton ->set_tooltip(tooltips, _("Apply all operations") ); toolbutton ->set_tooltip(tooltips, _("Apply all operations") );
//initizialize and pack optionmenu_devices //initizialize and pack optionmenu_devices
@ -425,7 +425,7 @@ bool Win_GParted::on_delete_event(GdkEventAny *event)
void Win_GParted::Add_Operation( OperationType operationtype, const Partition & new_partition) void Win_GParted::Add_Operation( OperationType operationtype, const Partition & new_partition)
{ {
Operation operation( devices[ current_device ] , devices[ source_device ] , selected_partition, new_partition, operationtype ); Operation operation( devices[ current_device ], devices[ source_device ], selected_partition, new_partition, operationtype );
operations.push_back( operation ); operations.push_back( operation );
@ -436,7 +436,7 @@ void Win_GParted::Add_Operation( OperationType operationtype, const Partition &
if ( operations.size() == 1 ) //first operation, open operationslist if ( operations.size() == 1 ) //first operation, open operationslist
{ {
int x,y; this ->get_size( x, y ); int x,y; this ->get_size( x, y );
y -= 300; y -= 300;
for ( int t=vpaned_main.get_position() ; t > y ; t-=3 ) for ( int t=vpaned_main.get_position() ; t > y ; t-=3 )
@ -469,16 +469,16 @@ void Win_GParted::Refresh_Visual( )
treerow[ treeview_operations_columns.operation_description ] = operations[t] .str_operation ; treerow[ treeview_operations_columns.operation_description ] = operations[t] .str_operation ;
switch ( operations[t].operationtype ) switch ( operations[t].operationtype )
{ {
case GParted::DELETE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::DELETE, Gtk::ICON_SIZE_MENU); case GParted::DELETE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::DELETE, Gtk::ICON_SIZE_MENU);
break; break;
case GParted::CREATE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::NEW, Gtk::ICON_SIZE_MENU); case GParted::CREATE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::NEW, Gtk::ICON_SIZE_MENU);
break; break;
case GParted::RESIZE_MOVE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_MENU); case GParted::RESIZE_MOVE : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_MENU);
break; break;
case GParted::CONVERT : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::CONVERT, Gtk::ICON_SIZE_MENU); case GParted::CONVERT : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::CONVERT, Gtk::ICON_SIZE_MENU);
break; break;
case GParted::COPY : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::COPY, Gtk::ICON_SIZE_MENU); case GParted::COPY : treerow[ treeview_operations_columns.operation_icon ] =render_icon(Gtk::Stock::COPY, Gtk::ICON_SIZE_MENU);
break; break;
} }
} }
@ -507,15 +507,15 @@ void Win_GParted::Refresh_Visual( )
switch ( partitions[t].type ) switch ( partitions[t].type )
{ {
case GParted::PRIMARY : primary_count++; case GParted::PRIMARY : primary_count++;
break; break;
case GParted::EXTENDED : any_extended = true; case GParted::EXTENDED : any_extended = true;
primary_count++; primary_count++;
break; break;
case GParted::LOGICAL : any_logic = true; case GParted::LOGICAL : any_logic = true;
if ( partitions[t].busy && partitions[t].partition_number > highest_logic_busy ) if ( partitions[t].busy && partitions[t].partition_number > highest_logic_busy )
highest_logic_busy = partitions[t].partition_number ; highest_logic_busy = partitions[t].partition_number ;
break; break;
default : break; default : break;
} }
} }
@ -535,7 +535,7 @@ void Win_GParted::Refresh_Visual( )
//treeview details //treeview details
treeview_detail .Load_Partitions( partitions ) ; treeview_detail .Load_Partitions( partitions ) ;
allow_new( false ); allow_delete( false );allow_resize( false );allow_copy( false );allow_paste( false ); allow_new( false ); allow_delete( false ); allow_resize( false ); allow_copy( false ); allow_paste( false );
} }
bool Win_GParted::Quit_Check_Operations() bool Win_GParted::Quit_Check_Operations()
@ -594,12 +594,12 @@ void Win_GParted::Set_Valid_Operations()
allow_convert( true ) ; allow_convert( true ) ;
//find out if resizing/moving and copying is possible //find out if resizing/moving and copying is possible
if ( selected_partition.filesystem == "ext2" || if ( selected_partition.filesystem == "ext2" ||
selected_partition.filesystem == "ext3" || selected_partition.filesystem == "ext3" ||
selected_partition.filesystem == "fat16" || selected_partition.filesystem == "fat16" ||
selected_partition.filesystem == "fat32" || selected_partition.filesystem == "fat32" ||
selected_partition.filesystem == "linux-swap" selected_partition.filesystem == "linux-swap"
) )
{ {
allow_resize( true ) ; allow_resize( true ) ;
@ -618,7 +618,7 @@ void Win_GParted::Set_Valid_Operations()
if ( ! any_logic ) //deletion is only allowed when there are nog logical partitions inside. if ( ! any_logic ) //deletion is only allowed when there are nog logical partitions inside.
allow_delete( true ) ; allow_delete( true ) ;
allow_resize( true ); allow_resize( true );
} }
} }
@ -636,7 +636,7 @@ void Win_GParted::close_operationslist()
{ {
treeview_detail .columns_autosize() ; //seemed a nice place for it.. treeview_detail .columns_autosize() ; //seemed a nice place for it..
int x,y; this ->get_size( x, y ); int x,y; this ->get_size( x, y );
y -= 210 ; //height of whole app - menubar - visualdisk - statusbar .... y -= 210 ; //height of whole app - menubar - visualdisk - statusbar ....
for ( int t=vpaned_main.get_position() ; t < y ; t+=3 ) for ( int t=vpaned_main.get_position() ; t < y ; t+=3 )
{ {
@ -685,7 +685,7 @@ void Win_GParted::menu_gparted_refresh_devices()
//check if current_device is still available (think about hotpluggable shit like usbdevices) //check if current_device is still available (think about hotpluggable shit like usbdevices)
if ( current_device >= devices .size() ) if ( current_device >= devices .size() )
current_device = 0 ; current_device = 0 ;
//rebuild visualdisk and treeview //rebuild visualdisk and treeview
Refresh_Visual( ); Refresh_Visual( );