forked from localhorst/reHDD
parse percentage from shred cmd
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
|
||||
static int fdSearchDrives[2];//File descriptor for pipe that informs if new drives are found
|
||||
|
||||
static int fdWhipe[2];//File descriptor for pipe that informs if a wipe thread signals
|
||||
static int fdShred[2];//File descriptor for pipe that informs if a wipe thread signals
|
||||
|
||||
static std::mutex mxScannDrives;
|
||||
|
||||
@ -48,11 +48,11 @@ void reHDD::app_logic(void)
|
||||
ui->initTUI();
|
||||
|
||||
pipe(fdSearchDrives);
|
||||
pipe(fdWhipe);
|
||||
pipe(fdShred);
|
||||
|
||||
FD_ZERO(&selectSet);
|
||||
FD_SET(fdSearchDrives[0], &selectSet);
|
||||
FD_SET(fdWhipe[0], &selectSet);
|
||||
FD_SET(fdShred[0], &selectSet);
|
||||
|
||||
thread thDevices(ThreadScannDevices); //start thread that scanns for drives
|
||||
thread thUserInput(ThreadUserInput); //start thread that reads user input
|
||||
@ -73,11 +73,11 @@ void reHDD::app_logic(void)
|
||||
|
||||
ui->updateTUI(&vecDrives, i32SelectedEntry);
|
||||
}
|
||||
else if (FD_ISSET(fdWhipe[0], &selectSet))
|
||||
else if (FD_ISSET(fdShred[0], &selectSet))
|
||||
{
|
||||
cout << "Whipe signal" << endl;
|
||||
//update percantage & state
|
||||
//update ui
|
||||
cout << "shred signal" << endl;
|
||||
//TODO update percantage & state
|
||||
//TODO update ui
|
||||
}
|
||||
} //endless loop
|
||||
thDevices.join();
|
||||
@ -377,7 +377,9 @@ void reHDD::handleEnter()
|
||||
{
|
||||
SELECTED_DRIVE.state = Drive::TaskState::SHRED_ACTIVE;
|
||||
//task for drive is running --> don´t show more task options
|
||||
|
||||
//TODO start shredding
|
||||
Shred::shredDrive(&vecDrives.at(i32SelectedEntry));
|
||||
}
|
||||
|
||||
if(SELECTED_DRIVE.state == Drive::TaskState::DELETE_SELECTED)
|
||||
|
Reference in New Issue
Block a user