summaryrefslogtreecommitdiffstats
path: root/src/intrface.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-01-09 23:44:10 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-01-09 23:44:10 +0100
commitc898c644fa53e718bc3f4c2567e58a7970aac8ed (patch)
tree3086e4634dbb9ff0c08f1107d1fbe68a10c93e21 /src/intrface.c
parent5b27cd61a621d3a654e8526b60e8a42134d118c5 (diff)
Fix log creation
Diffstat (limited to 'src/intrface.c')
-rw-r--r--src/intrface.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/intrface.c b/src/intrface.c
index 8fc4ff7..63082d9 100644
--- a/src/intrface.c
+++ b/src/intrface.c
@@ -1524,3 +1524,68 @@ int interface_superblock(disk_t *disk_car,list_part_t *list_part, char**current_
return 0;
}
+#ifdef HAVE_NCURSES
+int ask_testdisk_log_creation()
+{
+ unsigned int menu=0;
+ static struct MenuItem menuLogCreation[]=
+ {
+ {'C',"Create","Create a new log file"},
+ {'A',"Append","Append information to log file"},
+ {'Q',"No Log","Don't record anything"},
+ {0,NULL,NULL}
+ };
+ aff_copy(stdscr);
+ wmove(stdscr,5,0);
+ wprintw(stdscr,"TestDisk is a data recovery designed to help recover lost partitions");
+ wmove(stdscr,6,0);
+ wprintw(stdscr,"and/or make non-booting disks bootable again when these symptoms");
+ wmove(stdscr,7,0);
+ wprintw(stdscr,"are caused by faulty software, certain types of viruses or human error.");
+ wmove(stdscr,8,0);
+ wprintw(stdscr,"It can also be used to repair some filesystem errors.");
+ wmove(stdscr,10,0);
+ wprintw(stdscr,"Information gathered during TestDisk use can be recorded for later");
+ wmove(stdscr,11,0);
+ wprintw(stdscr,"review. If you choose to create the text file, ");
+ if(has_colors())
+ wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(0));
+ wprintw(stdscr,"testdisk.log");
+ if(has_colors())
+ wbkgdset(stdscr,' ' | COLOR_PAIR(0));
+ wprintw(stdscr," , it");
+ wmove(stdscr,12,0);
+ wprintw(stdscr,"will contain TestDisk options, technical information and various");
+ wmove(stdscr,13,0);
+ wprintw(stdscr,"outputs; including any folder/file names TestDisk was used to find and");
+ wmove(stdscr,14,0);
+ wprintw(stdscr,"list onscreen.");
+ wmove(stdscr,16,0);
+ wprintw(stdscr,"Use arrow keys to select, then press Enter key:");
+ while(1)
+ {
+ int command;
+ command = wmenuSelect_ext(stdscr,17, 0, menuLogCreation, 8,
+ "CAQ", MENU_VERT | MENU_VERT_WARN | MENU_BUTTON, &menu,NULL);
+ switch(command)
+ {
+ case 'C':
+ case 'c':
+ return TD_LOG_CREATE;
+ case 'A':
+ case 'a':
+ return TD_LOG_APPEND;
+ case 'Q':
+ case 'q':
+ return TD_LOG_REFUSED;
+ default:
+ break;
+ }
+ }
+}
+#else
+int ask_testdisk_log_creation()
+{
+ return TD_LOG_REFUSED;
+}
+#endif