gparted r856 - in trunk: . include src



Author: gedakc
Date: Sun Jun 15 17:18:26 2008
New Revision: 856
URL: http://svn.gnome.org/viewvc/gparted?rev=856&view=rev

Log:
Migrated Round to cylinders checkbutton from dialog partition new to dialog base partition so that it can be used by all dialogs that inherit from dialog base partion (e.g., New, Copy, and Resize/Move)

Modified:
   trunk/ChangeLog
   trunk/include/Dialog_Base_Partition.h
   trunk/include/Dialog_Partition_New.h
   trunk/src/Dialog_Base_Partition.cc
   trunk/src/Dialog_Partition_New.cc

Modified: trunk/include/Dialog_Base_Partition.h
==============================================================================
--- trunk/include/Dialog_Base_Partition.h	(original)
+++ trunk/include/Dialog_Base_Partition.h	Sun Jun 15 17:18:26 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Bart
+/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Bart Hakvoort
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -68,7 +68,8 @@
 
 	Gtk::HBox hbox_main ;
 	Gtk::SpinButton spinbutton_before, spinbutton_size, spinbutton_after;
-	
+	Gtk::CheckButton checkbutton_round_to_cylinders ;
+
 	//used to enable/disable OKbutton...
 	int ORIG_BEFORE, ORIG_SIZE, ORIG_AFTER ;
 	

Modified: trunk/include/Dialog_Partition_New.h
==============================================================================
--- trunk/include/Dialog_Partition_New.h	(original)
+++ trunk/include/Dialog_Partition_New.h	Sun Jun 15 17:18:26 2008
@@ -43,7 +43,6 @@
 	
 	Gtk::Table table_create;
 	Gtk::OptionMenu optionmenu_type, optionmenu_filesystem;
-	Gtk::CheckButton checkbutton_round_to_cylinders ;
 	Gtk::Menu menu_type, menu_filesystem;
 	Gtk::Entry entry;
 

Modified: trunk/src/Dialog_Base_Partition.cc
==============================================================================
--- trunk/src/Dialog_Base_Partition.cc	(original)
+++ trunk/src/Dialog_Base_Partition.cc	Sun Jun 15 17:18:26 2008
@@ -39,7 +39,7 @@
 	
 	//pack hbox_main
 	this ->get_vbox() ->pack_start( hbox_main, Gtk::PACK_SHRINK );
-	
+
 	//put the vbox with resizer stuff (cool widget and spinbuttons) in the hbox_main
 	hbox_main .pack_start( vbox_resize_move, Gtk::PACK_EXPAND_PADDING );
 	
@@ -77,7 +77,12 @@
 	
 	if ( ! fixed_start )
 		before_value = spinbutton_before .get_value() ;
-	
+
+	//add checkbutton
+	checkbutton_round_to_cylinders .set_label( _("Round to cylinders") ) ;
+	checkbutton_round_to_cylinders .set_active( true ) ;
+	table_resize.attach( checkbutton_round_to_cylinders, 0, 1, 3, 4 ) ;
+
 	//connect signalhandlers of the spinbuttons
 	if ( ! fixed_start )
 		spinbutton_before .signal_value_changed() .connect( 
@@ -118,11 +123,11 @@
 
 Partition Dialog_Base_Partition::Get_New_Partition() 
 {
-	//FIXME:  Partition size is limited is just less than 1024 TeraBytes due
+	//FIXME:  Partition size is limited to just less than 1024 TeraBytes due
 	//        to the maximum value of signed 4 byte integer.
 	if ( ORIG_BEFORE != spinbutton_before .get_value_as_int() )
 		selected_partition .sector_start = START + Sector(spinbutton_before .get_value_as_int()) * MEBIBYTE ;	
-	
+
 	if ( ORIG_AFTER != spinbutton_after .get_value_as_int() )
 		selected_partition .sector_end = 
 			selected_partition .sector_start + Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE ;
@@ -143,7 +148,10 @@
 	//set new value of unused..
 	if ( selected_partition .sectors_used != -1 )
 		selected_partition .sectors_unused = selected_partition .get_length() - selected_partition .sectors_used ;
-	
+
+	//set indicator of whether to use strict sector values, or to round to cylinders
+	selected_partition .strict = ! checkbutton_round_to_cylinders .get_active() ;
+
 	return selected_partition ;
 }
 

Modified: trunk/src/Dialog_Partition_New.cc
==============================================================================
--- trunk/src/Dialog_Partition_New.cc	(original)
+++ trunk/src/Dialog_Partition_New.cc	Sun Jun 15 17:18:26 2008
@@ -29,14 +29,6 @@
 	
 	//set used (in pixels)...
 	frame_resizer_base ->set_used( 0 ) ;
-	
-	//checkbutton..
-	checkbutton_round_to_cylinders .set_label( _("Round to cylinders") ) ;
-	checkbutton_round_to_cylinders .set_active( true ) ;
-	checkbutton_round_to_cylinders .signal_clicked() .connect( 
-		sigc::bind<bool>( sigc::mem_fun(*this, &Dialog_Partition_New::optionmenu_changed), false ) ) ;
-
-	this ->get_vbox() ->pack_start( checkbutton_round_to_cylinders, Gtk::PACK_SHRINK ) ;
 }
 
 void Dialog_Partition_New::Set_Data( const Partition & partition,
@@ -157,7 +149,7 @@
 		default	:	part_type = GParted::TYPE_UNALLOCATED ;
 	}
 
-	//FIXME:  Partition size is limited is just less than 1024 TeraBytes due
+	//FIXME:  Partition size is limited to just less than 1024 TeraBytes due
 	//        to the maximum value of signed 4 byte integer.
 	new_start = START + (Sector(spinbutton_before .get_value_as_int()) * MEBIBYTE) ;
 	new_end  = new_start + (Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE) ;
@@ -197,6 +189,7 @@
 		part_temp .logicals .push_back( UNALLOCATED ) ;
 	}
 
+	//set indicator of whether to use strict sector values, or to round to cylinders
 	part_temp .strict = ! checkbutton_round_to_cylinders .get_active() ;
 
 	return part_temp;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]