2008-06-15 11:18:26 -06:00
|
|
|
/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Bart Hakvoort
|
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
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIALOG_BASE_PARTITION
|
|
|
|
#define DIALOG_BASE_PARTITION
|
|
|
|
|
|
|
|
#include "../include/Frame_Resizer_Extended.h"
|
|
|
|
#include "../include/Partition.h"
|
|
|
|
|
|
|
|
#include <gtkmm/dialog.h>
|
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/table.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/tooltips.h>
|
|
|
|
|
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
|
|
|
class Dialog_Base_Partition : public Gtk::Dialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2004-10-02 03:39:16 -06:00
|
|
|
Dialog_Base_Partition( ) ;
|
2004-10-06 09:32:40 -06:00
|
|
|
~Dialog_Base_Partition( ) ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
void Set_Resizer( bool extended ) ;
|
2004-10-06 09:32:40 -06:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
Partition selected_partition ;
|
|
|
|
|
|
|
|
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
|
|
|
|
2004-10-02 03:39:16 -06:00
|
|
|
Gtk::HBox hbox_main ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::SpinButton spinbutton_before, spinbutton_size, spinbutton_after;
|
2008-06-15 11:18:26 -06:00
|
|
|
Gtk::CheckButton checkbutton_round_to_cylinders ;
|
|
|
|
|
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 ;
|
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 ;
|
2004-12-09 15:56:33 -07:00
|
|
|
FS fs ;
|
2004-12-15 13:43:58 -07:00
|
|
|
short BUF ; //used in resize and copy ( safety reasons )
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
private:
|
2005-01-22 10:23:52 -07:00
|
|
|
void Check_Change( ) ;
|
2004-10-02 05:34:18 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::VBox vbox_resize_move;
|
2004-10-02 05:34:18 -06:00
|
|
|
Gtk::Label label_minmax ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::Table table_resize;
|
|
|
|
Gtk::HBox hbox_table, hbox_resizer, hbox_resize_move;
|
|
|
|
Gtk::Tooltips tooltips;
|
|
|
|
Gtk::Button button_resize_move ;
|
|
|
|
Gtk::Image *image_temp ;
|
2004-10-02 05:34:18 -06:00
|
|
|
|
|
|
|
Glib::ustring str_temp ;
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
|
|
|
#endif //DIALOG_BASE_PARTITION
|