Documented the refresh feature and made some improvements in the help window
git-svn-id: svn://blicky.net/ncdu/trunk@17 ce56bc8d-f834-0410-b703-f827bd498a76
Этот коммит содержится в:
родитель
b2b43689f0
Коммит
4859bc8810
@ -120,6 +120,10 @@ that the totals shown at the bottom of the screen are not correct, make
|
|||||||
sure you haven't enabled this option.
|
sure you haven't enabled this option.
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
|
r
|
||||||
|
Refresh/recalculate the current directory.
|
||||||
|
.TP
|
||||||
|
.B
|
||||||
q
|
q
|
||||||
Quit
|
Quit
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
|
114
src/help.c
114
src/help.c
@ -36,71 +36,71 @@ void drawHelp(int page) {
|
|||||||
wattroff(hlp, A_BOLD);
|
wattroff(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 13, 32, "Press any key to continue");
|
mvwaddstr(hlp, 13, 32, "Press any key to continue");
|
||||||
|
|
||||||
|
if(page == 1)
|
||||||
|
wattron(hlp, A_REVERSE);
|
||||||
|
mvwaddstr(hlp, 0, 30, "1:Keys");
|
||||||
|
wattroff(hlp, A_REVERSE);
|
||||||
|
if(page == 2)
|
||||||
|
wattron(hlp, A_REVERSE);
|
||||||
|
mvwaddstr(hlp, 0, 39, "2:Format");
|
||||||
|
wattroff(hlp, A_REVERSE);
|
||||||
|
if(page == 3)
|
||||||
|
wattron(hlp, A_REVERSE);
|
||||||
|
mvwaddstr(hlp, 0, 50, "3:About");
|
||||||
|
wattroff(hlp, A_REVERSE);
|
||||||
|
|
||||||
switch(page) {
|
switch(page) {
|
||||||
case 1:
|
case 1:
|
||||||
wattron(hlp, A_BOLD);
|
wattron(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 1, 30, "1:Keys");
|
mvwaddstr(hlp, 2, 7, "up/down");
|
||||||
wattroff(hlp, A_BOLD);
|
mvwaddstr(hlp, 3, 3, "right/enter");
|
||||||
mvwaddstr(hlp, 1, 39, "2:Format");
|
mvwaddstr(hlp, 4, 10, "left");
|
||||||
mvwaddstr(hlp, 1, 50, "3:About");
|
mvwaddstr(hlp, 5, 11, "n/s");
|
||||||
wattron(hlp, A_BOLD);
|
mvwaddch( hlp, 6, 13, 'd');
|
||||||
mvwaddstr(hlp, 3, 7, "up/down");
|
mvwaddch( hlp, 7, 13, 't');
|
||||||
mvwaddstr(hlp, 4, 3, "right/enter");
|
mvwaddch( hlp, 8, 13, 'g');
|
||||||
mvwaddstr(hlp, 5, 10, "left");
|
mvwaddch( hlp, 9, 13, 'p');
|
||||||
mvwaddstr(hlp, 6, 11, "n/s");
|
mvwaddch( hlp,10, 13, 'h');
|
||||||
mvwaddch( hlp, 7, 13, 'd');
|
mvwaddch( hlp,11, 13, 'r');
|
||||||
mvwaddch( hlp, 8, 13, 't');
|
|
||||||
mvwaddch( hlp, 9, 13, 'g');
|
|
||||||
mvwaddch( hlp,10, 13, 'p');
|
|
||||||
mvwaddch( hlp,11, 13, 'h');
|
|
||||||
mvwaddch( hlp,12, 13, 'q');
|
mvwaddch( hlp,12, 13, 'q');
|
||||||
wattroff(hlp, A_BOLD);
|
wattroff(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 3, 16, "Cycle through the items");
|
mvwaddstr(hlp, 2, 16, "Cycle through the items");
|
||||||
mvwaddstr(hlp, 4, 16, "Open directory");
|
mvwaddstr(hlp, 3, 16, "Open directory");
|
||||||
mvwaddstr(hlp, 5, 16, "Previous directory");
|
mvwaddstr(hlp, 4, 16, "Previous directory");
|
||||||
mvwaddstr(hlp, 6, 16, "Sort by name or size (asc/desc)");
|
mvwaddstr(hlp, 5, 16, "Sort by name or size (asc/desc)");
|
||||||
mvwaddstr(hlp, 7, 16, "Delete selected file or directory");
|
mvwaddstr(hlp, 6, 16, "Delete selected file or directory");
|
||||||
mvwaddstr(hlp, 8, 16, "Toggle dirs before files when sorting");
|
mvwaddstr(hlp, 7, 16, "Toggle dirs before files when sorting");
|
||||||
mvwaddstr(hlp, 9, 16, "Show percentage and/or graph");
|
mvwaddstr(hlp, 8, 16, "Show percentage and/or graph");
|
||||||
mvwaddstr(hlp,10, 16, "Toggle between powers of 1000 and 1024");
|
mvwaddstr(hlp, 9, 16, "Toggle between powers of 1000 and 1024");
|
||||||
mvwaddstr(hlp,11, 16, "Show/hide hidden or excluded files");
|
mvwaddstr(hlp,10, 16, "Show/hide hidden or excluded files");
|
||||||
|
mvwaddstr(hlp,11, 16, "Recalculate the current directory");
|
||||||
mvwaddstr(hlp,12, 16, "Quit ncdu");
|
mvwaddstr(hlp,12, 16, "Quit ncdu");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
mvwaddstr(hlp, 1, 30, "1:Keys");
|
|
||||||
wattron(hlp, A_BOLD);
|
wattron(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 1, 39, "2:Format");
|
mvwaddstr(hlp, 2, 3, "X [size] [graph] [file or directory]");
|
||||||
wattroff(hlp, A_BOLD);
|
wattroff(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 1, 50, "3:About");
|
mvwaddstr(hlp, 3, 4, "The X is only present in the following cases:");
|
||||||
wattron(hlp, A_BOLD);
|
wattron(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 3, 3, "X [size] [file or directory]");
|
mvwaddch(hlp, 5, 4, '!');
|
||||||
wattroff(hlp, A_BOLD);
|
mvwaddch(hlp, 6, 4, '.');
|
||||||
mvwaddstr(hlp, 5, 4, "The X is only present in the following cases:");
|
mvwaddch(hlp, 7, 4, '<');
|
||||||
wattron(hlp, A_BOLD);
|
|
||||||
mvwaddch(hlp, 6, 4, '!');
|
|
||||||
mvwaddch(hlp, 7, 4, '.');
|
|
||||||
mvwaddch(hlp, 8, 4, '>');
|
mvwaddch(hlp, 8, 4, '>');
|
||||||
mvwaddch(hlp, 9, 4, '<');
|
mvwaddch(hlp, 9, 4, '@');
|
||||||
mvwaddch(hlp,10, 4, '@');
|
mvwaddch(hlp,10, 4, 'e');
|
||||||
mvwaddch(hlp,11, 4, 'e');
|
|
||||||
wattroff(hlp, A_BOLD);
|
wattroff(hlp, A_BOLD);
|
||||||
mvwaddstr(hlp, 6, 7, "An error occured while reading this directory");
|
mvwaddstr(hlp, 5, 7, "An error occured while reading this directory");
|
||||||
mvwaddstr(hlp, 7, 7, "An error occured while reading a subdirectory");
|
mvwaddstr(hlp, 6, 7, "An error occured while reading a subdirectory");
|
||||||
mvwaddstr(hlp, 8, 7, "File or directory is excluded from the statistics");
|
mvwaddstr(hlp, 7, 7, "File or directory is excluded from the statistics");
|
||||||
mvwaddstr(hlp, 9, 7, "Directory was on an other filesystem");
|
mvwaddstr(hlp, 8, 7, "Directory was on an other filesystem");
|
||||||
mvwaddstr(hlp,10, 7, "This is not a file nor a dir (symlink, socket, ...)");
|
mvwaddstr(hlp, 9, 7, "This is not a file nor a dir (symlink, socket, ...)");
|
||||||
mvwaddstr(hlp,11, 7, "Empty directory");
|
mvwaddstr(hlp,10, 7, "Empty directory");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
/* Indeed, too much spare time */
|
/* Indeed, too much spare time */
|
||||||
mvwaddstr(hlp, 1, 30, "1:Keys");
|
|
||||||
mvwaddstr(hlp, 1, 39, "2:Format");
|
|
||||||
wattron(hlp, A_BOLD);
|
|
||||||
mvwaddstr(hlp, 1, 50, "3:About");
|
|
||||||
wattroff(hlp, A_BOLD);
|
|
||||||
wattron(hlp, A_REVERSE);
|
wattron(hlp, A_REVERSE);
|
||||||
#define x 12
|
#define x 12
|
||||||
#define y 4
|
#define y 3
|
||||||
/* N */
|
/* N */
|
||||||
mvwaddstr(hlp, y+0, x+0, " ");
|
mvwaddstr(hlp, y+0, x+0, " ");
|
||||||
mvwaddstr(hlp, y+1, x+0, " ");
|
mvwaddstr(hlp, y+1, x+0, " ");
|
||||||
@ -139,14 +139,9 @@ void drawHelp(int page) {
|
|||||||
mvwaddstr(hlp, y+1, x+30, "Disk");
|
mvwaddstr(hlp, y+1, x+30, "Disk");
|
||||||
mvwaddstr(hlp, y+2, x+30, "Usage");
|
mvwaddstr(hlp, y+2, x+30, "Usage");
|
||||||
mvwprintw(hlp, y+4, x+30, "%s", PACKAGE_VERSION);
|
mvwprintw(hlp, y+4, x+30, "%s", PACKAGE_VERSION);
|
||||||
mvwaddstr(hlp,10, 7, "Written by Yoran Heling <projects@yorhel.nl>");
|
mvwaddstr(hlp, 9, 7, "Written by Yoran Heling <projects@yorhel.nl>");
|
||||||
mvwaddstr(hlp,11, 16, "http://dev.yorhel.nl/ncdu/");
|
mvwaddstr(hlp,10, 16, "http://dev.yorhel.nl/ncdu/");
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
mvwaddstr(hlp, 1, 30, "1:Keys");
|
|
||||||
mvwaddstr(hlp, 1, 39, "2:Format");
|
|
||||||
mvwaddstr(hlp, 1, 50, "3:About");
|
|
||||||
mvwaddstr(hlp, 3, 3, "There is no fourth window, baka~~");
|
|
||||||
}
|
}
|
||||||
wrefresh(hlp);
|
wrefresh(hlp);
|
||||||
delwin(hlp); /* no need to use it anymore - free it */
|
delwin(hlp); /* no need to use it anymore - free it */
|
||||||
@ -159,6 +154,8 @@ void showHelp(void) {
|
|||||||
drawHelp(p);
|
drawHelp(p);
|
||||||
while((ch = getch())) {
|
while((ch = getch())) {
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
|
case ERR:
|
||||||
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
p = 1;
|
p = 1;
|
||||||
break;
|
break;
|
||||||
@ -168,14 +165,13 @@ void showHelp(void) {
|
|||||||
case '3':
|
case '3':
|
||||||
p = 3;
|
p = 3;
|
||||||
break;
|
break;
|
||||||
case '4':
|
|
||||||
p = 4;
|
|
||||||
break;
|
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
if(++p > 4)
|
case KEY_NPAGE:
|
||||||
p = 4;
|
if(++p > 3)
|
||||||
|
p = 3;
|
||||||
break;
|
break;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
case KEY_PPAGE:
|
||||||
if(--p < 1)
|
if(--p < 1)
|
||||||
p = 1;
|
p = 1;
|
||||||
break;
|
break;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user