Use ext2 as default when creating new filesystems

Default to ext2 for filesystem creation, instead of the
alphabetically preceding btrfs. Do not use get_label(),
as it is not available in older gtkmm.
This commit is contained in:
Luca Bruno 2010-10-05 10:30:55 +02:00 committed by Curtis Gedak
parent 5c05233072
commit 9c41afae91
1 changed files with 18 additions and 7 deletions

View File

@ -320,6 +320,7 @@ void Dialog_Partition_New::optionmenu_changed( bool type )
void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted ) void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted )
{ {
bool set_first=false;
//fill the file system menu with the file systems (except for extended) //fill the file system menu with the file systems (except for extended)
for ( unsigned int t = 0 ; t < FILESYSTEMS .size( ) ; t++ ) for ( unsigned int t = 0 ; t < FILESYSTEMS .size( ) ; t++ )
{ {
@ -331,18 +332,28 @@ void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted )
menu_filesystem .items() .back() .set_sensitive( menu_filesystem .items() .back() .set_sensitive(
! only_unformatted && FILESYSTEMS[ t ] .create && ! only_unformatted && FILESYSTEMS[ t ] .create &&
this ->selected_partition .get_byte_length() >= FILESYSTEMS[ t ] .MIN ) ; this ->selected_partition .get_byte_length() >= FILESYSTEMS[ t ] .MIN ) ;
//use ext2 as default filesystem
if ( Utils::get_filesystem_string( FILESYSTEMS[ t ] .filesystem ) == "ext2" &&
menu_filesystem .items() .back() .sensitive() )
{
first_creatable_fs=menu_filesystem .items() .size() - 1;
set_first=true;
}
} }
//unformatted is always available //unformatted is always available
menu_filesystem .items() .back() .set_sensitive( true ) ; menu_filesystem .items() .back() .set_sensitive( true ) ;
//find and set first enabled file system if(!set_first)
for ( unsigned int t = 0 ; t < menu_filesystem .items() .size() ; t++ ) {
if ( menu_filesystem .items()[ t ] .sensitive() ) //find and set first enabled file system
{ for ( unsigned int t = 0 ; t < menu_filesystem .items() .size() ; t++ )
first_creatable_fs = t ; if ( menu_filesystem .items()[ t ] .sensitive() )
break ; {
} first_creatable_fs = t ;
break ;
}
}
} }
} //GParted } //GParted