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)
svn path=/trunk/; revision=856
This commit is contained in:
parent
21e965143e
commit
b10f2325d7
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2008-06-15 Curtis Gedak <gedakc@gmail.com>
|
||||
|
||||
* include/Dialog_Base_Partition.h,
|
||||
src/Dialog_Base_Partition.cc,
|
||||
include/Dialog_Partition_New.h,
|
||||
src/Dialog_Partition_New.cc: Migrated checkbutton.
|
||||
- Moved "Round to cylinders" checkbutton from partition New
|
||||
dialog to partition base dialog so that it may be used
|
||||
by all inheritors (e.g., New, Copy, and Resize/Move).
|
||||
|
||||
2008-06-12 Curtis Gedak <gedakc@gmail.com>
|
||||
|
||||
* src/GParted_Core.cc: Changed 3 grammatical errors to dashes.
|
||||
|
|
|
@ -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,6 +68,7 @@ protected:
|
|||
|
||||
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 ;
|
||||
|
|
|
@ -43,7 +43,6 @@ private:
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -78,6 +78,11 @@ Dialog_Base_Partition::Dialog_Base_Partition()
|
|||
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,7 +123,7 @@ void Dialog_Base_Partition::Set_Resizer( bool extended )
|
|||
|
||||
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 ;
|
||||
|
@ -144,6 +149,9 @@ Partition Dialog_Base_Partition::Get_New_Partition()
|
|||
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 ;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,14 +29,6 @@ Dialog_Partition_New::Dialog_Partition_New()
|
|||
|
||||
//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 @@ Partition Dialog_Partition_New::Get_New_Partition()
|
|||
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 @@ Partition Dialog_Partition_New::Get_New_Partition()
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue