Merge pull request 'fix deletion of dialog' (#68) from bugfix/segmentationfault into master
Reviewed-on: #68
This commit is contained in:
commit
6dd4c44688
@ -613,6 +613,7 @@ void TUI::vTruncateText(string *psText, uint16_t u16MaxLenght)
|
||||
void TUI::displaySelectedDrive(Drive drive, int stdscrX, int stdscrY)
|
||||
{
|
||||
struct MenuState menustate;
|
||||
static bool dialogIsActive;
|
||||
menustate.bAbort = false;
|
||||
menustate.bConfirmDelete = false;
|
||||
menustate.bConfirmShred = false;
|
||||
@ -659,15 +660,21 @@ void TUI::displaySelectedDrive(Drive drive, int stdscrX, int stdscrY)
|
||||
{
|
||||
dialog = createDialog(40, 10, ((stdscrX) - (int)(stdscrX / 3) - 7) - (int)((stdscrX / 3) + 5) / 2, (int)(stdscrY / 2) - 5, "Confirm SHRED", "Press ENTER for SHRED", "Press ESC for cancel");
|
||||
wrefresh(dialog);
|
||||
dialogIsActive = true;
|
||||
}
|
||||
else if (menustate.bConfirmDelete == true)
|
||||
{
|
||||
dialog = createDialog(40, 10, ((stdscrX) - (int)(stdscrX / 3) - 7) - (int)((stdscrX / 3) + 5) / 2, (int)(stdscrY / 2) - 5, "Confirm DELETE", "Press ENTER for DELETE", "Press ESC for cancel");
|
||||
wrefresh(dialog);
|
||||
dialogIsActive = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
delwin(dialog);
|
||||
if (dialogIsActive)
|
||||
{
|
||||
delwin(dialog);
|
||||
dialogIsActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user