forked from localhorst/reHDD
Restore terminal state on termination
This commit is contained in:
@ -51,6 +51,8 @@ public:
|
||||
|
||||
static enum UserInput readUserInput();
|
||||
|
||||
static void terminateTUI();
|
||||
|
||||
private:
|
||||
static string sCpuUsage;
|
||||
static string sRamUsage;
|
||||
@ -80,4 +82,4 @@ private:
|
||||
string formatSpeed(time_t u32ShredTimeDelta, unsigned long ulWrittenBytes);
|
||||
static void vTruncateText(string *psText, uint16_t u16MaxLenght);
|
||||
};
|
||||
#endif // TUI_H_
|
||||
#endif // TUI_H_
|
||||
|
@ -198,9 +198,10 @@ void reHDD::ThreadUserInput()
|
||||
ui->updateTUI(&listDrives, u8SelectedEntry);
|
||||
break;
|
||||
case TUI::UserInput::Terminate:
|
||||
cout << "Terminate" << endl;
|
||||
// cout << "Terminate" << endl;
|
||||
stopShredAllDrives(&listDrives);
|
||||
sleep(5); // sleep 5 sec
|
||||
ui->terminateTUI();
|
||||
std::exit(1); // Terminates main, doesn't wait for threads
|
||||
break;
|
||||
default:
|
||||
@ -724,4 +725,4 @@ bool reHDD::getSystemDrive(string &systemDrive)
|
||||
pclose(outputfileHwinfo);
|
||||
|
||||
return systemDriveFound;
|
||||
}
|
||||
}
|
||||
|
@ -250,6 +250,11 @@ enum TUI::UserInput TUI::readUserInput()
|
||||
return TUI::UserInput::Undefined;
|
||||
}
|
||||
|
||||
void TUI::terminateTUI()
|
||||
{
|
||||
endwin();
|
||||
}
|
||||
|
||||
void TUI::centerTitle(WINDOW *pwin, const char *title)
|
||||
{
|
||||
int x, maxX, stringSize;
|
||||
|
Reference in New Issue
Block a user