Display "Loading..." instead of "Scanning..." when importing a file
Этот коммит содержится в:
родитель
c298e32942
Коммит
7d2cb84e70
@ -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);
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 *, ...);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user