Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING

Make the enumeration name match it's use as indicating a warning.  Also
spell SUCCESS correctly.  Follow on to icon variable names too.
This commit is contained in:
Mike Fleetwood 2017-11-25 16:55:28 +00:00 committed by Curtis Gedak
parent 0688662055
commit 8c5c13d613
6 changed files with 30 additions and 30 deletions

View File

@ -66,10 +66,10 @@ private:
Gtk::Button *cancelbutton;
Glib::RefPtr<Gdk::Pixbuf> icon_execute ;
Glib::RefPtr<Gdk::Pixbuf> icon_succes ;
Glib::RefPtr<Gdk::Pixbuf> icon_success;
Glib::RefPtr<Gdk::Pixbuf> icon_error ;
Glib::RefPtr<Gdk::Pixbuf> icon_info ;
Glib::RefPtr<Gdk::Pixbuf> icon_n_a ;
Glib::RefPtr<Gdk::Pixbuf> icon_warning;
Glib::RefPtr<Gtk::TreeStore> treestore_operations;

View File

@ -30,12 +30,12 @@ namespace GParted
{
enum OperationDetailStatus {
STATUS_NONE = 0,
STATUS_EXECUTE = 1,
STATUS_SUCCES = 2,
STATUS_ERROR = 3,
STATUS_INFO = 4,
STATUS_N_A = 5
STATUS_NONE = 0,
STATUS_EXECUTE = 1,
STATUS_SUCCESS = 2,
STATUS_ERROR = 3,
STATUS_INFO = 4,
STATUS_WARNING = 5
};
enum Font {

View File

@ -64,10 +64,10 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & operations )
//create some icons here, instead of recreating them every time
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_success = render_icon(Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_error = render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_info = render_icon(Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_n_a = render_icon(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_warning = 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);
@ -130,8 +130,8 @@ void Dialog_Progress::on_signal_update( const OperationDetail & operationdetail
case STATUS_EXECUTE:
treerow[ treeview_operations_columns .status_icon ] = icon_execute ;
break ;
case STATUS_SUCCES:
treerow[ treeview_operations_columns .status_icon ] = icon_succes ;
case STATUS_SUCCESS:
treerow[treeview_operations_columns.status_icon] = icon_success;
break ;
case STATUS_ERROR:
treerow[ treeview_operations_columns .status_icon ] = icon_error ;
@ -139,8 +139,8 @@ void Dialog_Progress::on_signal_update( const OperationDetail & operationdetail
case STATUS_INFO:
treerow[ treeview_operations_columns .status_icon ] = icon_info ;
break ;
case STATUS_N_A:
treerow[ treeview_operations_columns .status_icon ] = icon_n_a ;
case STATUS_WARNING:
treerow[treeview_operations_columns.status_icon] = icon_warning;
warnings++ ;
break ;
case STATUS_NONE:
@ -421,7 +421,7 @@ void Dialog_Progress::echo_operation_details( const OperationDetail & operationd
*/
_("EXECUTING") << " )" ;
break ;
case STATUS_SUCCES:
case STATUS_SUCCESS:
out << "( " <<
/* TO" TRANSLATORS: SUCCESS
* means that the status for this operation is
@ -446,14 +446,16 @@ void Dialog_Progress::echo_operation_details( const OperationDetail & operationd
*/
_("INFO") << " )" ;
break ;
case STATUS_N_A:
case STATUS_WARNING:
out << "( " <<
/* TO TRANSLATORS: N/A
/* TO TRANSLATORS: WARNING
* means that the status for this operation is
* not applicable because the operation is not
* supported on the file system in the partition.
* completed with warnings. Either the operation
* is not supported on the file system in the
* partition, or the operation failed but it does
* not matter that it failed.
*/
_("N/A") << " )" ;
_("WARNING") << " )" ;
break ;
default:

View File

@ -242,7 +242,7 @@ void FileSystem::rm_temp_dir( const Glib::ustring dir_name, OperationDetail & op
int e = errno ;
operationdetail .get_last_child() .add_child( OperationDetail(
String::ucompose( "rmdir(%1): ", dir_name ) + Glib::strerror( e ), STATUS_NONE ) ) ;
operationdetail.get_last_child().set_status( STATUS_N_A );
operationdetail.get_last_child().set_status( STATUS_WARNING );
}
else
{

View File

@ -2877,7 +2877,7 @@ bool GParted_Core::maximize_encryption( const Partition & partition, OperationDe
operationdetail.get_last_child().add_child( OperationDetail(
_("growing is not available for this encryption volume"),
STATUS_NONE, FONT_ITALIC ) );
operationdetail.get_last_child().set_status( STATUS_N_A );
operationdetail.get_last_child().set_status( STATUS_WARNING );
return true;
}
@ -2940,8 +2940,7 @@ bool GParted_Core::maximize_filesystem( const Partition & partition, OperationDe
OperationDetail( _("growing is not available for this file system"),
STATUS_NONE,
FONT_ITALIC ) ) ;
operationdetail .get_last_child() .set_status( STATUS_N_A ) ;
operationdetail.get_last_child().set_status( STATUS_WARNING );
return true ;
}
else if ( filesystem_resize_disallowed( partition ) )
@ -2955,7 +2954,7 @@ bool GParted_Core::maximize_filesystem( const Partition & partition, OperationDe
msg += custom_msg ;
}
operationdetail .get_last_child() .add_child( OperationDetail( msg, STATUS_NONE, FONT_ITALIC ) ) ;
operationdetail .get_last_child() .set_status( STATUS_N_A ) ;
operationdetail.get_last_child().set_status( STATUS_WARNING );
return true ;
}
@ -3365,8 +3364,7 @@ bool GParted_Core::check_repair_filesystem( const Partition & partition, Operati
OperationDetail( _("checking is not available for this file system"),
STATUS_NONE,
FONT_ITALIC ) ) ;
operationdetail .get_last_child() .set_status( STATUS_N_A ) ;
operationdetail.get_last_child().set_status( STATUS_WARNING );
return true ;
break ;

View File

@ -91,8 +91,8 @@ void OperationDetail::set_status( OperationDetailStatus status )
time_start = std::time( NULL ) ;
break ;
case STATUS_ERROR:
case STATUS_N_A:
case STATUS_SUCCES:
case STATUS_WARNING:
case STATUS_SUCCESS:
if( time_start != -1 )
time_elapsed = std::time( NULL ) - time_start ;
break ;
@ -108,7 +108,7 @@ void OperationDetail::set_status( OperationDetailStatus status )
void OperationDetail::set_success_and_capture_errors( bool success )
{
set_status( success ? STATUS_SUCCES : STATUS_ERROR );
set_status( success ? STATUS_SUCCESS : STATUS_ERROR );
signal_capture_errors.emit( *this, success );
no_more_children = true;
}