testdisk and photorec: display disk serial number when selecting source

disk
This commit is contained in:
Christophe Grenier 2023-01-23 21:07:02 +01:00
parent 00f5cff7ca
commit 900207eb4e
2 changed files with 25 additions and 8 deletions

View file

@ -144,7 +144,16 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
use_sudo=1; use_sudo=1;
#endif #endif
} }
else
#endif #endif
if(current_disk != NULL && current_disk->disk->serial_no != NULL)
{
if(has_colors())
wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(2));
wprintw(stdscr, "Serial number %s", current_disk->disk->serial_no);
if(has_colors())
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
}
wmove(stdscr, INTER_NOTE_Y+1, 0); wmove(stdscr, INTER_NOTE_Y+1, 0);
wprintw(stdscr,"Disk capacity must be correctly detected for a successful recovery."); wprintw(stdscr,"Disk capacity must be correctly detected for a successful recovery.");
wmove(stdscr, INTER_NOTE_Y+2, 0); wmove(stdscr, INTER_NOTE_Y+2, 0);

View file

@ -114,8 +114,7 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
} }
} }
{ {
int line=INTER_NOTE_Y; mvwaddstr(stdscr, INTER_NOTE_Y, 0, "Note: ");
mvwaddstr(stdscr,line++,0,"Note: ");
#if defined(HAVE_GETEUID) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(DJGPP) #if defined(HAVE_GETEUID) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(DJGPP)
if(geteuid()!=0) if(geteuid()!=0)
{ {
@ -124,17 +123,26 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
waddstr(stdscr,"Some disks won't appear unless you are root user."); waddstr(stdscr,"Some disks won't appear unless you are root user.");
if(has_colors()) if(has_colors())
wbkgdset(stdscr,' ' | COLOR_PAIR(0)); wbkgdset(stdscr,' ' | COLOR_PAIR(0));
wmove(stdscr,line++,0);
#ifdef SUDO_BIN #ifdef SUDO_BIN
use_sudo=1; use_sudo=1;
#endif #endif
} }
else
#endif #endif
waddstr(stdscr,"Disk capacity must be correctly detected for a successful recovery."); if(current_disk != NULL && current_disk->disk->serial_no != NULL)
wmove(stdscr,line++,0); {
wprintw(stdscr,"If a disk listed above has an incorrect size, check HD jumper settings and BIOS"); if(has_colors())
wmove(stdscr,line,0); wbkgdset(stdscr,' ' | A_BOLD | COLOR_PAIR(2));
wprintw(stdscr,"detection, and install the latest OS patches and disk drivers."); wprintw(stdscr, "Serial number %s", current_disk->disk->serial_no);
if(has_colors())
wbkgdset(stdscr,' ' | COLOR_PAIR(0));
}
wmove(stdscr, INTER_NOTE_Y+1, 0);
waddstr(stdscr, "Disk capacity must be correctly detected for a successful recovery.");
wmove(stdscr, INTER_NOTE_Y+2, 0);
wprintw(stdscr, "If a disk listed above has an incorrect size, check HD jumper settings and BIOS");
wmove(stdscr, INTER_NOTE_Y+3, 0);
wprintw(stdscr, "detection, and install the latest OS patches and disk drivers.");
} }
#ifdef SUDO_BIN #ifdef SUDO_BIN
if(use_sudo > 0) if(use_sudo > 0)