From 2b509a833252dccd845dea2bf752e0557aec7e36 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Fri, 20 Jan 2006 23:35:06 +0000 Subject: [PATCH] //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 --- ChangeLog | 4 ++++ src/Dialog_Base_Partition.cc | 12 ++++++------ src/Dialog_Partition_Info.cc | 2 +- src/Dialog_Partition_New.cc | 4 ++-- src/Dialog_Partition_Resize_Move.cc | 4 ++-- src/GParted_Core.cc | 2 +- src/Operation.cc | 24 ++++++++++++------------ src/Utils.cc | 4 ++-- src/Win_GParted.cc | 8 ++++---- 9 files changed, 34 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc18519f..eef3798a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-01-21 Bart Hakvoort + + * 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 * src/main.cc: cleanups diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc index 7ce4b22e..dc896d77 100644 --- a/src/Dialog_Base_Partition.cc +++ b/src/Dialog_Base_Partition.cc @@ -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 ) ; } diff --git a/src/Dialog_Partition_Info.cc b/src/Dialog_Partition_Info.cc index 841b8d1d..844814ac 100644 --- a/src/Dialog_Partition_Info.cc +++ b/src/Dialog_Partition_Info.cc @@ -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( ) diff --git a/src/Dialog_Partition_New.cc b/src/Dialog_Partition_New.cc index 3df44210..3262f244 100644 --- a/src/Dialog_Partition_New.cc +++ b/src/Dialog_Partition_New.cc @@ -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 ) diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index b5a8accf..f9eb1908 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -77,7 +77,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector & 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++ ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 9a81328a..984855d8 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -116,7 +116,7 @@ void GParted_Core::get_devices( std::vector & 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 ; diff --git a/src/Operation.cc b/src/Operation.cc index a51ead9e..ccfb4500 100644 --- a/src/Operation.cc +++ b/src/Operation.cc @@ -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 ) ) ; diff --git a/src/Utils.cc b/src/Utils.cc index bab67fca..41cd0ca8 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -249,12 +249,12 @@ Glib::ustring Utils::format_size( Sector size ) if ( size < 1073741824 ) { ss << static_cast( size / 1048567.0 ) ; - return String::ucompose( _("%1 MB"), ss .str() ) ; + return String::ucompose( _("%1 MiB"), ss .str() ) ; } else { ss << static_cast( size / 1073741824.0 ) ; - return String::ucompose( _("%1 GB"), ss .str() ) ; + return String::ucompose( _("%1 GiB"), ss .str() ) ; } } diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 54186335..497a3a2e 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -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 ) ;