Merge branch '2163_rotating_dash'
* 2163_rotating_dash: (find_rotate_dash): invert the boolean argument Ticket #2163: rotating dash is not removed when mc finishes reading the directory
Этот коммит содержится в:
Коммит
d38589cbca
@ -315,7 +315,7 @@ compare_files (const vfs_path_t * vpath1, const vfs_path_t * vpath2, off_t size)
|
|||||||
data2 = mmap (0, size, PROT_READ, MAP_FILE | MAP_PRIVATE, file2, 0);
|
data2 = mmap (0, size, PROT_READ, MAP_FILE | MAP_PRIVATE, file2, 0);
|
||||||
if (data2 != (char *) -1)
|
if (data2 != (char *) -1)
|
||||||
{
|
{
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
result = memcmp (data1, data2, size);
|
result = memcmp (data1, data2, size);
|
||||||
munmap (data2, size);
|
munmap (data2, size);
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ compare_files (const vfs_path_t * vpath1, const vfs_path_t * vpath2, off_t size)
|
|||||||
/* Don't have mmap() :( Even more ugly :) */
|
/* Don't have mmap() :( Even more ugly :) */
|
||||||
char buf1[BUFSIZ], buf2[BUFSIZ];
|
char buf1[BUFSIZ], buf2[BUFSIZ];
|
||||||
int n1, n2;
|
int n1, n2;
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
while ((n1 = read (file1, buf1, BUFSIZ)) == -1 && errno == EINTR);
|
while ((n1 = read (file1, buf1, BUFSIZ)) == -1 && errno == EINTR);
|
||||||
@ -338,6 +338,8 @@ compare_files (const vfs_path_t * vpath1, const vfs_path_t * vpath2, off_t size)
|
|||||||
}
|
}
|
||||||
close (file1);
|
close (file1);
|
||||||
}
|
}
|
||||||
|
rotate_dash (FALSE);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
|||||||
next_free++;
|
next_free++;
|
||||||
|
|
||||||
if ((next_free & 31) == 0)
|
if ((next_free & 31) == 0)
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_free != 0)
|
if (next_free != 0)
|
||||||
@ -613,6 +613,7 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
|||||||
ret:
|
ret:
|
||||||
mc_closedir (dirp);
|
mc_closedir (dirp);
|
||||||
tree_store_end_check ();
|
tree_store_end_check ();
|
||||||
|
rotate_dash (FALSE);
|
||||||
return next_free;
|
return next_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,8 +743,8 @@ do_reload_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, int cou
|
|||||||
list->list[next_free].sort_key = NULL;
|
list->list[next_free].sort_key = NULL;
|
||||||
list->list[next_free].second_sort_key = NULL;
|
list->list[next_free].second_sort_key = NULL;
|
||||||
next_free++;
|
next_free++;
|
||||||
if (!(next_free % 16))
|
if ((next_free % 16) == 0)
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
}
|
}
|
||||||
mc_closedir (dirp);
|
mc_closedir (dirp);
|
||||||
tree_store_end_check ();
|
tree_store_end_check ();
|
||||||
@ -753,6 +754,8 @@ do_reload_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, int cou
|
|||||||
do_sort (list, sort, next_free - 1, lc_reverse, lc_case_sensitive, exec_ff);
|
do_sort (list, sort, next_free - 1, lc_reverse, lc_case_sensitive, exec_ff);
|
||||||
}
|
}
|
||||||
clean_dir (&dir_copy, count);
|
clean_dir (&dir_copy, count);
|
||||||
|
rotate_dash (FALSE);
|
||||||
|
|
||||||
return next_free;
|
return next_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
#include "filenot.h"
|
#include "filenot.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "midnight.h" /* current_panel */
|
#include "midnight.h" /* current_panel */
|
||||||
|
#include "layout.h" /* rotate_dash() */
|
||||||
|
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
||||||
@ -828,7 +829,7 @@ copy_file_file_display_progress (FileOpTotalContext * tctx, FileOpContext * ctx,
|
|||||||
long dt;
|
long dt;
|
||||||
|
|
||||||
/* 1. Update rotating dash after some time */
|
/* 1. Update rotating dash after some time */
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
|
|
||||||
/* 3. Compute ETA */
|
/* 3. Compute ETA */
|
||||||
dt = (tv_current.tv_sec - tv_transfer_start.tv_sec);
|
dt = (tv_current.tv_sec - tv_transfer_start.tv_sec);
|
||||||
@ -1916,6 +1917,7 @@ copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx,
|
|||||||
dst_status = DEST_FULL; /* copy successful, don't remove target file */
|
dst_status = DEST_FULL; /* copy successful, don't remove target file */
|
||||||
|
|
||||||
ret:
|
ret:
|
||||||
|
rotate_dash (FALSE);
|
||||||
while (src_desc != -1 && mc_close (src_desc) < 0 && !ctx->skip_all)
|
while (src_desc != -1 && mc_close (src_desc) < 0 && !ctx->skip_all)
|
||||||
{
|
{
|
||||||
temp_status = file_error (_("Cannot close source file \"%s\"\n%s"), src_path);
|
temp_status = file_error (_("Cannot close source file \"%s\"\n%s"), src_path);
|
||||||
|
@ -1185,19 +1185,19 @@ find_ignore_dir_search (const char *dir)
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_rotate_dash (const WDialog * h, gboolean finish)
|
find_rotate_dash (const WDialog * h, gboolean show)
|
||||||
{
|
{
|
||||||
static const char rotating_dash[] = "|/-\\";
|
static const char rotating_dash[4] = "|/-\\";
|
||||||
static unsigned int pos = 0;
|
static size_t pos = 0;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
const Widget *w = WIDGET (h);
|
const Widget *w = WIDGET (h);
|
||||||
|
|
||||||
pos = (pos + 1) % 4;
|
|
||||||
tty_setcolor (h->color[DLG_COLOR_NORMAL]);
|
tty_setcolor (h->color[DLG_COLOR_NORMAL]);
|
||||||
widget_move (h, w->lines - 7, w->cols - 4);
|
widget_move (h, w->lines - 7, w->cols - 4);
|
||||||
tty_print_char (finish ? ' ' : rotating_dash[pos]);
|
tty_print_char (show ? rotating_dash[pos] : ' ');
|
||||||
|
pos = (pos + 1) % sizeof (rotating_dash);
|
||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1261,7 +1261,7 @@ do_search (WDialog * h)
|
|||||||
ignore_count), ignore_count);
|
ignore_count), ignore_count);
|
||||||
status_update (msg);
|
status_update (msg);
|
||||||
}
|
}
|
||||||
find_rotate_dash (h, TRUE);
|
find_rotate_dash (h, FALSE);
|
||||||
stop_idle (h);
|
stop_idle (h);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1357,7 +1357,7 @@ do_search (WDialog * h)
|
|||||||
;
|
;
|
||||||
} /* for */
|
} /* for */
|
||||||
|
|
||||||
find_rotate_dash (h, FALSE);
|
find_rotate_dash (h, TRUE);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1766,8 +1766,8 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs,
|
|||||||
list->list[next_free].second_sort_key = NULL;
|
list->list[next_free].second_sort_key = NULL;
|
||||||
next_free++;
|
next_free++;
|
||||||
g_free (name);
|
g_free (name);
|
||||||
if (!(next_free & 15))
|
if ((next_free & 15) == 0)
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_free)
|
if (next_free)
|
||||||
@ -1793,6 +1793,7 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs,
|
|||||||
do_search (NULL); /* force do_search to release resources */
|
do_search (NULL); /* force do_search to release resources */
|
||||||
g_free (old_dir);
|
g_free (old_dir);
|
||||||
old_dir = NULL;
|
old_dir = NULL;
|
||||||
|
rotate_dash (FALSE);
|
||||||
|
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
@ -879,21 +879,27 @@ set_hintbar (const char *str)
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void
|
void
|
||||||
rotate_dash (void)
|
rotate_dash (gboolean show)
|
||||||
{
|
{
|
||||||
static const char rotating_dash[] = "|/-\\";
|
static const char rotating_dash[4] = "|/-\\";
|
||||||
static size_t pos = 0;
|
static size_t pos = 0;
|
||||||
|
Widget *w = WIDGET (midnight_dlg);
|
||||||
|
|
||||||
if (!nice_rotating_dash || (ok_to_refresh <= 0))
|
if (!nice_rotating_dash || (ok_to_refresh <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (pos >= sizeof (rotating_dash) - 1)
|
widget_move (w, (menubar_visible != 0) ? 1 : 0, w->cols - 1);
|
||||||
pos = 0;
|
|
||||||
tty_gotoyx (0, COLS - 1);
|
|
||||||
tty_setcolor (NORMAL_COLOR);
|
tty_setcolor (NORMAL_COLOR);
|
||||||
tty_print_char (rotating_dash[pos]);
|
|
||||||
|
if (!show)
|
||||||
|
tty_print_alt_char (ACS_URCORNER, FALSE);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tty_print_char (rotating_dash[pos]);
|
||||||
|
pos = (pos + 1) % sizeof (rotating_dash);
|
||||||
|
}
|
||||||
|
|
||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
pos++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
@ -79,7 +79,7 @@ void set_hintbar (const char *str);
|
|||||||
|
|
||||||
/* Rotating dash routines */
|
/* Rotating dash routines */
|
||||||
void use_dash (gboolean flag); /* Disable/Enable rotate_dash routines */
|
void use_dash (gboolean flag); /* Disable/Enable rotate_dash routines */
|
||||||
void rotate_dash (void);
|
void rotate_dash (gboolean show);
|
||||||
|
|
||||||
#ifdef ENABLE_SUBSHELL
|
#ifdef ENABLE_SUBSHELL
|
||||||
gboolean do_load_prompt (void);
|
gboolean do_load_prompt (void);
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
#include "midnight.h" /* current_panel */
|
#include "midnight.h" /* current_panel */
|
||||||
|
#include "layout.h" /* rotate_dash() */
|
||||||
#include "panel.h" /* WPanel */
|
#include "panel.h" /* WPanel */
|
||||||
|
|
||||||
#include "panelize.h"
|
#include "panelize.h"
|
||||||
@ -366,8 +367,8 @@ do_external_panelize (char *command)
|
|||||||
list->list[next_free].sort_key = NULL;
|
list->list[next_free].sort_key = NULL;
|
||||||
list->list[next_free].second_sort_key = NULL;
|
list->list[next_free].second_sort_key = NULL;
|
||||||
next_free++;
|
next_free++;
|
||||||
if (!(next_free & 32))
|
if ((next_free & 32) == 0)
|
||||||
rotate_dash ();
|
rotate_dash (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
current_panel->is_panelized = TRUE;
|
current_panel->is_panelized = TRUE;
|
||||||
@ -395,6 +396,7 @@ do_external_panelize (char *command)
|
|||||||
close_error_pipe (D_NORMAL, NULL);
|
close_error_pipe (D_NORMAL, NULL);
|
||||||
try_to_select (current_panel, NULL);
|
try_to_select (current_panel, NULL);
|
||||||
panel_re_sort (current_panel);
|
panel_re_sort (current_panel);
|
||||||
|
rotate_dash (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user