diff --git a/src/filemanager/file.c b/src/filemanager/file.c index e433be029..0604f276f 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -1357,12 +1357,15 @@ erase_file (file_op_total_context_t * tctx, file_op_context_t * ctx, const vfs_p struct stat buf; FileProgressStatus return_status; - file_progress_show_deleting (ctx, vfs_path_as_str (vpath), &tctx->progress_count); - file_progress_show_count (ctx, tctx->progress_count, ctx->progress_count); - if (check_progress_buttons (ctx) == FILE_ABORT) - return FILE_ABORT; + /* check buttons if deleting info was changed */ + if (file_progress_show_deleting (ctx, vfs_path_as_str (vpath), &tctx->progress_count)) + { + file_progress_show_count (ctx, tctx->progress_count, ctx->progress_count); + if (check_progress_buttons (ctx) == FILE_ABORT) + return FILE_ABORT; - mc_refresh (); + mc_refresh (); + } if (tctx->progress_count != 0 && mc_lstat (vpath, &buf) != 0) { diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index 8ececc75f..5e3e41822 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -1160,31 +1160,44 @@ file_progress_show_target (file_op_context_t * ctx, const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ -void +gboolean file_progress_show_deleting (file_op_context_t * ctx, const char *s, size_t * count) { - file_op_context_ui_t *ui; + static guint64 timestamp = 0; + /* update with 25 FPS rate */ + static const guint64 delay = G_USEC_PER_SEC / 25; + + gboolean ret; if (ctx == NULL || ctx->ui == NULL) - return; + return FALSE; - ui = ctx->ui; + ret = mc_time_elapsed (×tamp, delay); - if (ui->src_file_label != NULL) - label_set_text (ui->src_file_label, _("Deleting")); + if (ret) + { + file_op_context_ui_t *ui; - label_set_text (ui->src_file, truncFileStringSecure (ui->op_dlg, s)); + ui = ctx->ui; + + if (ui->src_file_label != NULL) + label_set_text (ui->src_file_label, _("Deleting")); + + label_set_text (ui->src_file, truncFileStringSecure (ui->op_dlg, s)); + } if (count != NULL) (*count)++; + + return ret; } /* --------------------------------------------------------------------------------------------- */ FileProgressStatus file_progress_real_query_replace (file_op_context_t * ctx, enum OperationMode mode, - const char *src, struct stat *src_stat, - const char *dst, struct stat *dst_stat) + const char *src, struct stat * src_stat, + const char *dst, struct stat * dst_stat) { file_op_context_ui_t *ui; FileProgressStatus replace_with_zero; diff --git a/src/filemanager/filegui.h b/src/filemanager/filegui.h index f54d805cf..af541c2f4 100644 --- a/src/filemanager/filegui.h +++ b/src/filemanager/filegui.h @@ -36,7 +36,7 @@ void file_progress_show_total (file_op_total_context_t * tctx, file_op_context_t uintmax_t copied_bytes, gboolean show_summary); void file_progress_show_source (file_op_context_t * ctx, const vfs_path_t * vpath); void file_progress_show_target (file_op_context_t * ctx, const vfs_path_t * vpath); -void file_progress_show_deleting (file_op_context_t * ctx, const char *path, size_t * count); +gboolean file_progress_show_deleting (file_op_context_t * ctx, const char *path, size_t * count); /*** inline functions ****************************************************************************/ #endif /* MC__FILEGUI_H */