2009-11-05 11:08:32 -07:00
|
|
|
/* Copyright (C) 2004 Bart
|
2010-04-19 19:22:31 -06:00
|
|
|
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2014-01-23 03:59:48 -07:00
|
|
|
* GNU General Public License for more details.
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-23 03:59:48 -07:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2004-09-19 14:24:53 -06:00
|
|
|
*/
|
2013-05-27 05:20:16 -06:00
|
|
|
|
|
|
|
#ifndef GPARTED_DIALOG_BASE_PARTITION_H
|
|
|
|
#define GPARTED_DIALOG_BASE_PARTITION_H
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2019-05-10 14:21:19 -06:00
|
|
|
|
|
|
|
#include "Device.h"
|
2016-10-18 16:45:28 -06:00
|
|
|
#include "Frame_Resizer_Extended.h"
|
2018-01-18 09:26:20 -07:00
|
|
|
#include "FileSystem.h"
|
2018-07-31 04:19:14 -06:00
|
|
|
#include "OptionComboBox.h"
|
2016-10-18 16:45:28 -06:00
|
|
|
#include "Partition.h"
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
#include <gtkmm/dialog.h>
|
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
2019-03-06 03:28:19 -07:00
|
|
|
#include <gtkmm/grid.h>
|
2004-09-19 14:24:53 -06:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
|
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
|
|
|
class Dialog_Base_Partition : public Gtk::Dialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2019-05-10 14:21:19 -06:00
|
|
|
Dialog_Base_Partition(const Device& device);
|
2004-10-06 09:32:40 -06:00
|
|
|
~Dialog_Base_Partition( ) ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
void Set_Resizer( bool extended ) ;
|
2015-12-16 13:15:58 -07:00
|
|
|
const Partition & Get_New_Partition();
|
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
protected:
|
|
|
|
enum SPINBUTTON {
|
2004-10-01 15:09:19 -06:00
|
|
|
BEFORE = 0,
|
|
|
|
SIZE = 1,
|
|
|
|
AFTER = 2
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
enum CONFIRMBUTTON {
|
2004-10-01 15:09:19 -06:00
|
|
|
RESIZE_MOVE = 0,
|
|
|
|
NEW = 1,
|
|
|
|
PASTE = 2
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
2015-05-26 14:52:04 -06:00
|
|
|
|
2015-12-16 13:15:58 -07:00
|
|
|
void prepare_new_partition();
|
2019-05-19 03:31:55 -06:00
|
|
|
static void snap_to_alignment(const Device& device, Partition& partition);
|
|
|
|
static void snap_to_cylinder(const Device& device, Partition& partition);
|
|
|
|
static void snap_to_mebibyte(const Device& device, Partition& partition);
|
2015-05-26 14:52:04 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
void Set_Confirm_Button( CONFIRMBUTTON button_type ) ;
|
2006-12-08 06:14:05 -07:00
|
|
|
void Set_MinMax_Text( Sector min, Sector max ) ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
double MB_PER_PIXEL ;
|
2006-12-08 06:14:05 -07:00
|
|
|
Sector TOTAL_MB ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Frame_Resizer_Base *frame_resizer_base;
|
2015-12-13 07:38:30 -07:00
|
|
|
Partition * new_partition;
|
2015-05-26 15:38:42 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
Sector START; //the first sector of the first relevant partition ( this is either current or current -1 ) needed in Get_Resized_Partition()
|
2004-10-02 03:39:16 -06:00
|
|
|
Sector total_length ; //total amount of sectors ( this can be up to 3 partitions...)
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2019-02-27 08:22:07 -07:00
|
|
|
Gtk::Box hbox_main;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::SpinButton spinbutton_before, spinbutton_size, spinbutton_after;
|
2018-07-31 04:19:14 -06:00
|
|
|
OptionComboBox combo_alignment;
|
2008-06-15 11:18:26 -06:00
|
|
|
|
2012-08-29 07:35:47 -06:00
|
|
|
sigc::connection before_change_connection, size_change_connection, after_change_connection ;
|
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
//used to enable/disable OKbutton...
|
2004-10-02 03:39:16 -06:00
|
|
|
int ORIG_BEFORE, ORIG_SIZE, ORIG_AFTER ;
|
2010-05-20 10:00:14 -06:00
|
|
|
|
|
|
|
//used to reserve space for Master or Extended Boot Record (1 MiB)
|
|
|
|
int MIN_SPACE_BEFORE_MB ;
|
|
|
|
|
|
|
|
int MB_Needed_for_Boot_Record( const Partition & partition ) ;
|
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
//signal handlers
|
|
|
|
void on_signal_move( int, int );
|
|
|
|
void on_signal_resize( int, int, Frame_Resizer_Base::ArrowType );
|
2004-10-02 03:39:16 -06:00
|
|
|
void on_spinbutton_value_changed( SPINBUTTON ) ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2004-10-06 09:32:40 -06:00
|
|
|
bool fixed_start, GRIP ;
|
2004-09-19 14:24:53 -06:00
|
|
|
double before_value ;
|
2019-05-10 14:21:19 -06:00
|
|
|
const Device& m_device;
|
2004-12-09 15:56:33 -07:00
|
|
|
FS fs ;
|
2018-01-12 03:04:37 -07:00
|
|
|
FS_Limits fs_limits; // Working copy of file system min/max size limits
|
2015-05-25 11:18:17 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
private:
|
2015-12-13 07:38:30 -07:00
|
|
|
Dialog_Base_Partition( const Dialog_Base_Partition & src ); // Not implemented copy constructor
|
|
|
|
Dialog_Base_Partition & operator=( const Dialog_Base_Partition & rhs ); // Not implemented copy assignment operator
|
|
|
|
|
2005-01-22 10:23:52 -07:00
|
|
|
void Check_Change( ) ;
|
2019-02-27 08:22:07 -07:00
|
|
|
|
|
|
|
Gtk::Box vbox_resize_move;
|
2004-10-02 05:34:18 -06:00
|
|
|
Gtk::Label label_minmax ;
|
2019-03-06 03:28:19 -07:00
|
|
|
Gtk::Grid grid_resize;
|
|
|
|
Gtk::Box hbox_grid;
|
2019-02-27 08:22:07 -07:00
|
|
|
Gtk::Box hbox_resizer;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::Button button_resize_move ;
|
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#endif /* GPARTED_DIALOG_BASE_PARTITION_H */
|