//www.iec.ch/zone/si/si_bytes.htm
* changed KB/MB/GB/TB to KiB/MiB/GiB/TiB after reading http://www.iec.ch/zone/si/si_bytes.htm
This commit is contained in:
parent
9da25b136d
commit
2b509a8332
|
@ -1,3 +1,7 @@
|
|||
2006-01-21 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* changed KB/MB/GB/TB to KiB/MiB/GiB/TiB after reading http://www.iec.ch/zone/si/si_bytes.htm
|
||||
|
||||
2006-01-21 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* src/main.cc: cleanups
|
||||
|
|
|
@ -51,21 +51,21 @@ Dialog_Base_Partition::Dialog_Base_Partition( )
|
|||
vbox_resize_move .pack_start( hbox_table, Gtk::PACK_SHRINK );
|
||||
|
||||
//add spinbutton_before
|
||||
table_resize.attach( * Utils::mk_label( (Glib::ustring) _( "Free Space Preceding (MB):") + " \t" ), 0, 1, 0, 1, Gtk::SHRINK );
|
||||
table_resize.attach( * Utils::mk_label( (Glib::ustring) _( "Free Space Preceding (MiB):") + " \t" ), 0, 1, 0, 1, Gtk::SHRINK );
|
||||
|
||||
spinbutton_before .set_numeric( true );
|
||||
spinbutton_before .set_increments( 1, 100 );
|
||||
table_resize.attach( spinbutton_before, 1, 2, 0, 1, Gtk::FILL );
|
||||
|
||||
//add spinbutton_size
|
||||
table_resize.attach( * Utils::mk_label( _( "New Size (MB):" ) ), 0, 1, 1, 2 );
|
||||
table_resize.attach( * Utils::mk_label( _( "New Size (MiB):" ) ), 0, 1, 1, 2 );
|
||||
|
||||
spinbutton_size .set_numeric( true );
|
||||
spinbutton_size .set_increments( 1, 100 );
|
||||
table_resize.attach( spinbutton_size, 1, 2, 1, 2, Gtk::FILL );
|
||||
|
||||
//add spinbutton_after
|
||||
table_resize.attach( * Utils::mk_label( _( "Free Space Following (MB):") ), 0, 1, 2, 3 ) ;
|
||||
table_resize.attach( * Utils::mk_label( _( "Free Space Following (MiB):") ), 0, 1, 2, 3 ) ;
|
||||
|
||||
spinbutton_after .set_numeric( true );
|
||||
spinbutton_after .set_increments( 1, 100 );
|
||||
|
@ -117,7 +117,7 @@ Partition Dialog_Base_Partition::Get_New_Partition( )
|
|||
if ( ORIG_AFTER != spinbutton_after .get_value_as_int( ) )
|
||||
selected_partition .sector_end = selected_partition .sector_start + spinbutton_size .get_value_as_int( ) * MEGABYTE ;
|
||||
|
||||
//due to loss of precision during calcs from Sector -> MB and back, it is possible the new partition thinks it's bigger then it can be. Here we solve this.
|
||||
//due to loss of precision during calcs from Sector -> MiB and back, it is possible the new partition thinks it's bigger then it can be. Here we solve this.
|
||||
if ( selected_partition .sector_start < START )
|
||||
selected_partition .sector_start = START ;
|
||||
if ( selected_partition .sector_end > (START + total_length) )
|
||||
|
@ -164,8 +164,8 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
|
|||
|
||||
void Dialog_Base_Partition::Set_MinMax_Text( long min, long max )
|
||||
{
|
||||
str_temp = String::ucompose( _("Minimum Size: %1 MB"), min ) + "\t\t" ;
|
||||
str_temp += String::ucompose( _("Maximum Size: %1 MB"), max ) ;
|
||||
str_temp = String::ucompose( _("Minimum Size: %1 MiB"), min ) + "\t\t" ;
|
||||
str_temp += String::ucompose( _("Maximum Size: %1 MiB"), max ) ;
|
||||
label_minmax .set_text( str_temp ) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ void Dialog_Partition_Info::init_drawingarea( )
|
|||
color_partition = partition .color ; this ->get_colormap( ) ->alloc_color( color_partition ) ;
|
||||
|
||||
//set text of pangolayout
|
||||
pango_layout = drawingarea .create_pango_layout ( partition .partition + "\n" + String::ucompose( _("%1 MB"), partition .Get_Length_MB( ) ) ) ;
|
||||
pango_layout = drawingarea .create_pango_layout ( partition .partition + "\n" + String::ucompose( _("%1 MiB"), partition .Get_Length_MB( ) ) ) ;
|
||||
}
|
||||
|
||||
void Dialog_Partition_Info::Display_Info( )
|
||||
|
|
|
@ -133,7 +133,7 @@ Partition Dialog_Partition_New::Get_New_Partition()
|
|||
new_start = START + (Sector) (spinbutton_before .get_value( ) * MEGABYTE) ;
|
||||
new_end = new_start + (Sector) (spinbutton_size .get_value( ) * MEGABYTE) ;
|
||||
|
||||
/* due to loss of precision during calcs from Sector -> MB and back, it is possible the new
|
||||
/* due to loss of precision during calcs from Sector -> MiB and back, it is possible the new
|
||||
* partition thinks it's bigger then it can be. Here we try to solve this.*/
|
||||
if ( new_start < selected_partition.sector_start )
|
||||
new_start = selected_partition.sector_start ;
|
||||
|
@ -148,7 +148,7 @@ Partition Dialog_Partition_New::Get_New_Partition()
|
|||
new_start, new_end,
|
||||
selected_partition .inside_extended, false) ;
|
||||
|
||||
//grow new partition a bit if freespaces are < 1 MB
|
||||
//grow new partition a bit if freespaces are < 1 MiB
|
||||
if ( (part_temp.sector_start - selected_partition.sector_start) < MEGABYTE )
|
||||
part_temp.sector_start = selected_partition.sector_start ;
|
||||
if ( (selected_partition.sector_end - part_temp.sector_end) < MEGABYTE )
|
||||
|
|
|
@ -77,7 +77,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
spinbutton_before .set_sensitive( false ) ;
|
||||
}
|
||||
|
||||
//calculate total size in MB's of previous, current and next partition
|
||||
//calculate total size in MiB's of previous, current and next partition
|
||||
//first find index of partition
|
||||
unsigned int t;
|
||||
for ( t = 0 ; t < partitions .size( ) ; t++ )
|
||||
|
@ -149,7 +149,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector <Partit
|
|||
|
||||
void Dialog_Partition_Resize_Move::Resize_Move_Extended( const std::vector <Partition> & partitions )
|
||||
{
|
||||
//calculate total size in MB's of previous, current and next partition
|
||||
//calculate total size in MiB's of previous, current and next partition
|
||||
//first find index of partition
|
||||
unsigned int t = 0;
|
||||
while ( t < partitions .size( ) && partitions[ t ] .type != GParted::TYPE_EXTENDED ) t++ ;
|
||||
|
|
|
@ -116,7 +116,7 @@ void GParted_Core::get_devices( std::vector<Device> & devices )
|
|||
temp_device .length = temp_device .heads * temp_device .sectors * temp_device .cylinders ;
|
||||
temp_device .cylsize = Utils::Sector_To_MB( temp_device .heads * temp_device .sectors ) ;
|
||||
|
||||
//make sure cylsize is at least 1 MB
|
||||
//make sure cylsize is at least 1 MiB
|
||||
if ( temp_device .cylsize < 1 )
|
||||
temp_device .cylsize = 1 ;
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ Glib::ustring Operation::Get_String( )
|
|||
else
|
||||
temp = partition_original .partition ;
|
||||
|
||||
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MB) from /dev/hda */
|
||||
return String::ucompose( _("Delete %1 (%2, %3 MB) from %4"),
|
||||
/*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 2345 MiB) from /dev/hda */
|
||||
return String::ucompose( _("Delete %1 (%2, %3 MiB) from %4"),
|
||||
temp,
|
||||
Utils::Get_Filesystem_String( partition_original .filesystem ),
|
||||
partition_original .Get_Length_MB( ),
|
||||
|
@ -75,8 +75,8 @@ Glib::ustring Operation::Get_String( )
|
|||
default :
|
||||
break;
|
||||
}
|
||||
/*TO TRANSLATORS: looks like Create Logical Partition #1 (ntfs, 2345 MB) on /dev/hda */
|
||||
return String::ucompose( _("Create %1 #%2 (%3, %4 MB) on %5"),
|
||||
/*TO TRANSLATORS: looks like Create Logical Partition #1 (ntfs, 2345 MiB) on /dev/hda */
|
||||
return String::ucompose( _("Create %1 #%2 (%3, %4 MiB) on %5"),
|
||||
temp,
|
||||
partition_new.partition_number,
|
||||
Utils::Get_Filesystem_String( partition_new.filesystem ),
|
||||
|
@ -84,28 +84,28 @@ Glib::ustring Operation::Get_String( )
|
|||
device .path ) ;
|
||||
|
||||
case RESIZE_MOVE:
|
||||
//if startsector has changed >= 1 MB we consider it a move
|
||||
//if startsector has changed >= 1 MiB we consider it a move
|
||||
diff = std::abs( partition_new .sector_start - partition_original .sector_start ) ;
|
||||
if ( diff >= MEGABYTE )
|
||||
{
|
||||
if ( partition_new .sector_start > partition_original .sector_start )
|
||||
temp = String::ucompose( _("Move %1 forward by %2 MB"), partition_new.partition, Utils::Sector_To_MB( diff ) ) ;
|
||||
temp = String::ucompose( _("Move %1 forward by %2 MiB"), partition_new.partition, Utils::Sector_To_MB( diff ) ) ;
|
||||
else
|
||||
temp = String::ucompose( _("Move %1 backward by %2 MB"), partition_new.partition, Utils::Sector_To_MB( diff ) ) ;
|
||||
temp = String::ucompose( _("Move %1 backward by %2 MiB"), partition_new.partition, Utils::Sector_To_MB( diff ) ) ;
|
||||
}
|
||||
|
||||
//check if size has changed ( we only consider changes >= 1 MB )
|
||||
//check if size has changed ( we only consider changes >= 1 MiB )
|
||||
diff = std::abs( (partition_original .sector_end - partition_original .sector_start) - (partition_new .sector_end - partition_new .sector_start) ) ;
|
||||
|
||||
if ( diff >= MEGABYTE )
|
||||
{
|
||||
if ( temp .empty( ) )
|
||||
temp = String::ucompose( _("Resize %1 from %2 MB to %3 MB"),
|
||||
temp = String::ucompose( _("Resize %1 from %2 MiB to %3 MiB"),
|
||||
partition_new.partition,
|
||||
partition_original .Get_Length_MB(),
|
||||
partition_new .Get_Length_MB() ) ;
|
||||
else
|
||||
temp += " " + String::ucompose( _("and Resize %1 from %2 MB to %3 MB"),
|
||||
temp += " " + String::ucompose( _("and Resize %1 from %2 MiB to %3 MiB"),
|
||||
partition_new.partition,
|
||||
partition_original .Get_Length_MB(),
|
||||
partition_new .Get_Length_MB() ) ;
|
||||
|
@ -123,8 +123,8 @@ Glib::ustring Operation::Get_String( )
|
|||
Utils::Get_Filesystem_String( partition_new .filesystem ) ) ;
|
||||
|
||||
case COPY :
|
||||
/*TO TRANSLATORS: looks like Copy /dev/hda4 to /dev/hdd (start at 2500 MB) */
|
||||
return String::ucompose( _("Copy %1 to %2 (start at %3 MB)"),
|
||||
/*TO TRANSLATORS: looks like Copy /dev/hda4 to /dev/hdd (start at 2500 MiB) */
|
||||
return String::ucompose( _("Copy %1 to %2 (start at %3 MiB)"),
|
||||
partition_new .partition,
|
||||
device .path,
|
||||
Utils::Sector_To_MB( partition_new .sector_start ) ) ;
|
||||
|
|
|
@ -249,12 +249,12 @@ Glib::ustring Utils::format_size( Sector size )
|
|||
if ( size < 1073741824 )
|
||||
{
|
||||
ss << static_cast<double>( size / 1048567.0 ) ;
|
||||
return String::ucompose( _("%1 MB"), ss .str() ) ;
|
||||
return String::ucompose( _("%1 MiB"), ss .str() ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << static_cast<double>( size / 1073741824.0 ) ;
|
||||
return String::ucompose( _("%1 GB"), ss .str() ) ;
|
||||
return String::ucompose( _("%1 GiB"), ss .str() ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1137,8 +1137,8 @@ void Win_GParted::activate_delete()
|
|||
str_temp += _( "After deletion this partition is no longer available for copying.") ;
|
||||
|
||||
Gtk::MessageDialog dialog( *this, str_temp, true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true );
|
||||
/*TO TRANSLATORS: dialogtitle, looks like Delete /dev/hda2 (ntfs, 2345 MB) */
|
||||
dialog .set_title( String::ucompose( _("Delete %1 (%2, %3 MB)"),
|
||||
/*TO TRANSLATORS: dialogtitle, looks like Delete /dev/hda2 (ntfs, 2345 MiB) */
|
||||
dialog .set_title( String::ucompose( _("Delete %1 (%2, %3 MiB)"),
|
||||
selected_partition .partition,
|
||||
selected_partition .filesystem,
|
||||
selected_partition .Get_Length_MB() ) );
|
||||
|
@ -1206,12 +1206,12 @@ void Win_GParted::activate_format( GParted::FILESYSTEM new_fs )
|
|||
|
||||
if ( selected_partition .Get_Length_MB( ) < fs .MIN )
|
||||
str_temp += String::ucompose(
|
||||
_( "A %1 filesystem requires a partition of at least %2 MB."),
|
||||
_( "A %1 filesystem requires a partition of at least %2 MiB."),
|
||||
Utils::Get_Filesystem_String( new_fs ),
|
||||
fs .MIN ) ;
|
||||
else
|
||||
str_temp += String::ucompose(
|
||||
_( "A partition with a %1 filesystem has a maximum size of %2 MB."),
|
||||
_( "A partition with a %1 filesystem has a maximum size of %2 MiB."),
|
||||
Utils::Get_Filesystem_String( new_fs ),
|
||||
fs .MAX ) ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue