Compare commits
1 Commits
1.2.0
...
terminal-r
Author | SHA1 | Date | |
---|---|---|---|
9f6cfc17f8 |
@ -51,6 +51,8 @@ public:
|
|||||||
|
|
||||||
static enum UserInput readUserInput();
|
static enum UserInput readUserInput();
|
||||||
|
|
||||||
|
static void terminateTUI();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static string sCpuUsage;
|
static string sCpuUsage;
|
||||||
static string sRamUsage;
|
static string sRamUsage;
|
||||||
|
@ -198,8 +198,9 @@ void reHDD::ThreadUserInput()
|
|||||||
ui->updateTUI(&listDrives, u8SelectedEntry);
|
ui->updateTUI(&listDrives, u8SelectedEntry);
|
||||||
break;
|
break;
|
||||||
case TUI::UserInput::Terminate:
|
case TUI::UserInput::Terminate:
|
||||||
cout << "Terminate" << endl;
|
// cout << "Terminate" << endl;
|
||||||
stopShredAllDrives(&listDrives);
|
stopShredAllDrives(&listDrives);
|
||||||
|
ui->terminateTUI();
|
||||||
sleep(5); // sleep 5 sec
|
sleep(5); // sleep 5 sec
|
||||||
std::exit(1); // Terminates main, doesn't wait for threads
|
std::exit(1); // Terminates main, doesn't wait for threads
|
||||||
break;
|
break;
|
||||||
|
10
src/tui.cpp
10
src/tui.cpp
@ -63,6 +63,11 @@ void TUI::initTUI()
|
|||||||
|
|
||||||
void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
||||||
{
|
{
|
||||||
|
if (isendwin())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mxUIrefresh.lock();
|
mxUIrefresh.lock();
|
||||||
uint16_t u16StdscrX, u16StdscrY;
|
uint16_t u16StdscrX, u16StdscrY;
|
||||||
getmaxyx(stdscr, u16StdscrY, u16StdscrX);
|
getmaxyx(stdscr, u16StdscrY, u16StdscrX);
|
||||||
@ -250,6 +255,11 @@ enum TUI::UserInput TUI::readUserInput()
|
|||||||
return TUI::UserInput::Undefined;
|
return TUI::UserInput::Undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TUI::terminateTUI()
|
||||||
|
{
|
||||||
|
endwin();
|
||||||
|
}
|
||||||
|
|
||||||
void TUI::centerTitle(WINDOW *pwin, const char *title)
|
void TUI::centerTitle(WINDOW *pwin, const char *title)
|
||||||
{
|
{
|
||||||
int x, maxX, stringSize;
|
int x, maxX, stringSize;
|
||||||
|
Reference in New Issue
Block a user