mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Small redesign of status dialog of directory size calculation.
src/smd.c (single_dirsize_cmd): create status dialog if needed not always. file.h: fixed typo. file.c (compute_dir_size_create_ui): changed title of dialog. (compute_dir_size_destroy_ui): formatting. (compute_dir_size_update_ui): simplified text of dialog.
This commit is contained in:
parent
49e72ec135
commit
b85f92c3fe
@ -1199,10 +1199,10 @@ single_dirsize_cmd (void)
|
||||
double total;
|
||||
ComputeDirSizeUI *ui;
|
||||
|
||||
ui = compute_dir_size_create_ui ();
|
||||
|
||||
entry = &(panel->dir.list[panel->selected]);
|
||||
if (S_ISDIR (entry->st.st_mode) && strcmp(entry->fname, "..") != 0) {
|
||||
ui = compute_dir_size_create_ui ();
|
||||
|
||||
total = 0.0;
|
||||
|
||||
if (compute_dir_size (entry->fname, ui, compute_dir_size_update_ui,
|
||||
|
13
src/file.c
13
src/file.c
@ -1489,7 +1489,7 @@ compute_dir_size_create_ui (void)
|
||||
ui = g_new (ComputeDirSizeUI, 1);
|
||||
|
||||
ui->dlg = create_dlg (0, 0, 8, COLS/2, dialog_colors, NULL,
|
||||
NULL, _("Directory size"), DLG_CENTER | DLG_TRYUP);
|
||||
NULL, _("Directory scanning"), DLG_CENTER);
|
||||
ui->dirname = label_new (3, 3, "");
|
||||
add_widget (ui->dlg, ui->dirname);
|
||||
|
||||
@ -1497,7 +1497,7 @@ compute_dir_size_create_ui (void)
|
||||
button_new (5, (ui->dlg->cols - strlen (b_name))/2,
|
||||
FILE_ABORT, NORMAL_BUTTON, b_name, NULL));
|
||||
|
||||
/* We will manage the dialog without any help,
|
||||
/* We will manage the dialog without any help,
|
||||
that's why we have to call init_dlg */
|
||||
init_dlg (ui->dlg);
|
||||
|
||||
@ -1508,10 +1508,10 @@ void
|
||||
compute_dir_size_destroy_ui (ComputeDirSizeUI *ui)
|
||||
{
|
||||
if (ui != NULL) {
|
||||
/* schedule to update passive panel */
|
||||
/* schedule to update passive panel */
|
||||
other_panel->dirty = 1;
|
||||
|
||||
/* close and destroy dialog */
|
||||
/* close and destroy dialog */
|
||||
dlg_run_done (ui->dlg);
|
||||
destroy_dlg (ui->dlg);
|
||||
g_free (ui);
|
||||
@ -1522,16 +1522,13 @@ FileProgressStatus
|
||||
compute_dir_size_update_ui (const void *ui, const char *dirname)
|
||||
{
|
||||
const ComputeDirSizeUI *this = (const ComputeDirSizeUI *) ui;
|
||||
char *msg;
|
||||
int c;
|
||||
Gpm_Event event;
|
||||
|
||||
if (ui == NULL)
|
||||
return FILE_CONT;
|
||||
|
||||
msg = g_strdup_printf (_("Scanning: %s"), dirname);
|
||||
label_set_text (this->dirname, name_trunc (msg, this->dlg->cols - 6));
|
||||
g_free (msg);
|
||||
label_set_text (this->dirname, name_trunc (dirname, this->dlg->cols - 6));
|
||||
|
||||
event.x = -1; /* Don't show the GPM cursor */
|
||||
c = get_event (&event, 0, 0);
|
||||
|
@ -39,7 +39,7 @@ FileProgressStatus compute_dir_size (const char *dirname, const void *ui,
|
||||
compute_dir_size_callback cback,
|
||||
off_t *ret_marked, double *ret_total);
|
||||
|
||||
/* status dialog of durectory size computing */
|
||||
/* status dialog of directory size computing */
|
||||
typedef struct {
|
||||
Dlg_head *dlg;
|
||||
WLabel *dirname;
|
||||
|
Loading…
Reference in New Issue
Block a user