Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
9f6cfc17f8 |
@ -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,8 +198,9 @@ void reHDD::ThreadUserInput()
|
||||
ui->updateTUI(&listDrives, u8SelectedEntry);
|
||||
break;
|
||||
case TUI::UserInput::Terminate:
|
||||
cout << "Terminate" << endl;
|
||||
// cout << "Terminate" << endl;
|
||||
stopShredAllDrives(&listDrives);
|
||||
ui->terminateTUI();
|
||||
sleep(5); // sleep 5 sec
|
||||
std::exit(1); // Terminates main, doesn't wait for threads
|
||||
break;
|
||||
@ -724,4 +725,4 @@ bool reHDD::getSystemDrive(string &systemDrive)
|
||||
pclose(outputfileHwinfo);
|
||||
|
||||
return systemDriveFound;
|
||||
}
|
||||
}
|
||||
|
10
src/tui.cpp
10
src/tui.cpp
@ -63,6 +63,11 @@ void TUI::initTUI()
|
||||
|
||||
void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
||||
{
|
||||
if (isendwin())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mxUIrefresh.lock();
|
||||
uint16_t u16StdscrX, u16StdscrY;
|
||||
getmaxyx(stdscr, u16StdscrY, u16StdscrX);
|
||||
@ -250,6 +255,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