diff --git a/ChangeLog b/ChangeLog index 3ea81878..834b053c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-27 Bart Hakvoort + + * include/TreeView_Detail.h, + src/TreeView_Detail.cc: made icon behaviour more intelligent + * src/GParted_Core.cc: small improvement in open_device_and_disk() + 2006-03-26 Bart Hakvoort * src/GParted_Core.cc: made some small adjustments to devicechecks. diff --git a/include/TreeView_Detail.h b/include/TreeView_Detail.h index b652b864..d5719a9e 100644 --- a/include/TreeView_Detail.h +++ b/include/TreeView_Detail.h @@ -70,11 +70,11 @@ private: Gtk::TreeModelColumn size; Gtk::TreeModelColumn used; Gtk::TreeModelColumn unused; - Gtk::TreeModelColumn< Glib::RefPtr > color; + Gtk::TreeModelColumn< Glib::RefPtr > color ; Gtk::TreeModelColumn text_color; Gtk::TreeModelColumn mount_text_color; - Gtk::TreeModelColumn< Glib::RefPtr > status_icon; - Gtk::TreeModelColumn< Glib::RefPtr > error_icon; + Gtk::TreeModelColumn< Glib::RefPtr > icon1 ; + Gtk::TreeModelColumn< Glib::RefPtr > icon2 ; Gtk::TreeModelColumn flags; Gtk::TreeModelColumn partition; //hidden column @@ -82,8 +82,8 @@ private: { add( path ); add( filesystem ); add( mountpoint ) ; add( size ); add( used ); add( unused ); add( color ); - add( text_color ); add( mount_text_color ); add( status_icon ); - add( error_icon ) ; add( flags ); add( partition ); + add( text_color ); add( mount_text_color ); add( icon1 ); + add( icon2 ) ; add( flags ); add( partition ); } }; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 392b4016..b80c28d7 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1202,20 +1202,22 @@ bool GParted_Core::open_device( const Glib::ustring & device_path ) bool GParted_Core::open_device_and_disk( const Glib::ustring & device_path, bool strict ) { + lp_device = NULL ; + lp_disk = NULL ; + if ( open_device( device_path ) ) + { lp_disk = ped_disk_new( lp_device ); - //if ! disk and writeable it's probably a HD without disklabel. - //We return true here and deal with them in GParted_Core::get_devices - if ( ! lp_disk && ( strict || lp_device ->read_only ) ) - { - ped_device_destroy( lp_device ) ; - lp_device = NULL ; + //if ! disk and writeable it's probably a HD without disklabel. + //We return true here and deal with them in GParted_Core::get_devices + if ( lp_disk || ( ! strict && ! lp_device ->read_only ) ) + return true ; - return false; - } - - return true ; + close_device_and_disk() ; + } + + return false ; } void GParted_Core::close_device_and_disk() diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index 99188428..bfa54353 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -40,8 +40,8 @@ TreeView_Detail::TreeView_Detail() append_column( _("Flags"), treeview_detail_columns .flags ); //icons - get_column( 0 ) ->pack_start( treeview_detail_columns .error_icon, false ); - get_column( 0 ) ->pack_start( treeview_detail_columns .status_icon, false ); + get_column( 0 ) ->pack_start( treeview_detail_columns .icon2, false ); + get_column( 0 ) ->pack_start( treeview_detail_columns .icon1, false ); //PARTITION //colored text in Partition column @@ -149,13 +149,19 @@ bool TreeView_Detail::set_selected( Gtk::TreeModel::Children rows, const Partiti void TreeView_Detail::create_row( const Gtk::TreeRow & treerow, const Partition & partition ) { if ( partition .busy ) - treerow[ treeview_detail_columns .status_icon ] = + treerow[ treeview_detail_columns .icon1 ] = render_icon( Gtk::Stock::DIALOG_AUTHENTICATION, Gtk::ICON_SIZE_BUTTON ); - //FIXME: we should display warningicon in the same column as mounticon if partition is unmounted.. if ( ! partition .error .empty() ) - treerow[ treeview_detail_columns .error_icon ] = - render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ); + { + if ( ! static_cast< Glib::RefPtr >( treerow[ treeview_detail_columns .icon1 ] ) ) + treerow[ treeview_detail_columns .icon1 ] = + render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ); + else + treerow[ treeview_detail_columns .icon2 ] = + render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ); + } + treerow[ treeview_detail_columns .path ] = partition .get_path() ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index e2056f9c..ceda72b9 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -1315,8 +1315,6 @@ void Win_GParted::activate_delete() /* if deleted one is NEW, it doesn't make sense to add it to the operationslist, * we erase its creation and possible modifications like resize etc.. from the operationslist. * Calling Refresh_Visual will wipe every memory of its existence ;-)*/ - //FIXME: afaik all allowed operation on STAT_NEW will replace the new partition - //therefore it's impossible to have >1 operations on a STAT_NEW and contains this check unnecessary overkill if ( selected_partition .status == GParted::STAT_NEW ) { //remove all operations done on this new partition (this includes creation)