diff --git a/src/dir.h b/src/dir.h index 0ef7875bf5e856a87f4037dda42923ea04447dfc..c9473f192ed540e232c084531232e5cbc4422ee6 100644 --- a/src/dir.h +++ b/src/dir.h @@ -109,6 +109,7 @@ extern int dir_scan_smfs; void dir_scan_init(const char *path); /* Importing a file */ +extern int dir_import_active; int dir_import_init(const char *fn); diff --git a/src/dir_common.c b/src/dir_common.c index c338c773a206f935c1d74328cce63536da76604e..1ef2308edbb42b3eaf1766f357c37120e007ccaa 100644 --- a/src/dir_common.c +++ b/src/dir_common.c @@ -120,13 +120,15 @@ struct dir *dir_createstruct(const char *name) { static void draw_progress() { - static const char antext[] = "Scanning..."; + static const char scantext[] = "Scanning..."; + static const char loadtext[] = "Loading..."; static size_t anpos = 0; - char ani[20] = {}; + const char *antext = dir_import_active ? loadtext : scantext; + char ani[16] = {}; size_t i; int width = wincols-5; - nccreate(10, width, "Scanning..."); + nccreate(10, width, antext); ncprint(2, 2, "Total items: %-8d", dir_output.items); if(dir_output.size) diff --git a/src/dir_import.c b/src/dir_import.c index 334ec2894f17ae16caef1bed713c1ecdf2f56313..a7e93d5435b3732e2e39d1416cc9add7db686bad 100644 --- a/src/dir_import.c +++ b/src/dir_import.c @@ -61,6 +61,9 @@ #define MAX_LEVEL 100 +int dir_import_active = 0; + + /* Use a struct for easy batch-allocation and deallocation of state data. */ struct ctx { FILE *stream; @@ -594,6 +597,7 @@ int dir_import_init(const char *fn) { dir_curpath_set(fn); dir_process = process; + dir_import_active = 1; return 0; } diff --git a/src/util.c b/src/util.c index b93189850284b1774a10a1ad4419aca9053735a1..480e91b3baeb4757c2e02cd3919470684c70db5b 100644 --- a/src/util.c +++ b/src/util.c @@ -121,7 +121,7 @@ int ncresize(int minrows, int mincols) { } -void nccreate(int height, int width, char *title) { +void nccreate(int height, int width, const char *title) { int i; subwinr = winrows/2-height/2; diff --git a/src/util.h b/src/util.h index 1213f98ad4e2647991cf74b14b12d1b38eef07e9..8b1b959a3cb30175dc1bea2c4d17a2c1148cfbf0 100644 --- a/src/util.h +++ b/src/util.h @@ -52,7 +52,7 @@ extern int subwinr, subwinc; int ncresize(int, int); /* creates a new centered window with border */ -void nccreate(int, int, char *); +void nccreate(int, int, const char *); /* printf something somewhere in the last created window */ void ncprint(int, int, char *, ...);