From f7722d2bbf3eba0d67e9d1cf9d3060991e69be6b Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Wed, 19 Jul 2006 20:54:08 +0000 Subject: [PATCH] show warning in progressfeedback if a certain action is n/a. Of course we * include/Dialog_Progress.h, include/Operation.h, src/Dialog_Progress.cc, src/GParted_Core.cc: show warning in progressfeedback if a certain action is n/a. Of course we only allow these actions if the results are non-lethal. --- ChangeLog | 9 +++++++++ include/Dialog_Progress.h | 1 + include/Operation.h | 3 ++- src/Dialog_Progress.cc | 7 ++++++- src/GParted_Core.cc | 29 ++++++++++++++++++++++++++--- 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb8d137d..d45b19d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-07-19 Bart Hakvoort + + * include/Dialog_Progress.h, + include/Operation.h, + src/Dialog_Progress.cc, + src/GParted_Core.cc: show warning in progressfeedback if a certain + action is n/a. Of course we only allow these actions if the results + are non-lethal. + 2006-07-19 Bart Hakvoort * enabled move support for all the filesystems. Also made some small diff --git a/include/Dialog_Progress.h b/include/Dialog_Progress.h index c5ff0936..3afeb8ce 100644 --- a/include/Dialog_Progress.h +++ b/include/Dialog_Progress.h @@ -66,6 +66,7 @@ private: Glib::RefPtr icon_execute ; Glib::RefPtr icon_succes ; Glib::RefPtr icon_error ; + Glib::RefPtr icon_n_a ; Glib::RefPtr treestore_operations; diff --git a/include/Operation.h b/include/Operation.h index 0bc5cae2..5050e7fd 100644 --- a/include/Operation.h +++ b/include/Operation.h @@ -37,7 +37,8 @@ struct OperationDetails NONE = -1, EXECUTE = 0, SUCCES = 1, - ERROR = 2 + ERROR = 2, + N_A = 3 }; OperationDetails() diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index 67bf6a14..a283c8a4 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -61,6 +61,7 @@ Dialog_Progress::Dialog_Progress( const std::vector & operations ) icon_execute = render_icon( Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_succes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_error = render_icon( Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; + icon_n_a = render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; treestore_operations = Gtk::TreeStore::create( treeview_operations_columns ); treeview_operations .set_model( treestore_operations ); @@ -140,7 +141,11 @@ void Dialog_Progress::update_operation_details( const Gtk::TreeRow & treerow, treerow[ treeview_operations_columns .status_icon ] = icon_error ; break ; - + case OperationDetails::N_A: + treerow[ treeview_operations_columns .status_icon ] = icon_n_a ; + + break ; + default : treerow[ treeview_operations_columns .hidden_status ] = OperationDetails::NONE ; break ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 837e7948..fe1bf840 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1593,13 +1593,23 @@ bool GParted_Core::resize_filesystem( const Partition & partition_old, } } -//FIXME: perform checks in maximize_filesystem(), resize_filesystem() and check_repair() to see if -//the specified action is supported. if not, return true, but set status of operation to NOT_AVAILABLE -//(or maybe we should simply skip the entire suboperation?) maybe only maximize and check_repair are relevant.. bool GParted_Core::maximize_filesystem( const Partition & partition, std::vector & operation_details ) { operation_details .push_back( OperationDetails( _("grow filesystem to fill the partition") ) ) ; + + if ( get_fs( partition .filesystem ) .grow == GParted::FS::NONE ) + { + operation_details .back() .sub_details .push_back( + OperationDetails( + Glib::ustring( "" ) + + _("growing is not available for this filesystem") + + Glib::ustring( "" ), + OperationDetails::NONE ) ) ; + + operation_details .back() .status = OperationDetails::N_A ; + return true ; + } return resize_filesystem( partition, partition, operation_details, 0, true ) ; } @@ -1946,6 +1956,19 @@ bool GParted_Core::check_repair( const Partition & partition, std::vector" ) + + _("checking is not available for this filesystem") + + Glib::ustring( "" ), + OperationDetails::NONE ) ) ; + + operation_details .back() .status = OperationDetails::N_A ; + return true ; + } + set_proper_filesystem( partition .filesystem ) ; if ( p_filesystem && p_filesystem ->Check_Repair( partition, operation_details .back() .sub_details ) )