--- gparted-0.2.5.orig/gparted.desktop.in +++ gparted-0.2.5/gparted.desktop.in @@ -1,10 +1,11 @@ [Desktop Entry] Encoding=UTF-8 -_Name=GParted +_Name=GNOME Partition Editor _Comment=GNOME Partition Editor -Exec=gparted +Exec=gksu gparted Icon=gparted.png Terminal=false Type=Application -Categories=GNOME;Application;System; +Categories=GNOME;Application;System;Settings; StartupNotify=true +X-KDE-SubstituteUID=true --- gparted-0.2.5.orig/include/GParted_Core.h +++ gparted-0.2.5/include/GParted_Core.h @@ -31,7 +31,7 @@ class GParted_Core { public: - GParted_Core() ; + GParted_Core( int installer, const std::map & filesystems ) ; ~GParted_Core() ; void find_supported_filesystems() ; void set_user_devices( const std::vector & user_devices ) ; @@ -62,9 +62,11 @@ std::map get_available_flags( const Partition & partition ) ; bool toggle_flag( const Partition & partition, const Glib::ustring & flag, bool state ) ; + bool installer_mode; + std::vector formatted_partitions; + private: GParted::FILESYSTEM get_filesystem() ; - bool check_device_path( const Glib::ustring & device_path ) ; void set_device_partitions( Device & device ) ; void disable_automount( const Device & device ) ; void read_mountpoints_from_file( const Glib::ustring & filename, @@ -106,6 +108,7 @@ std::vector FILESYSTEMS ; FileSystem * p_filesystem ; + std::map filesystem_overrides ; std::vector flags; Glib::ustring temp ; Partition partition_temp ; --- gparted-0.2.5.orig/include/Partition.h +++ gparted-0.2.5/include/Partition.h @@ -40,7 +40,8 @@ STAT_REAL = 0, STAT_NEW = 1, STAT_COPY = 2, - STAT_FORMATTED = 3 + STAT_FORMATTED = 3, + STAT_FAKEFS = 4 }; --- gparted-0.2.5.orig/include/Utils.h +++ gparted-0.2.5/include/Utils.h @@ -122,6 +122,7 @@ static Glib::ustring get_color( FILESYSTEM filesystem ) ; static Glib::RefPtr get_color_as_pixbuf( FILESYSTEM filesystem, int width, int height ) ; static Glib::ustring get_filesystem_string( FILESYSTEM filesystem ) ; + static FILESYSTEM get_filesystem_by_name( Glib::ustring name ) ; static Glib::ustring format_size( Sector size ) ; static double sector_to_unit( Sector sectors, SIZE_UNIT size_unit ) ; static int execute_command( const Glib::ustring & command ) ; --- gparted-0.2.5.orig/include/Win_GParted.h +++ gparted-0.2.5/include/Win_GParted.h @@ -37,6 +37,7 @@ #include #include #include +#include #include //should be included by gtkmm headers. but decided to include it anyway after getting some bugreports.. @@ -46,7 +47,8 @@ class Win_GParted : public Gtk::Window { public: - Win_GParted( const std::vector & user_devices ) ; + Win_GParted( const std::vector & user_devices, int installer, const std::map & filesystem_overrides ) ; + ~Win_GParted() ; private: void init_menubar() ; @@ -83,31 +85,31 @@ void allow_copy( bool b ) { menu_partition .items()[ 5 ] .set_sensitive( b ); - toolbar_main .get_nth_item( 5 ) ->set_sensitive( b ); } + if ( !installer_mode ) toolbar_main .get_nth_item( 5 ) ->set_sensitive( b ); } void allow_paste( bool b ) { menu_partition .items()[ 6 ] .set_sensitive( b ); - toolbar_main .get_nth_item( 6 ) ->set_sensitive( b ); } + if ( !installer_mode ) toolbar_main .get_nth_item( 6 ) ->set_sensitive( b ); } void allow_format( bool b ) { - menu_partition .items()[ 8 ] .set_sensitive( b ); } + if ( !installer_mode ) menu_partition .items()[ 8 ] .set_sensitive( b ); } void allow_toggle_swap_mount_state( bool b ) { - menu_partition .items()[ 10 ] .set_sensitive( b ); } + menu_partition .items()[ installer_mode ? 9 : 10 ] .set_sensitive( b ); } void allow_manage_flags( bool b ) { - menu_partition .items()[ 13 ] .set_sensitive( b ) ; } + menu_partition .items()[ installer_mode ? 12 : 13 ] .set_sensitive( b ) ; } void allow_info( bool b ) { - menu_partition .items()[ 15 ] .set_sensitive( b ); } + menu_partition .items()[ installer_mode ? 14 : 15 ] .set_sensitive( b ); } void allow_undo( bool b ) { - toolbar_main .get_nth_item( 8 ) ->set_sensitive( b ); + toolbar_main .get_nth_item( installer_mode ? 5 : 8 ) ->set_sensitive( b ); static_cast( & menubar_main .items()[ 1 ] .get_submenu() ->items()[ 0 ] ) ->set_sensitive( b ) ; } void allow_apply( bool b ) { - toolbar_main .get_nth_item( 9 ) ->set_sensitive( b ); + if ( !installer_mode ) toolbar_main .get_nth_item( 9 ) ->set_sensitive( b ); static_cast( & menubar_main .items()[ 1 ] .get_submenu() ->items()[ 1 ] ) ->set_sensitive( b ) ; } @@ -154,7 +156,12 @@ void activate_undo(); void remove_operation( int index = -1, bool remove_all = false ) ; + bool activate_apply_internal(); void activate_apply(); + bool stdin_event( Glib::IOCondition condition ); + + void set_transient_for_this( Gtk::Window &dialog ); + void set_transient_for_xid( Gtk::Window *dialog, GdkNativeWindow xid ); //private variables unsigned int current_device ; @@ -235,6 +242,9 @@ //stuff for progress overview and pulsebar Glib::Thread *thread ; bool pulse ; + + int installer_mode; + Gtk::Plug *plug; }; } //GParted --- gparted-0.2.5.orig/src/Dialog_Partition_Resize_Move.cc +++ gparted-0.2.5/src/Dialog_Partition_Resize_Move.cc @@ -34,6 +34,9 @@ this ->selected_partition = selected_partition ; + if ( selected_partition .status == GParted::STAT_FAKEFS ) + this ->selected_partition .status = GParted::STAT_NEW ; + if ( selected_partition .type == GParted::TYPE_EXTENDED ) { Set_Resizer( true ) ; --- gparted-0.2.5.orig/src/GParted_Core.cc +++ gparted-0.2.5/src/GParted_Core.cc @@ -45,12 +45,15 @@ namespace GParted { -GParted_Core::GParted_Core() +GParted_Core::GParted_Core( int installer, const std::map & filesystems ) { lp_device = NULL ; lp_disk = NULL ; lp_partition = NULL ; p_filesystem = NULL ; + installer_mode = ( installer != 0 ) ; + if ( installer_mode ) + filesystem_overrides = filesystems ; DISABLE_AUTOMOUNT = false ; ped_exception_set_handler( ped_exception_handler ) ; @@ -61,19 +64,23 @@ flag = ped_partition_flag_next( flag ) ) flags .push_back( flag ) ; - //throw libpartedversion to the stdout to see which version is actually used. - std::cout << "======================" << std::endl ; - std::cout << "libparted : " << ped_get_version() << std::endl ; + if ( !installer_mode ) { + //throw libpartedversion to the stdout to see which version is actually used. + std::cout << "======================" << std::endl ; + std::cout << "libparted : " << ped_get_version() << std::endl ; + } //see if we can disable automounting if ( ! Glib::find_program_in_path( "hal-find-by-property" ) .empty() && ! Glib::find_program_in_path( "hal-set-property" ) .empty() ) { DISABLE_AUTOMOUNT = true ; - std::cout << "automounting disabled" << std::endl ; + if ( !installer_mode ) + std::cout << "automounting disabled" << std::endl ; } - std::cout << "======================" << std::endl ; + if ( !installer_mode ) + std::cout << "======================" << std::endl ; //initialize filesystemlist find_supported_filesystems() ; @@ -83,12 +90,12 @@ { FILESYSTEMS .clear() ; - ext2 fs_ext2; - FILESYSTEMS .push_back( fs_ext2 .get_filesystem_support() ) ; - ext3 fs_ext3; FILESYSTEMS .push_back( fs_ext3 .get_filesystem_support() ) ; + ext2 fs_ext2; + FILESYSTEMS .push_back( fs_ext2 .get_filesystem_support() ) ; + fat16 fs_fat16; FILESYSTEMS .push_back( fs_fat16 .get_filesystem_support() ) ; @@ -110,8 +117,13 @@ ntfs fs_ntfs; FILESYSTEMS .push_back( fs_ntfs .get_filesystem_support() ) ; - reiser4 fs_reiser4; - FILESYSTEMS .push_back( fs_reiser4 .get_filesystem_support() ) ; + if ( !installer_mode ) { + /* partman doesn't support reiser4 yet, so there's no point + * in offering this in installer mode. + */ + reiser4 fs_reiser4; + FILESYSTEMS .push_back( fs_reiser4 .get_filesystem_support() ) ; + } reiserfs fs_reiserfs; FILESYSTEMS .push_back( fs_reiserfs .get_filesystem_support() ) ; @@ -132,11 +144,6 @@ this ->device_paths = user_devices ; this ->probe_devices = ! user_devices .size() ; } - -bool GParted_Core::check_device_path( const Glib::ustring & device_path ) -{ - return ( device_path .length() > 6 && device_path .is_ascii() ) ; -} void GParted_Core::get_devices( std::vector & devices ) { @@ -151,16 +158,23 @@ device_paths .clear() ; //try to find all available devices - ped_device_probe_all(); - - lp_device = ped_device_get_next( NULL ); - while ( lp_device ) - { - device_paths .push_back( lp_device ->path ) ; - - lp_device = ped_device_get_next( lp_device ) ; - } - close_device_and_disk() ; + std::ifstream proc_partitions( "/proc/partitions" ) ; + if ( proc_partitions ) + { + std::string line ; + while ( getline( proc_partitions, line ) ) + { + int minor ; + char device[512] ; + if ( sscanf( line .c_str(), "%*d %d %*d %s", &minor, device ) == 2 && minor == 0 && + strncmp( device, "dm-", 3 ) != 0 && + strncmp( device, "loop", 4 ) != 0 && + strncmp( device, "ram", 3 ) != 0 ) + device_paths .push_back( "/dev/" + Glib::ustring( device ) ) ; + } + + proc_partitions .close() ; + } std::sort( device_paths .begin(), device_paths .end() ) ; } @@ -172,9 +186,7 @@ for ( unsigned int t = 0 ; t < device_paths .size() ; t++ ) { - if ( check_device_path( device_paths[ t ] ) && - open_device_and_disk( device_paths[ t ], false ) && - lp_device ) + if ( open_device_and_disk( device_paths[ t ], false ) ) { temp_device .Reset() ; @@ -369,6 +381,7 @@ { int EXT_INDEX = -1 ; char * lp_path ;//we have to free the result of ped_partition_get_path().. + FILESYSTEM filesystem ; //clear partitions device .partitions .clear() ; @@ -383,12 +396,27 @@ case PED_PARTITION_NORMAL: case PED_PARTITION_LOGICAL: lp_path = ped_partition_get_path( lp_partition ) ; + filesystem = FS_UNKNOWN ; + // Overridden by the installer? + if ( lp_path ) + { + Glib::ustring pathstr( lp_path ) ; + std::map::iterator iter = + filesystem_overrides .find( pathstr ) ; + if ( iter != filesystem_overrides .end() ) + { + filesystem = iter ->second ; + partition_temp .status = STAT_FAKEFS ; + } + } + if ( filesystem == FS_UNKNOWN ) + filesystem = get_filesystem() ; partition_temp .Set( device .get_path(), lp_path, lp_partition ->num, lp_partition ->type == 0 ? GParted::TYPE_PRIMARY : GParted::TYPE_LOGICAL, - get_filesystem(), + filesystem, lp_partition ->geom .start, lp_partition ->geom .end, lp_partition ->type, @@ -539,7 +567,8 @@ for ( unsigned int t = 0 ; t < partitions .size() ; t++ ) { - if ( partitions[ t ] .filesystem != GParted::FS_LINUX_SWAP && + if ( partitions[ t ] .status != GParted::STAT_FAKEFS && + partitions[ t ] .filesystem != GParted::FS_LINUX_SWAP && partitions[ t ] .filesystem != GParted::FS_UNKNOWN ) { if ( partitions[ t ] .type == GParted::TYPE_PRIMARY || @@ -678,8 +707,19 @@ if ( ! p_filesystem ) return true ; - return set_partition_type( new_partition, operation_details ) && - p_filesystem ->Create( new_partition, operation_details ) ; + if ( installer_mode ) + { + if ( set_partition_type( new_partition, operation_details ) ) + { + formatted_partitions .push_back( new_partition ); + return true ; + } + else + return false ; + } + else + return set_partition_type( new_partition, operation_details ) && + p_filesystem ->Create( new_partition, operation_details ) ; } return false ; @@ -692,8 +732,19 @@ set_proper_filesystem( partition .filesystem ) ; - return set_partition_type( partition, operation_details ) && - p_filesystem ->Create( partition, operation_details ) ; + if ( installer_mode ) + { + if ( set_partition_type( partition, operation_details ) ) + { + formatted_partitions .push_back( partition ); + return true ; + } + else + return false ; + } + else + return set_partition_type( partition, operation_details ) && + p_filesystem ->Create( partition, operation_details ) ; } bool GParted_Core::Delete( const Partition & partition, std::vector & operation_details ) @@ -1395,7 +1446,7 @@ PedExceptionOption GParted_Core::ped_exception_handler( PedException * e ) { - std::cout << e ->message << std::endl ; + std::cerr << e ->message << std::endl ; ped_error = e ->message ; return PED_EXCEPTION_UNHANDLED ; --- gparted-0.2.5.orig/src/OperationResizeMove.cc +++ gparted-0.2.5/src/OperationResizeMove.cc @@ -15,6 +15,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _ISOC99_SOURCE #include "../include/OperationResizeMove.h" namespace GParted @@ -46,7 +47,7 @@ { //FIXME:make messages more informative by specifying shrink/grow instead of resize. //if startsector has changed we consider it a move - Sector diff = std::abs( partition_new .sector_start - partition_original .sector_start ) ; + Sector diff = llabs( partition_new .sector_start - partition_original .sector_start ) ; if ( diff ) { if ( diff > 0 ) @@ -60,7 +61,7 @@ } //check if size has changed - diff = std::abs( partition_original .get_length() - partition_new .get_length() ) ; + diff = llabs( partition_original .get_length() - partition_new .get_length() ) ; if ( diff ) { if ( description .empty() ) --- gparted-0.2.5.orig/src/Utils.cc +++ gparted-0.2.5/src/Utils.cc @@ -131,6 +131,40 @@ } } +FILESYSTEM Utils::get_filesystem_by_name( Glib::ustring name ) +{ + if ( name == "extended" ) + return FS_EXTENDED; + else if ( name == "ext2" ) + return FS_EXT2; + else if ( name == "ext3" ) + return FS_EXT3; + else if ( name == "linux-swap" ) + return FS_LINUX_SWAP; + else if ( name == "fat16" ) + return FS_FAT16; + else if ( name == "fat32" ) + return FS_FAT32; + else if ( name == "ntfs" ) + return FS_NTFS; + else if ( name == "reiserfs" ) + return FS_REISERFS; + else if ( name == "reiser4" ) + return FS_REISER4; + else if ( name == "xfs" ) + return FS_XFS; + else if ( name == "jfs" ) + return FS_JFS; + else if ( name == "hfs" ) + return FS_HFS; + else if ( name == "hfs+" ) + return FS_HFSPLUS; + else if ( name == "ufs" ) + return FS_UFS; + else + return FS_UNKNOWN; +} + Glib::ustring Utils::format_size( Sector size ) { std::stringstream ss ; @@ -232,8 +266,8 @@ { error = e .what() ; - //spit exceptions to stdout.. - std::cout << error << std::endl ; + //spit exceptions to stderr.. + std::cerr << error << std::endl ; return -1 ; } --- gparted-0.2.5.orig/src/Win_GParted.cc +++ gparted-0.2.5/src/Win_GParted.cc @@ -35,11 +35,16 @@ #include #include +#include +#include + namespace GParted { -Win_GParted::Win_GParted( const std::vector & user_devices ) +Win_GParted::Win_GParted( const std::vector & user_devices, int installer, const std::map & filesystem_overrides ) : gparted_core( installer, filesystem_overrides ) { + installer_mode = installer; + copied_partition .Reset() ; selected_partition .Reset() ; new_count = 1; @@ -48,25 +53,41 @@ OPERATIONSLIST_OPEN = true ; gparted_core .set_user_devices( user_devices ) ; - //==== GUI ========================= - this ->set_title( _("GParted") ); - this ->set_default_size( 775, 500 ); - - try + if ( !installer_mode ) { - this ->set_icon_from_file( GNOME_ICONDIR "/gparted.png" ) ; + plug = 0; + + //==== GUI ========================= + this ->set_title( _("GParted") ); + this ->set_default_size( 775, 500 ); + + try + { + this ->set_icon_from_file( GNOME_ICONDIR "/gparted.png" ) ; + } + catch ( Glib::Exception & e ) + { + std::cerr << e .what() << std::endl ; + } + + //Pack the main box + this ->add( vbox_main ); + } + else + { + plug = new Gtk::Plug( (GdkNativeWindow) installer_mode ); + plug ->add( vbox_main ); + vbox_main .show( ); + plug ->show( ); + this ->hide_all( ); + this ->move( 100000, 100000 ); + Glib::signal_io().connect( sigc::mem_fun( this, &Win_GParted::stdin_event ), Glib::IOChannel::create_from_fd( 0 ), Glib::IO_IN | Glib::IO_HUP ); } - catch ( Glib::Exception & e ) - { - std::cout << e .what() << std::endl ; - } - - //Pack the main box - this ->add( vbox_main ); //menubar.... init_menubar() ; - vbox_main .pack_start( menubar_main, Gtk::PACK_SHRINK ); + if ( !installer_mode ) + vbox_main .pack_start( menubar_main, Gtk::PACK_SHRINK ); //toolbar.... init_toolbar() ; @@ -100,7 +121,15 @@ statusbar .add( pulsebar ); vbox_main .pack_start( statusbar, Gtk::PACK_SHRINK ); - this ->show_all_children(); + if ( installer_mode ) + { + statusbar .set_has_resize_grip( false ); + plug ->show_all_children( ); + this ->on_show( ); + this ->hide_all( ); + } + else + this ->show_all_children(); //make sure harddisk information is closed.. hpaned_main .get_child1() ->hide() ; @@ -162,6 +191,7 @@ toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_new) ); toolbar_main.append(*toolbutton); toolbutton ->set_tooltip(tooltips, _("Create a new partition in the selected unallocated space") ); + toolbutton ->set_is_important(); toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::DELETE)); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_delete) ); toolbar_main.append(*toolbutton); @@ -176,16 +206,19 @@ toolbutton ->set_tooltip(tooltips, _("Resize/Move the selected partition") ); toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) ); - //COPY and PASTE - toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::COPY)); - toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_copy) ); - toolbar_main.append(*toolbutton); - toolbutton ->set_tooltip(tooltips, _("Copy the selected partition to the clipboard") ); - toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::PASTE)); - toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_paste) ); - toolbar_main.append(*toolbutton); - toolbutton ->set_tooltip(tooltips, _("Paste the partition from the clipboard") ); - toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) ); + if ( !installer_mode ) + { + //COPY and PASTE + toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::COPY)); + toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_copy) ); + toolbar_main.append(*toolbutton); + toolbutton ->set_tooltip(tooltips, _("Copy the selected partition to the clipboard") ); + toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::PASTE)); + toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_paste) ); + toolbar_main.append(*toolbutton); + toolbutton ->set_tooltip(tooltips, _("Paste the partition from the clipboard") ); + toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) ); + } //UNDO and APPLY toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::UNDO)); @@ -194,11 +227,13 @@ toolbutton ->set_sensitive( false ); toolbutton ->set_tooltip(tooltips, _("Undo last operation") ); - toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY)); - toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_apply) ); - toolbar_main.append(*toolbutton); - toolbutton ->set_sensitive( false ); - toolbutton ->set_tooltip(tooltips, _("Apply all operations") ); + if ( !installer_mode ) { + toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY)); + toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_apply) ); + toolbar_main.append(*toolbutton); + toolbutton ->set_sensitive( false ); + toolbutton ->set_tooltip(tooltips, _("Apply all operations") ); + } //initialize and pack combo_devices liststore_devices = Gtk::ListStore::create( treeview_devices_columns ) ; @@ -211,6 +246,9 @@ combo_devices .signal_changed() .connect( sigc::mem_fun(*this, &Win_GParted::combo_devices_changed) ); hbox_toolbar .pack_start( combo_devices, Gtk::PACK_SHRINK ) ; + + if ( installer_mode ) + toolbar_main .set_toolbar_style( Gtk::TOOLBAR_BOTH_HORIZ ); } void Win_GParted::init_partition_menu() @@ -244,12 +282,15 @@ menu_partition .items() .push_back( Gtk::Menu_Helpers::SeparatorElem() ); - image = manage( new Gtk::Image( Gtk::Stock::CONVERT, Gtk::ICON_SIZE_MENU ) ); - /*TO TRANSLATORS: menuitem which holds a submenu with filesystems.. */ - menu_partition .items() .push_back( - Gtk::Menu_Helpers::ImageMenuElem( _("_Format to"), - *image, - * create_format_menu() ) ) ; + if ( !installer_mode ) + { + image = manage( new Gtk::Image( Gtk::Stock::CONVERT, Gtk::ICON_SIZE_MENU ) ); + /*TO TRANSLATORS: menuitem which holds a submenu with filesystems.. */ + menu_partition .items() .push_back( + Gtk::Menu_Helpers::ImageMenuElem( _("_Format to"), + *image, + * create_format_menu() ) ) ; + } menu_partition .items() .push_back( Gtk::Menu_Helpers::SeparatorElem() ); @@ -570,7 +611,10 @@ bool Win_GParted::on_delete_event( GdkEventAny *event ) { - return ! Quit_Check_Operations(); + bool quit_check_result = Quit_Check_Operations(); + if ( quit_check_result ) + Gtk::Main::quit( ); + return ! quit_check_result; } void Win_GParted::Add_Operation( OperationType operationtype, const Partition & new_partition, int index ) @@ -702,12 +746,12 @@ { if ( operations .size() ) { - Gtk::MessageDialog dialog( *this, - _("Quit GParted?"), + Gtk::MessageDialog dialog( _("Quit GParted?"), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true ); + set_transient_for_this( dialog ); if ( operations .size() != 1 ) dialog .set_secondary_text( String::ucompose( _("%1 operations are currently pending."), @@ -731,9 +775,9 @@ allow_paste( false ); allow_format( false ); allow_toggle_swap_mount_state( false ) ; allow_manage_flags( false ) ; allow_info( false ) ; - dynamic_cast(menu_partition .items()[ 10 ] .get_child() ) ->set_label( _("unmount") ) ; - menu_partition .items()[ 10 ] .show() ; - menu_partition .items()[ 11 ] .hide() ; + dynamic_cast(menu_partition .items()[ installer_mode ? 9 : 10 ] .get_child() ) ->set_label( _("unmount") ) ; + menu_partition .items()[ installer_mode ? 9 : 10 ] .show() ; + menu_partition .items()[ installer_mode ? 10 : 11 ] .hide() ; //no partition selected... if ( ! selected_partition .get_paths() .size() ) @@ -754,13 +798,13 @@ if ( selected_partition .busy ) { - dynamic_cast(menu_partition .items()[ 10 ] .get_child() ) + dynamic_cast(menu_partition .items()[ installer_mode ? 9 : 10 ] .get_child() ) ->set_label( _("swapoff") ) ; return ; } else - dynamic_cast(menu_partition .items()[ 10 ] .get_child() ) + dynamic_cast(menu_partition .items()[ installer_mode ? 9 : 10 ] .get_child() ) ->set_label( _("swapon") ) ; } @@ -828,7 +872,7 @@ { allow_toggle_swap_mount_state( true ) ; - menu = menu_partition .items()[ 11 ] .get_submenu() ; + menu = menu_partition .items()[ installer_mode ? 10 : 11 ] .get_submenu() ; menu ->items() .clear() ; for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ ) { @@ -840,8 +884,8 @@ dynamic_cast( menu ->items() .back() .get_child() ) ->set_use_underline( false ) ; } - menu_partition .items()[ 10 ] .hide() ; - menu_partition .items()[ 11 ] .show() ; + menu_partition .items()[ installer_mode ? 9 : 10 ] .hide() ; + menu_partition .items()[ installer_mode ? 10 : 11 ] .show() ; } //see if there is an copied partition and if it passes all tests @@ -965,13 +1009,13 @@ if ( readonly_paths .size() > 0 ) { Gtk::MessageDialog dialog( - *this, _("The kernel is unable to re-read the partitiontables on the following devices:") + Glib::build_path( "", readonly_paths ), false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true ) ; + set_transient_for_this( dialog ); dialog .set_secondary_text( _("Because of this you will only have limited access to these devices. Unmount all mounted partitions on a device to get full access.") ) ; @@ -1040,7 +1084,7 @@ void Win_GParted::menu_gparted_features() { DialogFeatures dialog ; - dialog .set_transient_for( *this ) ; + set_transient_for_this( dialog ) ; dialog .load_filesystems( gparted_core .get_filesystems() ) ; while ( dialog .run() == Gtk::RESPONSE_OK ) @@ -1048,17 +1092,20 @@ gparted_core .find_supported_filesystems() ; dialog .load_filesystems( gparted_core .get_filesystems() ) ; - //recreate format menu... - menu_partition .items()[ 8 ] .remove_submenu() ; - menu_partition .items()[ 8 ] .set_submenu( * create_format_menu() ) ; - menu_partition .show_all_children() ; + if ( !installer_mode ) + { + //recreate format menu... + menu_partition .items()[ 8 ] .remove_submenu() ; + menu_partition .items()[ 8 ] .set_submenu( * create_format_menu() ) ; + menu_partition .show_all_children() ; + } } } void Win_GParted::menu_gparted_quit() { if ( Quit_Check_Operations() ) - this ->hide(); + Gtk::Main::quit(); } void Win_GParted::menu_view_harddisk_info() @@ -1095,12 +1142,12 @@ void Win_GParted::menu_help_contents() { - Gtk::MessageDialog dialog( *this, - _("Sorry, not yet implemented."), + Gtk::MessageDialog dialog( _("Sorry, not yet implemented."), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true ); + set_transient_for_this( dialog ); dialog .set_secondary_text( _( "Please visit http://gparted.sf.net for more information and support.") ) ; @@ -1113,7 +1160,7 @@ std::vector strings ; Gtk::AboutDialog dialog ; - dialog .set_transient_for( *this ) ; + set_transient_for_this( dialog ) ; dialog .set_name( _("GParted") ) ; dialog .set_logo( this ->get_icon() ) ; @@ -1172,13 +1219,13 @@ if ( ! selected_partition .inside_extended && primary_count >= devices[ current_device ] .max_prims ) { Gtk::MessageDialog dialog( - *this, String::ucompose( _("It is not possible to create more than %1 primary partitions"), devices[ current_device ] .max_prims ), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ) ; + set_transient_for_this( dialog ); dialog .set_secondary_text( _( "If you want more partitions you should first create an extended partition. Such a partition can contain other partitions. Because an extended partition is also a primary partition it might be necessary to remove a primary partition first.") ) ; @@ -1212,7 +1259,7 @@ else dialog .Set_Data( selected_partition, partitions ); - dialog .set_transient_for( *this ) ; + set_transient_for_this( dialog ) ; if ( dialog .run() == Gtk::RESPONSE_OK ) { @@ -1241,6 +1288,19 @@ } } } + //if it's a fake filesystem (installer mode), then we delete + //the partition and re-create it with the new size and position + else if ( selected_partition .status == GParted::STAT_FAKEFS ) + { + Glib::ustring path = devices[ current_device ] .get_path(); + Sector sector_start = selected_partition .sector_start; + Sector sector_end = selected_partition .sector_end; + bool inside_extended = selected_partition .inside_extended; + + Add_Operation( GParted::DELETE, selected_partition ); + selected_partition .Set_Unallocated( path, sector_start, sector_end, inside_extended ); + Add_Operation( GParted::CREATE, dialog .Get_New_Partition() ); + } else//normal move/resize on existing partition Add_Operation( GParted::RESIZE_MOVE, dialog .Get_New_Partition() ); } @@ -1264,7 +1324,7 @@ copied_partition .error .clear() ; copied_partition .clear_mountpoints() ; dialog .Set_Data( selected_partition, copied_partition ) ; - dialog .set_transient_for( *this ); + set_transient_for_this( dialog ); if ( dialog .run() == Gtk::RESPONSE_OK ) { @@ -1303,7 +1363,7 @@ devices[ current_device ] .readonly, devices[ current_device ] .cylsize ) ; - dialog .set_transient_for( *this ); + set_transient_for_this( dialog ); if ( dialog .run() == Gtk::RESPONSE_OK ) { @@ -1328,12 +1388,12 @@ selected_partition .status != GParted::STAT_NEW && selected_partition .partition_number < devices[ current_device ] .highest_busy ) { - Gtk::MessageDialog dialog( *this, - String::ucompose( _( "Unable to delete %1!"), selected_partition .get_path() ), + Gtk::MessageDialog dialog( String::ucompose( _( "Unable to delete %1!"), selected_partition .get_path() ), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ) ; + set_transient_for_this( dialog ); dialog .set_secondary_text( String::ucompose( _("Please unmount any logical partitions having a number higher than %1"), @@ -1346,13 +1406,13 @@ //if partition is on the clipboard...(NOTE: we can't use Partition::== here..) if ( selected_partition .get_path() == copied_partition .get_path() ) { - Gtk::MessageDialog dialog( *this, - String::ucompose( _( "Are you sure you want to delete %1?"), + Gtk::MessageDialog dialog( String::ucompose( _( "Are you sure you want to delete %1?"), selected_partition .get_path() ), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true ) ; + set_transient_for_this( dialog ); dialog .set_secondary_text( _("After deletion this partition is no longer available for copying.") ) ; @@ -1405,7 +1465,7 @@ void Win_GParted::activate_info() { Dialog_Partition_Info dialog( selected_partition ); - dialog .set_transient_for( *this ); + set_transient_for_this( dialog ); dialog .run(); } @@ -1417,13 +1477,13 @@ if ( selected_partition .get_length() < fs .MIN || fs .MAX && selected_partition .get_length() > fs .MAX ) { - Gtk::MessageDialog dialog( *this, - String::ucompose( _("Cannot format this filesystem to %1."), + Gtk::MessageDialog dialog( String::ucompose( _("Cannot format this filesystem to %1."), Utils::get_filesystem_string( new_fs ) ) , false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ); + set_transient_for_this( dialog ); if ( selected_partition .get_length() < fs .MIN ) dialog .set_secondary_text( String::ucompose( @@ -1563,12 +1623,12 @@ if ( ! succes ) { Gtk::MessageDialog dialog( - *this, selected_partition .busy ? _("Could not deactivate swap") : _("Could not activate swap"), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ) ; + set_transient_for_this( dialog ); dialog .set_secondary_text( error ) ; @@ -1584,12 +1644,12 @@ if ( ! succes ) { - Gtk::MessageDialog dialog( *this, - String::ucompose( _("Could not unmount %1"), selected_partition .get_path() ), + Gtk::MessageDialog dialog( String::ucompose( _("Could not unmount %1"), selected_partition .get_path() ), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ); + set_transient_for_this( dialog ); dialog .set_secondary_text( error, true ) ; @@ -1620,14 +1680,14 @@ if ( ! succes ) { - Gtk::MessageDialog dialog( *this, - String::ucompose( _("Could not mount %1 on %2"), + Gtk::MessageDialog dialog( String::ucompose( _("Could not mount %1 on %2"), selected_partition .get_path(), selected_partition .get_mountpoints()[ index ] ), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ); + set_transient_for_this( dialog ); dialog .set_secondary_text( error, true ) ; @@ -1640,18 +1700,18 @@ void Win_GParted::activate_disklabel() { Dialog_Disklabel dialog( devices[ current_device ] .get_path(), gparted_core .get_disklabeltypes() ) ; - dialog .set_transient_for( *this ); + set_transient_for_this( dialog ); if ( dialog .run() == Gtk::RESPONSE_OK ) { - Gtk::MessageDialog m_dialog( *this, - String::ucompose( _("Are you sure you want to create a %1 disklabel on %2?"), + Gtk::MessageDialog m_dialog( String::ucompose( _("Are you sure you want to create a %1 disklabel on %2?"), dialog .Get_Disklabel(), devices[ current_device ] .get_path() ), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_CANCEL, true ) ; + set_transient_for_this( m_dialog ); m_dialog .set_secondary_text( String::ucompose( _("This operation will destroy all data on %1!"), devices[ current_device ] .get_path() ) ) ; @@ -1661,12 +1721,12 @@ if ( m_dialog .run() == Gtk::RESPONSE_OK && ! gparted_core .Set_Disklabel( devices[ current_device ] .get_path(), dialog .Get_Disklabel() ) ) { - Gtk::MessageDialog dialog( *this, - _("Error while setting new disklabel"), + Gtk::MessageDialog dialog( _("Error while setting new disklabel"), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true ) ; + set_transient_for_this( dialog ); dialog .run() ; } @@ -1684,7 +1744,7 @@ Gtk::Main::iteration() ; DialogManageFlags dialog( selected_partition, gparted_core .get_available_flags( selected_partition ) ) ; - dialog .set_transient_for( *this ) ; + set_transient_for_this( dialog ); dialog .signal_get_flags .connect( sigc::mem_fun( &gparted_core, &GParted_Core::get_available_flags ) ) ; dialog .signal_toggle_flag .connect( @@ -1734,14 +1794,17 @@ } } -void Win_GParted::activate_apply() +bool Win_GParted::activate_apply_internal() { - Gtk::MessageDialog dialog( *this, - _("Are you sure you want to apply the pending operations?"), + if ( ! operations .size( ) ) + return true; + + Gtk::MessageDialog dialog( _("Are you sure you want to apply the pending operations?"), false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE, true ); + set_transient_for_this( dialog ); dialog .set_secondary_text( _( "It is recommended to backup valuable data before proceeding.") ) ; dialog .set_title( _( "Apply operations to harddisk" ) ); @@ -1754,7 +1817,7 @@ dialog .hide() ; //hide confirmationdialog Dialog_Progress dialog_progress( operations ) ; - dialog_progress .set_transient_for( *this ) ; + set_transient_for_this( dialog_progress ); dialog_progress .signal_apply_operation .connect( sigc::mem_fun(gparted_core, &GParted_Core::apply_operation_to_disk) ) ; @@ -1777,7 +1840,142 @@ //reread devices and their layouts... menu_gparted_refresh_devices() ; + + return response == Gtk::RESPONSE_CLOSE; } + else + return false; +} + +void Win_GParted::activate_apply( ) +{ + activate_apply_internal( ) ; +} + +bool Win_GParted::stdin_event( Glib::IOCondition condition ) +{ + if ( condition & Glib::IO_IN ) + { + char line[512]; + std::cin.getline( line, 512 ) ; + if ( strcmp( line, "apply" ) == 0 ) + { + if ( activate_apply_internal( ) ) + { + // mark any remaining fakefs partitions as to be formatted + for ( unsigned int i = 0 ; i < devices .size() ; ++i ) + { + std::vector partitions = devices[ i ] .partitions ; + for ( unsigned int j = 0 ; j < partitions .size() ; ++j ) + { + if ( partitions[ j ] .status == STAT_FAKEFS ) + gparted_core .formatted_partitions .push_back( partitions[ j ] ); + } + } + for ( unsigned int i = 0 ; i < gparted_core .formatted_partitions .size() ; ++i ) + { + Partition *partition = &gparted_core .formatted_partitions[ i ]; + std::cout << "- FORMAT " << partition ->get_path() << " " << Utils::get_filesystem_string( partition ->filesystem ) << std::endl; + } + std::cout << "0 OK" << std::endl ; + } + else + std::cout << "1 Cancel" << std::endl ; + } + else if ( strcmp( line, "undo" ) == 0 ) + activate_undo( ) ; + } + + if ( condition & Glib::IO_HUP ) + { + Gtk::Main::quit( ); + return false; + } + + return true; +} + +void Win_GParted::set_transient_for_this( Gtk::Window &dialog ) +{ + if ( installer_mode ) + { + GdkWindow *window = get_window() ->gobj(); + Display *xdisplay = GDK_WINDOW_XDISPLAY( window ); + // These should really be of type Window, but for some + // reason that clashes with Gdk::Window. + XID xid = installer_mode, root, parent, *children; + unsigned int nchildren; + + for ( ;; ) + { + static Atom WM_STATE = + XInternAtom( xdisplay, "WM_STATE", False ); + Atom type; + int format; + unsigned long nitems, after; + unsigned char *data = NULL; + + if ( XGetWindowProperty( xdisplay, xid, WM_STATE, 0, 0, + False, AnyPropertyType, &type, + &format, &nitems, &after, + &data) == Success ) + { + if ( data ) + XFree( (char *) data ); + if ( type ) + { + // Found a toplevel window + break; + } + } + + if ( XQueryTree( xdisplay, xid, &root, &parent, + &children, &nchildren ) == 0 ) + { + xid = 0; + break; + } + + XFree( children ); + + xid = parent; + } + + if ( xid ) + set_transient_for_xid( &dialog, xid ); + } + else + dialog .set_transient_for( *(Gtk::Window *) this ); +} + +void Win_GParted::set_transient_for_xid( Gtk::Window *dialog, GdkNativeWindow xid ) +{ + if ( ! dialog ->is_realized() ) + { + dialog ->signal_realize() .connect( + sigc::bind( + sigc::mem_fun( this, &Win_GParted::set_transient_for_xid ), + dialog, xid ) ); + return; + } + + GdkDisplay *display = + gdk_drawable_get_display( GDK_DRAWABLE( + get_window() -> gobj() ) ); + GdkWindow *transient_parent = + gdk_window_lookup_for_display( display, xid ); + if ( !transient_parent ) + transient_parent = + gdk_window_foreign_new_for_display( display, + xid ); + if ( transient_parent ) + gdk_window_set_transient_for( + dialog ->get_window() ->gobj(), transient_parent ); +} + +Win_GParted::~Win_GParted( ) +{ + delete plug; } } // GParted --- gparted-0.2.5.orig/src/main.cc +++ gparted-0.2.5/src/main.cc @@ -16,22 +16,42 @@ */ #include "../include/Win_GParted.h" +#include "../include/Utils.h" #include #include int main( int argc, char *argv[] ) { + int installer_mode = false; + std::vector filesystem_override_opts; + //initialize thread system Glib::thread_init() ; - - Gtk::Main kit( argc, argv ) ; //i18n bindtextdomain( GETTEXT_PACKAGE, GNOMELOCALEDIR ) ; bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ) ; textdomain( GETTEXT_PACKAGE ) ; + Glib::OptionEntry installer_entry; + installer_entry.set_long_name( "installer" ); + installer_entry.set_description( "Run in installer mode" ); + installer_entry.set_arg_description( "WID" ); + Glib::OptionEntry filesystem_entry; + filesystem_entry.set_long_name( "filesystem" ); + filesystem_entry.set_description( "Override filesystem (installer mode only)" ); + filesystem_entry.set_arg_description( "PARTITION:FS" ); + + Glib::OptionGroup options( "", "" ); + options.add_entry( installer_entry, installer_mode ); + options.add_entry( filesystem_entry, filesystem_override_opts ); + + Glib::OptionContext context; + context.set_main_group( options ); + + Gtk::Main kit( argc, argv, context ) ; + //check UID if ( getuid() != 0 ) { @@ -46,14 +66,28 @@ exit( 0 ) ; } + std::vector::iterator iter; + std::map filesystem_overrides; + for ( std::vector::iterator iter = filesystem_override_opts .begin() ; + iter != filesystem_override_opts .end() ; ++iter ) + { + unsigned int index = iter ->find( ':' ); + if (index < iter ->length() ) + filesystem_overrides[iter ->substr( 0, index )] = + GParted::Utils::get_filesystem_by_name( iter ->substr( index + 1 ) ); + } + //deal with arguments.. std::vector user_devices ; for ( int t = 1 ; t < argc ; t++ ) user_devices .push_back( argv[ t ] ) ; - GParted::Win_GParted win_gparted( user_devices ) ; - Gtk::Main::run( win_gparted ) ; + GParted::Win_GParted win_gparted( user_devices, installer_mode, + filesystem_overrides ) ; + if ( !installer_mode ) + win_gparted .show( ) ; + Gtk::Main::run( ) ; return 0 ; } --- gparted-0.2.5.orig/src/xfs.cc +++ gparted-0.2.5/src/xfs.cc @@ -80,8 +80,9 @@ S = -1 ; //free blocks - output = output .substr( output .find( "fdblocks" ) ) ; - if ( sscanf( output .c_str(), "fdblocks = %Ld", &N ) != 1 ) + index = output .find( "fdblocks" ) ; + if ( index >= output .length() || + sscanf( output .substr( index ) .c_str(), "fdblocks = %Ld", &N ) != 1 ) N = -1 ; if ( N > -1 && S > -1 ) --- gparted-0.2.5.orig/debian/gparted.1 +++ gparted-0.2.5/debian/gparted.1 @@ -0,0 +1,25 @@ +.\"Created with GNOME Manpages Editor Wizard +.\"http://gmanedit.sourceforge.net +.\"Sergio Rua +.\" +.TH gparted 1 "February 28th, 2005" "gparted" + +.SH NAME +gparted \- GNOME frontend for parted + +.SH SYNOPSIS +.B gparted + +.SH DESCRIPTION +.B gparted +uses libparted to detect and manipulate devices and partition +tables while several (optional) filesystemtools provide +support for filesystems not included in libparted. + +.SH SEE ALSO +parted(8) + +.SH AUTHOR +David Moreno Garza wrote this manpage for +inclusion in the Debian Project, but may be used for others. + --- gparted-0.2.5.orig/debian/control +++ gparted-0.2.5/debian/control @@ -0,0 +1,17 @@ +Source: gparted +Section: gnome +Priority: optional +Maintainer: David Moreno Garza +Build-Depends: debhelper (>= 4.0.0), libxml-parser-perl, uuid-dev, parted, pkg-config, libgtkmm-2.4-dev, libparted1.7-dev +Standards-Version: 3.7.2 + +Package: gparted +Architecture: any +Depends: ${shlibs:Depends}, gksu +Description: GNOME partition editor + GParted uses libparted to detect and manipulate devices and partition + tables while several (optional) filesystem tools provide support for + filesystems not included in libparted. + . + Homepage: http://gparted.sourceforge.net + --- gparted-0.2.5.orig/debian/rules +++ gparted-0.2.5/debian/rules @@ -0,0 +1,63 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +export DH_VERBOSE=1 + +PACKAGE=gparted + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g -O3 + +config.status: configure + dh_testdir + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + +build: build-stamp patch + +build-stamp: config.status + dh_testdir + $(MAKE) + $(MAKE) check + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + -$(MAKE) distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install DESTDIR=$(CURDIR)/debian/gparted + + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install + dh_desktop + dh_installman debian/gparted.1 + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install patch unpatch + --- gparted-0.2.5.orig/debian/dirs +++ gparted-0.2.5/debian/dirs @@ -0,0 +1,2 @@ +usr/bin + --- gparted-0.2.5.orig/debian/changelog +++ gparted-0.2.5/debian/changelog @@ -0,0 +1,136 @@ +gparted (0.2.5-1.1ubuntu8) edgy; urgency=low + + * Really make sure to emit installer-mode FORMAT instructions for + filesystems set with the --filesystem option. + + -- Colin Watson Thu, 21 Sep 2006 01:39:14 +0100 + +gparted (0.2.5-1.1ubuntu7) edgy; urgency=low + + * Fix missing space in installer-mode FORMAT instructions. + + -- Colin Watson Wed, 20 Sep 2006 18:01:05 +0100 + +gparted (0.2.5-1.1ubuntu6) edgy; urgency=low + + * Add support for a --filesystem option which can be used in installer + mode (only) to allow the installer to override gparted's initial idea of + the filesystem in use on a partition. Filesystems created this way are + considered new, so they can be resized freely, etc. + + -- Colin Watson Wed, 20 Sep 2006 13:12:48 +0100 + +gparted (0.2.5-1.1ubuntu5) edgy; urgency=low + + * Patch from upstream CVS (Bart Hakvoort) to suppress probing of floppy + and CD devices, modified to avoid dm-*, loop*, and ram* as well (closes: + Malone #33252, Malone #59470): + - Parse /proc/partitions to find devices instead of using + ped_device_probe_all(). + This patch was later withdrawn upstream on the grounds that libparted is + going to be changed to avoid probing floppies and CDs, but this code is + not available yet and I'm reluctant to change libparted's interface in a + way that might turn out to be incompatible with upstream. + + -- Colin Watson Mon, 11 Sep 2006 13:21:49 +0100 + +gparted (0.2.5-1.1ubuntu4) edgy; urgency=low + + * src/Win_GParted.cc: In installer mode, set dialogs transient for the + top-level parent of the socket, not the plug itself (closes: Malone + #54474; see http://bugzilla.gnome.org/show_bug.cgi?id=335524). Thanks to + Evolution for the idea behind Win_GParted::set_transient_for_this et al. + + -- Colin Watson Wed, 30 Aug 2006 20:46:37 +0100 + +gparted (0.2.5-1.1ubuntu3) edgy; urgency=low + + * src/xfs.cc: Fix crash if xfs_db fails (closes: Malone #50909). + + -- Colin Watson Tue, 18 Jul 2006 14:19:00 +0100 + +gparted (0.2.5-1.1ubuntu2) edgy; urgency=low + + * src/main.cc: Fix --installer option processing. + * src/Win_GParted.cc: Don't display the menu bar in install mode. + * src/Win_GParted.cc: Fix stdin_event handler to return a bool. + * src/Win_GParted.cc: Call on_show on startup in installer mode to ensure + that devices are initialised. + * src/GParted_Core.cc, src/Utils.cc, src/Win_GParted.cc: Don't write + status information to stdout in installer mode; send exceptions to + stderr instead of stdout. + + -- Colin Watson Mon, 17 Jul 2006 16:39:13 +0100 + +gparted (0.2.5-1.1ubuntu1) edgy; urgency=low + + * Remove menu dependency and su-to-root launcher; use dh_desktop. + * Port patches from previous Ubuntu packaging (now in a monolithic diff + since the new packaging doesn't have a patch system): + - Default to ext3 rather than ext2 (Malone #40586). + - Installer mode: + + Originally based on + http://home.versanet.de/~d-elstner/gparted-installer.diff and work + by Guadalinex, creates --installer option to allow gparted to plug + into a socket created by ubiquity. + + Watch for lines of input on stdin, as follows: "apply" causes + gparted to ask the user to apply changes, returning a line on stdout + starting with 0 if confirmed or starting with a number other than 0 + if cancelled; "undo" causes gparted to undo changes. + + If stdin is closed, then close gparted. + + Instead of formatting, issue format instructions to stdout when + embedded. + + Hide the Apply toolbar button when embedded. + + Ensure the main window is not visible when embedded. + + Ensure the format-to menu is not visible when embedded. + + Make the toolbar use icons-beside-text mode when embedded, and mark + the new toolbutton as important (Malone #42723). + + Make all dialogs transient to the plug when embedded. + + Remove resize grip from statusbar when embedded. + + Disable reiser4 in installer mode, since partman doesn't support it + yet (Malone #32075). + - When applying, don't ask for confirmation if there are no operations + to apply. (Normally this won't happen because the Apply toolbar button + will be disabled, but it can happen in installer mode.) + - Move the menu item to System/Administration (MenusRevisited). + - Add X-KDE-SubstituteUID=true (Malone #34598). + - Use gksu to launch gparted. + - Set desktop entry name to "GNOME Partition Editor" rather than + "GParted". + * Previous Ubuntu safe-apply-operations and upstream-ntfsresize-fixes + patches obsoleted by new upstream. + * src/OperationResizeMove.cc abs->llabs tweak to allow this to compile. + May actually be a g++ bug; I'm not sure ... + + -- Colin Watson Wed, 12 Jul 2006 17:14:51 +0100 + +gparted (0.2.5-1.1) unstable; urgency=high + + * Non-maintainer upload. + * Rebuild against libparted1.7, since libparted1.6 has been removed. + (Closes: #372516) + + -- Steinar H. Gunderson Mon, 19 Jun 2006 18:42:44 +0200 + +gparted (0.2.5-1) unstable; urgency=low + + * New upstream release (Closes: #363249, #368085). + * Spelling mistake fixed on longdesc (Closes: #363618). + * Updated Standards-version. + + -- David Moreno Garza Sun, 21 May 2006 18:29:00 -0500 + +gparted (0.0.9-1) unstable; urgency=low + + * New upstream release. + * Rebuilding with current versions of glibmm and sigc++. + - Closes: #342051. + + -- David Moreno Garza Sun, 4 Dec 2005 18:52:56 -0600 + +gparted (0.0.8-1) unstable; urgency=low + + * Initial Release (Closes: #270352). + + -- David Moreno Garza Sat, 26 Feb 2005 19:12:46 -0600 + --- gparted-0.2.5.orig/debian/compat +++ gparted-0.2.5/debian/compat @@ -0,0 +1 @@ +4 --- gparted-0.2.5.orig/debian/menu +++ gparted-0.2.5/debian/menu @@ -0,0 +1,7 @@ +?package(gparted):\ + needs="X11"\ + section="Apps/System"\ + title="GNOME partition editor"\ + command="/usr/bin/gparted"\ + icon="/usr/share/pixmaps/gparted.xpm" + --- gparted-0.2.5.orig/debian/copyright +++ gparted-0.2.5/debian/copyright @@ -0,0 +1,16 @@ +This package was debianized by David Moreno Garza on +Sat, 26 Feb 2005 19:12:46 -0600. + +It was downloaded from http://gparted.sourceforge.net/ + +Copyright: + +Upstream Author: Bart Hakvoort + +License: + +You are free to distribute this software under the terms of the GNU +General Public License. On Debian systems, the complete text of the GNU +General Public License can be found in the file +`/usr/share/common-licenses/GPL'. + --- gparted-0.2.5.orig/debian/docs +++ gparted-0.2.5/debian/docs @@ -0,0 +1,2 @@ +README + --- gparted-0.2.5.orig/debian/gparted.xpm +++ gparted-0.2.5/debian/gparted.xpm @@ -0,0 +1,412 @@ +/* XPM */ +static char * gparted_xpm[] = { +"32 32 377 2", +" c None", +". c #424242", +"+ c #545454", +"@ c #535353", +"# c #525252", +"$ c #515151", +"% c #434343", +"& c #D9D9D9", +"* c #FDFDFD", +"= c #FCFCFC", +"- c #FBFBFB", +"; c #FAFAFA", +"> c #F9F9F9", +", c #F8F8F8", +"' c #F7F7F7", +") c #F6F6F6", +"! c #F5F5F5", +"~ c #F4F4F4", +"{ c #F3F3F3", +"] c #F2F2F2", +"^ c #E4E4E4", +"/ c #5A5A5A", +"( c #393939", +"_ c #EFEFEF", +": c #E6E6E6", +"< c #626262", +"[ c #A4A4A4", +"} c #EDEDED", +"| c #F1F1F1", +"1 c #F0F0F0", +"2 c #EEEEEE", +"3 c #EBEBEB", +"4 c #E9E9E9", +"5 c #E8E8E8", +"6 c #E7E7E7", +"7 c #E5E5E5", +"8 c #E3E3E3", +"9 c #E2E2E2", +"0 c #E1E1E1", +"a c #DFDFDF", +"b c #DDDDDD", +"c c #DCDCDC", +"d c #DADADA", +"e c #D7D7D7", +"f c #D6D6D6", +"g c #DEDEDE", +"h c #BABABA", +"i c #000000", +"j c #A3A3A3", +"k c #ECECEC", +"l c #E0E0E0", +"m c #D5D5D5", +"n c #D2D2D2", +"o c #D0D0D0", +"p c #CECECE", +"q c #CCCCCC", +"r c #C9C9C9", +"s c #C7C7C7", +"t c #C5C5C5", +"u c #C3C3C3", +"v c #CFCFCF", +"w c #BFBFBF", +"x c #DBDBDB", +"y c #D4D4D4", +"z c #D1D1D1", +"A c #CDCDCD", +"B c #CACACA", +"C c #C6C6C6", +"D c #BCBCBC", +"E c #B9B9B9", +"F c #B6B6B6", +"G c #B2B2B2", +"H c #AFAFAF", +"I c #ACACAC", +"J c #A9A9A9", +"K c #C1C1C1", +"L c #BEBEBE", +"M c #EAEAEA", +"N c #D8D8D8", +"O c #C8C8C8", +"P c #AAAAAA", +"Q c #D3D3D3", +"R c #C4C4C4", +"S c #959292", +"T c #9C8F8C", +"U c #997C76", +"V c #916B63", +"W c #8F6056", +"X c #88584E", +"Y c #87584E", +"Z c #855A52", +"` c #947069", +" . c #A38B85", +".. c #A69C99", +"+. c #969594", +"@. c #0C0C0C", +"#. c #B8B6B6", +"$. c #A38B86", +"%. c #B97466", +"&. c #BF6655", +"*. c #D96F5A", +"=. c #E2715B", +"-. c #E06D56", +";. c #DC6B55", +">. c #D86952", +",. c #D36750", +"'. c #CC634E", +"). c #BA5B48", +"!. c #A55747", +"~. c #975D50", +"{. c #3B241F", +"]. c #C5C4C4", +"^. c #8C7571", +"/. c #C87361", +"(. c #E4755E", +"_. c #E06C56", +":. c #DF6C56", +"<. c #DD6B54", +"[. c #DA6A53", +"}. c #D66851", +"|. c #D16650", +"1. c #CE654F", +"2. c #CA624E", +"3. c #C6604C", +"4. c #C25F4B", +"5. c #BF5D49", +"6. c #B75946", +"7. c #8C4739", +"8. c #CED0D1", +"9. c #A48279", +"0. c #D77965", +"a. c #E16E58", +"b. c #DF6C55", +"c. c #DC6B54", +"d. c #D96952", +"e. c #D56750", +"f. c #D1654F", +"g. c #CD634E", +"h. c #C9624D", +"i. c #C5604C", +"j. c #C25E4B", +"k. c #BE5C49", +"l. c #BA5A47", +"m. c #B65946", +"n. c #B35845", +"o. c #A45646", +"p. c #7A4C43", +"q. c #797979", +"r. c #7D7D7D", +"s. c #7C7C7C", +"t. c #818183", +"u. c #8E7069", +"v. c #E67E68", +"w. c #DA6953", +"x. c #D36650", +"y. c #CE644F", +"z. c #CB634E", +"A. c #C7614D", +"B. c #C4604C", +"C. c #BB5B48", +"D. c #B75A47", +"E. c #B45946", +"F. c #B05644", +"G. c #AD5543", +"H. c #A85342", +"I. c #AA5949", +"J. c #6A463D", +"K. c #4A3E3F", +"L. c #C77867", +"M. c #E16C56", +"N. c #DF6B55", +"O. c #DA6952", +"P. c #D56751", +"Q. c #D16550", +"R. c #CD644F", +"S. c #C9624E", +"T. c #C6614C", +"U. c #C25E4A", +"V. c #BE5D4A", +"W. c #AF5744", +"X. c #AB5443", +"Y. c #A75342", +"Z. c #A35140", +"`. c #A0513F", +" + c #95594C", +".+ c #6B4B41", +"++ c #E47E68", +"@+ c #DE6B54", +"#+ c #D76851", +"$+ c #D26650", +"%+ c #CF654F", +"&+ c #CB624D", +"*+ c #C7614C", +"=+ c #C35F4B", +"-+ c #C05D4A", +";+ c #B85946", +">+ c #B45846", +",+ c #B15845", +"'+ c #AC5543", +")+ c #A95342", +"!+ c #A55241", +"~+ c #A2513F", +"{+ c #9E4E3E", +"]+ c #9A4D3D", +"^+ c #A25C4D", +"/+ c #64443C", +"(+ c #67463D", +"_+ c #E37D67", +":+ c #D96A53", +"<+ c #CA624D", +"[+ c #BC604A", +"}+ c #88776E", +"|+ c #7B7170", +"1+ c #766E6D", +"2+ c #736B6B", +"3+ c #6F6968", +"4+ c #6C6665", +"5+ c #686362", +"6+ c #65615E", +"7+ c #615F5C", +"8+ c #5E5D5A", +"9+ c #6C6966", +"0+ c #5E5754", +"a+ c #614B43", +"b+ c #E3846D", +"c+ c #C7604D", +"d+ c #BC5C49", +"e+ c #B85A47", +"f+ c #C38854", +"g+ c #91BC8B", +"h+ c #3692AA", +"i+ c #2D8EA6", +"j+ c #2A89A1", +"k+ c #26849B", +"l+ c #248097", +"m+ c #1F7C90", +"n+ c #1C788C", +"o+ c #197387", +"p+ c #166F82", +"q+ c #327F8C", +"r+ c #355155", +"s+ c #64524E", +"t+ c #EB9B86", +"u+ c #D16750", +"v+ c #CF644F", +"w+ c #BF5C49", +"x+ c #B45B46", +"y+ c #CCAE5E", +"z+ c #C4D372", +"A+ c #539C98", +"B+ c #2B8AA2", +"C+ c #27869E", +"D+ c #217D92", +"E+ c #1D798D", +"F+ c #1A7588", +"G+ c #146E7F", +"H+ c #46848F", +"I+ c #223538", +"J+ c #534341", +"K+ c #E6AF9F", +"L+ c #DD7F6A", +"M+ c #C9634F", +"N+ c #C45F4B", +"O+ c #BC5B48", +"P+ c #B95A47", +"Q+ c #B56E4B", +"R+ c #D3C965", +"S+ c #D3D96A", +"T+ c #A0BD77", +"U+ c #2A869B", +"V+ c #248198", +"W+ c #207E92", +"X+ c #1D7B8E", +"Y+ c #1A7487", +"Z+ c #167083", +"`+ c #177080", +" @ c #3B8491", +".@ c #386269", +"+@ c #111F21", +"@@ c #514644", +"#@ c #B98A81", +"$@ c #E8A492", +"%@ c #D37662", +"&@ c #BE5D49", +"*@ c #AF5644", +"=@ c #BA8752", +"-@ c #D5D769", +";@ c #CFD469", +">@ c #C7CD66", +",@ c #519589", +"'@ c #217E93", +")@ c #1B7689", +"!@ c #156D7F", +"~@ c #3F8793", +"{@ c #44747C", +"]@ c #17353A", +"^@ c #6D5652", +"/@ c #BA887C", +"(@ c #E0A08F", +"_@ c #D27966", +":@ c #BC604D", +"<@ c #AE5644", +"[@ c #A65341", +"}@ c #C7B25E", +"|@ c #D1D568", +"1@ c #C9CF65", +"2@ c #C5CB63", +"3@ c #9AB26A", +"4@ c #328087", +"5@ c #1C7587", +"6@ c #317D8D", +"7@ c #4C8691", +"8@ c #376067", +"9@ c #1C4148", +"0@ c #0B1315", +"a@ c #4C3833", +"b@ c #9B6E64", +"c@ c #CF8E7E", +"d@ c #CA806F", +"e@ c #BB6754", +"f@ c #AC5645", +"g@ c #A75C43", +"h@ c #CECF66", +"i@ c #CDD166", +"j@ c #C6CC63", +"k@ c #C1C661", +"l@ c #B7BE60", +"m@ c #659678", +"n@ c #3A8896", +"o@ c #4D8B96", +"p@ c #437078", +"q@ c #2C535C", +"r@ c #193D44", +"s@ c #102023", +"t@ c #110B0B", +"u@ c #64453E", +"v@ c #9A675C", +"w@ c #B87969", +"x@ c #B47163", +"y@ c #A96253", +"z@ c #AE7F53", +"A@ c #C2C465", +"B@ c #C0C066", +"C@ c #BEBC67", +"D@ c #BBB96A", +"E@ c #B7B26C", +"F@ c #A09D67", +"G@ c #335D68", +"H@ c #214C57", +"I@ c #1B4149", +"J@ c #143036", +"K@ c #091011", +"L@ c #281B19", +"M@ c #543730", +"N@ c #7C4F45", +"O@ c #A76659", +"P@ c #A88256", +"Q@ c #A7AA55", +"R@ c #A1A353", +"S@ c #989950", +"T@ c #90914C", +"U@ c #868846", +"V@ c #7C7D44", +"W@ c #1F4751", +"X@ c #173137", +"Y@ c #0B1518", +"Z@ c #040707", +"`@ c #020000", +" # c #0F0907", +".# c #292216", +"+# c #53542C", +"@# c #59572E", +"## c #55542C", +"$# c #474825", +"%# c #3A3A1F", +"&# c #282816", +"*# c #020202", +" ", +" ", +" ", +" ", +" . + + + + @ @ @ @ @ # # # # $ $ $ $ % ", +" . & * = - - ; > > , , ' ) ! ! ~ ~ { ] ^ / ", +" ( _ * = = - - ; ; > > , , , ' ' ) ) ) ! ~ : < ", +" [ } | 1 2 } 3 4 5 6 7 8 9 0 a b c d & e f g h i ", +" j k k 4 6 7 8 l g c d e m n o p q r s t u v w i ", +" j k 3 x e y z A B C u w D E F G H I J K r v L i ", +" j k M c M 3 M 5 : ^ 8 l a b c & N f y l p q F i ", +" j 3 4 b 3 3 4 5 : ^ 9 l a b x & N f y a p O P i ", +" j 3 4 x c N f Q o A R S T U V W X Y Z ` ...+.@. ", +" j M 5 4 3 4 5 : ^ #.$.%.&.*.=.-.;.>.,.'.).!.~.{. ", +" j 4 6 ^ 9 l g ].^./.(._._.:.<.[.}.|.1.2.3.4.5.6.7. ", +"i j l a a g b 8.9.0.a._._.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p. ", +" q.r.s.s.s.t.u.v._._._.<.w.}.x.y.z.A.B.5.C.D.E.F.G.H.I.J. ", +" i i i K.L.M._.N.<.O.P.Q.R.S.T.U.V.l.6.n.W.X.Y.Z.`. + ", +" .+++:.@+[.#+$+%+&+*+=+-+C.;+>+,+'+)+!+~+{+]+^+/+ ", +" (+_+c.:+P.|.R.<+3.4.k.[+}+|+1+2+3+4+5+6+7+8+9+0+ ", +" a+b+#+x.%+'.c+B.5.d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+ ", +" s+t+u+v+2.T.U.w+C.e+x+y+z+A+B+C+l+D+E+F+p+G+H+I+ ", +" J+K+L+M+N+-+O+P+>+,+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@ ", +" @@#@$@%@&@C.D.E.*@G.=@-@;@>@,@'@X+)@Z+!@~@{@]@ ", +" ^@/@(@_@:@,+<@)+[@}@|@1@2@3@4@)@5@6@7@8@9@0@ ", +" a@b@c@d@e@f@!+g@h@i@j@k@l@m@n@o@p@q@r@s@i ", +" t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@ ", +" L@M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@ ", +" `@ #.#+#@###$#%#&#*# ", +" ", +" ", +" "}; --- gparted-0.2.5.orig/debian/gparted-launcher.sh +++ gparted-0.2.5/debian/gparted-launcher.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +/usr/bin/su-to-root -X -c gparted-bin 2>&1 +