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.
This commit is contained in:
parent
9e32399727
commit
f7722d2bbf
|
@ -1,3 +1,12 @@
|
|||
2006-07-19 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* 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 <hakvoort@cvs.gnome.org>
|
||||
|
||||
* enabled move support for all the filesystems. Also made some small
|
||||
|
|
|
@ -66,6 +66,7 @@ private:
|
|||
Glib::RefPtr<Gdk::Pixbuf> icon_execute ;
|
||||
Glib::RefPtr<Gdk::Pixbuf> icon_succes ;
|
||||
Glib::RefPtr<Gdk::Pixbuf> icon_error ;
|
||||
Glib::RefPtr<Gdk::Pixbuf> icon_n_a ;
|
||||
|
||||
Glib::RefPtr<Gtk::TreeStore> treestore_operations;
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ struct OperationDetails
|
|||
NONE = -1,
|
||||
EXECUTE = 0,
|
||||
SUCCES = 1,
|
||||
ERROR = 2
|
||||
ERROR = 2,
|
||||
N_A = 3
|
||||
};
|
||||
|
||||
OperationDetails()
|
||||
|
|
|
@ -61,6 +61,7 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & 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 );
|
||||
|
@ -139,6 +140,10 @@ void Dialog_Progress::update_operation_details( const Gtk::TreeRow & treerow,
|
|||
case OperationDetails::ERROR:
|
||||
treerow[ treeview_operations_columns .status_icon ] = icon_error ;
|
||||
|
||||
break ;
|
||||
case OperationDetails::N_A:
|
||||
treerow[ treeview_operations_columns .status_icon ] = icon_n_a ;
|
||||
|
||||
break ;
|
||||
|
||||
default :
|
||||
|
|
|
@ -1593,14 +1593,24 @@ 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<OperationDetails> & 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( "<i>" ) +
|
||||
_("growing is not available for this filesystem") +
|
||||
Glib::ustring( "</i>" ),
|
||||
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<Operat
|
|||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( get_fs( partition .filesystem ) .check == GParted::FS::NONE )
|
||||
{
|
||||
operation_details .back() .sub_details .push_back(
|
||||
OperationDetails(
|
||||
Glib::ustring( "<i>" ) +
|
||||
_("checking is not available for this filesystem") +
|
||||
Glib::ustring( "</i>" ),
|
||||
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 ) )
|
||||
|
|
Loading…
Reference in New Issue