make members atomic
This commit is contained in:
@ -14,7 +14,7 @@ class Drive
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TaskState
|
enum class TaskState
|
||||||
{
|
{
|
||||||
NONE,
|
NONE,
|
||||||
SHRED_SELECTED,
|
SHRED_SELECTED,
|
||||||
@ -23,15 +23,15 @@ public:
|
|||||||
DELETE_SELECTED,
|
DELETE_SELECTED,
|
||||||
DELETE_ACTIVE,
|
DELETE_ACTIVE,
|
||||||
FROZEN
|
FROZEN
|
||||||
} state;
|
};
|
||||||
|
|
||||||
enum ConnectionType
|
enum class ConnectionType
|
||||||
{
|
{
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
USB,
|
USB,
|
||||||
SATA,
|
SATA,
|
||||||
NVME
|
NVME
|
||||||
} connectionType;
|
};
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@ -41,6 +41,9 @@ public:
|
|||||||
unsigned long ulSpeedMetricBytesWritten;
|
unsigned long ulSpeedMetricBytesWritten;
|
||||||
} sShredSpeed;
|
} sShredSpeed;
|
||||||
|
|
||||||
|
std::atomic<TaskState> state;
|
||||||
|
std::atomic<ConnectionType> connectionType;
|
||||||
|
|
||||||
bool bWasShredded = false; // all shred iterations done
|
bool bWasShredded = false; // all shred iterations done
|
||||||
bool bWasShredStarted = false; // shred was atleast once started
|
bool bWasShredStarted = false; // shred was atleast once started
|
||||||
bool bWasChecked = false; // all shred iterations and optional checking done
|
bool bWasChecked = false; // all shred iterations and optional checking done
|
||||||
|
|||||||
@ -56,6 +56,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <atomic>
|
||||||
#include "drive.h"
|
#include "drive.h"
|
||||||
#include "smart.h"
|
#include "smart.h"
|
||||||
#include "shred.h"
|
#include "shred.h"
|
||||||
|
|||||||
@ -67,7 +67,7 @@ private:
|
|||||||
|
|
||||||
static void centerTitle(WINDOW *pwin, const char *title);
|
static void centerTitle(WINDOW *pwin, const char *title);
|
||||||
static WINDOW *createOverViewWindow(int iXSize, int iYSize);
|
static WINDOW *createOverViewWindow(int iXSize, int iYSize);
|
||||||
static WINDOW *createDetailViewWindow(int iXSize, int iYSize, int iXStart, Drive drive);
|
static WINDOW *createDetailViewWindow(int iXSize, int iYSize, int iXStart, Drive &drive);
|
||||||
static WINDOW *overwriteDetailViewWindow(int iXSize, int iYSize, int iXStart);
|
static WINDOW *overwriteDetailViewWindow(int iXSize, int iYSize, int iXStart);
|
||||||
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, std::string sModelFamily, std::string sSerial, std::string sCapacity, std::string sState, std::string sTime, std::string sSpeed, std::string sTemp, std::string sConnection, bool bSelected);
|
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, std::string sModelFamily, std::string sSerial, std::string sCapacity, std::string sState, std::string sTime, std::string sSpeed, std::string sTemp, std::string sConnection, bool bSelected);
|
||||||
static WINDOW *createSystemStats(int iXSize, int iYSize, int iXStart, int iYStart);
|
static WINDOW *createSystemStats(int iXSize, int iYSize, int iXStart, int iYStart);
|
||||||
@ -77,7 +77,7 @@ private:
|
|||||||
static WINDOW *createSmartWarning(int iXSize, int iYSize, int iXStart, int iYStart, std::string sPath, uint32_t u32PowerOnHours, uint32_t u32PowerCycles, uint32_t u32ErrorCount, uint32_t u32Temperature);
|
static WINDOW *createSmartWarning(int iXSize, int iYSize, int iXStart, int iYStart, std::string sPath, uint32_t u32PowerOnHours, uint32_t u32PowerCycles, uint32_t u32ErrorCount, uint32_t u32Temperature);
|
||||||
static WINDOW *createZeroChecksumWarning(int iXSize, int iYSize, int iXStart, int iYStart, std::string sPath, std::string sModelFamily, std::string sModelName, std::string sSerial, uint32_t u32Checksum);
|
static WINDOW *createZeroChecksumWarning(int iXSize, int iYSize, int iXStart, int iYStart, std::string sPath, std::string sModelFamily, std::string sModelName, std::string sSerial, uint32_t u32Checksum);
|
||||||
|
|
||||||
void displaySelectedDrive(Drive drive, int stdscrX, int stdscrY);
|
void displaySelectedDrive(Drive &drive, int stdscrX, int stdscrY);
|
||||||
std::string formatTimeDuration(time_t u32Duration);
|
std::string formatTimeDuration(time_t u32Duration);
|
||||||
std::string formatSpeed(time_t u32ShredTimeDelta, unsigned long ulWrittenBytes);
|
std::string formatSpeed(time_t u32ShredTimeDelta, unsigned long ulWrittenBytes);
|
||||||
static void vTruncateText(std::string *psText, uint16_t u16MaxLenght);
|
static void vTruncateText(std::string *psText, uint16_t u16MaxLenght);
|
||||||
|
|||||||
@ -205,6 +205,6 @@ void Drive::checkFrozenDrive(void)
|
|||||||
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
||||||
this->bWasDeleted = false;
|
this->bWasDeleted = false;
|
||||||
this->bWasShredded = false;
|
this->bWasShredded = false;
|
||||||
this->state = Drive::FROZEN;
|
this->state = Drive::TaskState::FROZEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "../include/reHDD.h"
|
#include "../include/reHDD.h"
|
||||||
|
|
||||||
|
|
||||||
bool Printer::instanceFlag = false;
|
bool Printer::instanceFlag = false;
|
||||||
Printer *Printer::single = NULL;
|
Printer *Printer::single = NULL;
|
||||||
|
|
||||||
@ -57,16 +56,16 @@ void Printer::print(Drive *drive)
|
|||||||
|
|
||||||
switch (drive->connectionType)
|
switch (drive->connectionType)
|
||||||
{
|
{
|
||||||
case Drive::USB:
|
case Drive::ConnectionType::USB:
|
||||||
strncpy(msgQueueData.driveData.caDriveConnectionType, "usb", STR_BUFFER_SIZE);
|
strncpy(msgQueueData.driveData.caDriveConnectionType, "usb", STR_BUFFER_SIZE);
|
||||||
break;
|
break;
|
||||||
case Drive::SATA:
|
case Drive::ConnectionType::SATA:
|
||||||
strncpy(msgQueueData.driveData.caDriveConnectionType, "sata", STR_BUFFER_SIZE);
|
strncpy(msgQueueData.driveData.caDriveConnectionType, "sata", STR_BUFFER_SIZE);
|
||||||
break;
|
break;
|
||||||
case Drive::NVME:
|
case Drive::ConnectionType::NVME:
|
||||||
strncpy(msgQueueData.driveData.caDriveConnectionType, "nvme", STR_BUFFER_SIZE);
|
strncpy(msgQueueData.driveData.caDriveConnectionType, "nvme", STR_BUFFER_SIZE);
|
||||||
break;
|
break;
|
||||||
case Drive::UNKNOWN:
|
case Drive::ConnectionType::UNKNOWN:
|
||||||
default:
|
default:
|
||||||
strncpy(msgQueueData.driveData.caDriveConnectionType, "na", STR_BUFFER_SIZE);
|
strncpy(msgQueueData.driveData.caDriveConnectionType, "na", STR_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,7 +133,7 @@ void reHDD::ThreadCheckFrozenDrives()
|
|||||||
mxDrives.lock();
|
mxDrives.lock();
|
||||||
for (auto it = begin(listDrives); it != end(listDrives); ++it)
|
for (auto it = begin(listDrives); it != end(listDrives); ++it)
|
||||||
{
|
{
|
||||||
if (it->state == Drive::SHRED_ACTIVE)
|
if (it->state == Drive::TaskState::SHRED_ACTIVE)
|
||||||
{
|
{
|
||||||
it->checkFrozenDrive();
|
it->checkFrozenDrive();
|
||||||
}
|
}
|
||||||
@ -175,9 +175,9 @@ void reHDD::ThreadUserInput()
|
|||||||
|
|
||||||
if (tmpSelectedDrive != nullptr)
|
if (tmpSelectedDrive != nullptr)
|
||||||
{
|
{
|
||||||
if (tmpSelectedDrive->state == Drive::NONE)
|
if (tmpSelectedDrive->state == Drive::TaskState::NONE)
|
||||||
{
|
{
|
||||||
tmpSelectedDrive->state = Drive::DELETE_SELECTED;
|
tmpSelectedDrive->state = Drive::TaskState::DELETE_SELECTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,9 +187,9 @@ void reHDD::ThreadUserInput()
|
|||||||
// cout << "Shred" << endl;
|
// cout << "Shred" << endl;
|
||||||
if (tmpSelectedDrive != nullptr)
|
if (tmpSelectedDrive != nullptr)
|
||||||
{
|
{
|
||||||
if (tmpSelectedDrive->state == Drive::NONE)
|
if (tmpSelectedDrive->state == Drive::TaskState::NONE)
|
||||||
{
|
{
|
||||||
tmpSelectedDrive->state = Drive::SHRED_SELECTED;
|
tmpSelectedDrive->state = Drive::TaskState::SHRED_SELECTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->updateTUI(&listDrives, u16SelectedEntry);
|
ui->updateTUI(&listDrives, u16SelectedEntry);
|
||||||
@ -302,7 +302,7 @@ void reHDD::filterNewDrives(list<Drive> *plistOldDrives, list<Drive> *plistNewDr
|
|||||||
{
|
{
|
||||||
// cout << "offline drive found: " << itOld->getPath() << endl;
|
// cout << "offline drive found: " << itOld->getPath() << endl;
|
||||||
Logger::logThis()->warning("Mark offline drive found: " + itOld->getPath());
|
Logger::logThis()->warning("Mark offline drive found: " + itOld->getPath());
|
||||||
itOld->state = Drive::NONE; // clear state --> shred task will terminate
|
itOld->state = Drive::TaskState::NONE; // clear state --> shred task will terminate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,26 +340,26 @@ void reHDD::searchDrives(std::list<Drive> *plistDrives)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
Drive tmpDrive("/dev/" + devName);
|
Drive tmpDrive("/dev/" + devName);
|
||||||
tmpDrive.state = Drive::NONE;
|
tmpDrive.state = Drive::TaskState::NONE;
|
||||||
tmpDrive.bIsOffline = false;
|
tmpDrive.bIsOffline = false;
|
||||||
|
|
||||||
// Set connection type
|
// Set connection type
|
||||||
if (transport == "sata")
|
if (transport == "sata")
|
||||||
tmpDrive.connectionType = Drive::SATA;
|
tmpDrive.connectionType = Drive::ConnectionType::SATA;
|
||||||
else if (transport == "usb")
|
else if (transport == "usb")
|
||||||
tmpDrive.connectionType = Drive::USB;
|
tmpDrive.connectionType = Drive::ConnectionType::USB;
|
||||||
else if (transport == "nvme")
|
else if (transport == "nvme")
|
||||||
tmpDrive.connectionType = Drive::NVME;
|
tmpDrive.connectionType = Drive::ConnectionType::NVME;
|
||||||
else
|
else
|
||||||
tmpDrive.connectionType = Drive::UNKNOWN;
|
tmpDrive.connectionType = Drive::ConnectionType::UNKNOWN;
|
||||||
|
|
||||||
plistDrives->push_back(tmpDrive);
|
plistDrives->push_back(tmpDrive);
|
||||||
|
|
||||||
Logger::logThis()->info(
|
Logger::logThis()->info(
|
||||||
"Drive found: " + tmpDrive.getPath() +
|
"Drive found: " + tmpDrive.getPath() +
|
||||||
" (type: " +
|
" (type: " +
|
||||||
(tmpDrive.connectionType == Drive::USB ? "USB" : tmpDrive.connectionType == Drive::SATA ? "SATA"
|
(tmpDrive.connectionType == Drive::ConnectionType::USB ? "USB" : tmpDrive.connectionType == Drive::ConnectionType::SATA ? "SATA"
|
||||||
: tmpDrive.connectionType == Drive::NVME ? "NVME"
|
: tmpDrive.connectionType == Drive::ConnectionType::NVME ? "NVME"
|
||||||
: "UNKNOWN") +
|
: "UNKNOWN") +
|
||||||
")");
|
")");
|
||||||
}
|
}
|
||||||
@ -478,7 +478,7 @@ void reHDD::startShredAllDrives(list<Drive> *plistDrives)
|
|||||||
mxDrives.lock();
|
mxDrives.lock();
|
||||||
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->state == Drive::NONE)
|
if (it->state == Drive::TaskState::NONE)
|
||||||
{
|
{
|
||||||
Drive *pTmpDrive = iterator_to_pointer<Drive, std::list<Drive>::iterator>(it);
|
Drive *pTmpDrive = iterator_to_pointer<Drive, std::list<Drive>::iterator>(it);
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
@ -505,9 +505,9 @@ void reHDD::stopShredAllDrives(list<Drive> *plistDrives)
|
|||||||
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (it->state == Drive::SHRED_ACTIVE || it->state == Drive::DELETE_ACTIVE)
|
if (it->state == Drive::TaskState::SHRED_ACTIVE || it->state == Drive::TaskState::DELETE_ACTIVE)
|
||||||
{
|
{
|
||||||
it->state = Drive::NONE;
|
it->state = Drive::TaskState::NONE;
|
||||||
Logger::logThis()->info("Abort-Shred-Signal for: " + it->getModelName() + "-" + it->getSerial());
|
Logger::logThis()->info("Abort-Shred-Signal for: " + it->getModelName() + "-" + it->getSerial());
|
||||||
// task for drive is running --> remove selection
|
// task for drive is running --> remove selection
|
||||||
}
|
}
|
||||||
@ -566,7 +566,7 @@ void reHDD::updateShredMetrics(list<Drive> *plistDrives)
|
|||||||
list<Drive>::iterator it;
|
list<Drive>::iterator it;
|
||||||
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->state == Drive::SHRED_ACTIVE)
|
if (it->state == Drive::TaskState::SHRED_ACTIVE)
|
||||||
{
|
{
|
||||||
Drive *pTmpDrive = iterator_to_pointer<Drive, std::list<Drive>::iterator>(it);
|
Drive *pTmpDrive = iterator_to_pointer<Drive, std::list<Drive>::iterator>(it);
|
||||||
// set metrics for calculating shred speed
|
// set metrics for calculating shred speed
|
||||||
@ -675,9 +675,9 @@ void reHDD::handleAbort()
|
|||||||
Drive *tmpSelectedDrive = getSelectedDrive();
|
Drive *tmpSelectedDrive = getSelectedDrive();
|
||||||
if (tmpSelectedDrive != nullptr)
|
if (tmpSelectedDrive != nullptr)
|
||||||
{
|
{
|
||||||
if (tmpSelectedDrive->state == Drive::SHRED_ACTIVE || tmpSelectedDrive->state == Drive::DELETE_ACTIVE)
|
if (tmpSelectedDrive->state == Drive::TaskState::SHRED_ACTIVE || tmpSelectedDrive->state == Drive::TaskState::DELETE_ACTIVE)
|
||||||
{
|
{
|
||||||
tmpSelectedDrive->state = Drive::NONE;
|
tmpSelectedDrive->state = Drive::TaskState::NONE;
|
||||||
Logger::logThis()->info("Abort-Shred-Signal for: " + tmpSelectedDrive->getModelName() + "-" + tmpSelectedDrive->getSerial());
|
Logger::logThis()->info("Abort-Shred-Signal for: " + tmpSelectedDrive->getModelName() + "-" + tmpSelectedDrive->getSerial());
|
||||||
// task for drive is running --> remove selection
|
// task for drive is running --> remove selection
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
|
|||||||
#ifdef DRYRUN
|
#ifdef DRYRUN
|
||||||
for (int i = 0; i <= 500; i++)
|
for (int i = 0; i <= 500; i++)
|
||||||
{
|
{
|
||||||
if (drive->state != Drive::SHRED_ACTIVE)
|
if (drive->state.load() != Drive::TaskState::SHRED_ACTIVE)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -202,9 +202,9 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
|
|||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
if ((drive->state == Drive::SHRED_ACTIVE) || (drive->state == Drive::CHECK_ACTIVE))
|
if ((drive->state.load() == Drive::TaskState::SHRED_ACTIVE) || (drive->state.load() == Drive::TaskState::CHECK_ACTIVE))
|
||||||
{
|
{
|
||||||
drive->state = Drive::NONE;
|
drive->state = Drive::TaskState::NONE;
|
||||||
drive->setTaskPercentage(0.0);
|
drive->setTaskPercentage(0.0);
|
||||||
Printer::getPrinter()->print(drive);
|
Printer::getPrinter()->print(drive);
|
||||||
Logger::logThis()->info("Finished shred/check for: " + drive->getModelName() + "-" + drive->getSerial());
|
Logger::logThis()->info("Finished shred/check for: " + drive->getModelName() + "-" + drive->getSerial());
|
||||||
|
|||||||
30
src/tui.cpp
30
src/tui.cpp
@ -122,7 +122,7 @@ void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
|||||||
|
|
||||||
switch (it->state)
|
switch (it->state)
|
||||||
{
|
{
|
||||||
case Drive::SHRED_ACTIVE:
|
case Drive::TaskState::SHRED_ACTIVE:
|
||||||
|
|
||||||
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
||||||
sState = "Shredding: " + stream.str() + "%";
|
sState = "Shredding: " + stream.str() + "%";
|
||||||
@ -131,21 +131,21 @@ void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
|||||||
sTime = this->formatTimeDuration(it->getTaskDuration());
|
sTime = this->formatTimeDuration(it->getTaskDuration());
|
||||||
sSpeed = this->formatSpeed(it->sShredSpeed.u32ShredTimeDelta, it->sShredSpeed.ulWrittenBytes);
|
sSpeed = this->formatSpeed(it->sShredSpeed.u32ShredTimeDelta, it->sShredSpeed.ulWrittenBytes);
|
||||||
break;
|
break;
|
||||||
case Drive::CHECK_ACTIVE:
|
case Drive::TaskState::CHECK_ACTIVE:
|
||||||
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
||||||
sState = "Checking: " + stream.str() + "%";
|
sState = "Checking: " + stream.str() + "%";
|
||||||
it->calculateTaskDuration();
|
it->calculateTaskDuration();
|
||||||
sTime = this->formatTimeDuration(it->getTaskDuration());
|
sTime = this->formatTimeDuration(it->getTaskDuration());
|
||||||
sSpeed = this->formatSpeed(it->sShredSpeed.u32ShredTimeDelta, it->sShredSpeed.ulWrittenBytes);
|
sSpeed = this->formatSpeed(it->sShredSpeed.u32ShredTimeDelta, it->sShredSpeed.ulWrittenBytes);
|
||||||
break;
|
break;
|
||||||
case Drive::DELETE_ACTIVE:
|
case Drive::TaskState::DELETE_ACTIVE:
|
||||||
sState = "Deleting ...";
|
sState = "Deleting ...";
|
||||||
it->calculateTaskDuration();
|
it->calculateTaskDuration();
|
||||||
sTime = this->formatTimeDuration(it->getTaskDuration());
|
sTime = this->formatTimeDuration(it->getTaskDuration());
|
||||||
break;
|
break;
|
||||||
case Drive::NONE:
|
case Drive::TaskState::NONE:
|
||||||
case Drive::SHRED_SELECTED:
|
case Drive::TaskState::SHRED_SELECTED:
|
||||||
case Drive::DELETE_SELECTED:
|
case Drive::TaskState::DELETE_SELECTED:
|
||||||
if (it->bWasDeleted)
|
if (it->bWasDeleted)
|
||||||
{
|
{
|
||||||
sState = "DELETED"; // mark drive as deleted previously
|
sState = "DELETED"; // mark drive as deleted previously
|
||||||
@ -174,7 +174,7 @@ void TUI::updateTUI(list<Drive> *plistDrives, uint8_t u8SelectedEntry)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Drive::FROZEN:
|
case Drive::TaskState::FROZEN:
|
||||||
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
stream << fixed << setprecision(3) << (it->getTaskPercentage());
|
||||||
#ifdef FROZEN_ALERT
|
#ifdef FROZEN_ALERT
|
||||||
if (bSelectedEntry)
|
if (bSelectedEntry)
|
||||||
@ -290,7 +290,7 @@ WINDOW *TUI::createOverViewWindow(int iXSize, int iYSize)
|
|||||||
return newWindow;
|
return newWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
WINDOW *TUI::createDetailViewWindow(int iXSize, int iYSize, int iXStart, Drive drive)
|
WINDOW *TUI::createDetailViewWindow(int iXSize, int iYSize, int iXStart, Drive &drive)
|
||||||
{
|
{
|
||||||
WINDOW *newWindow;
|
WINDOW *newWindow;
|
||||||
newWindow = newwin(iYSize, iXSize, 1, iXStart);
|
newWindow = newwin(iYSize, iXSize, 1, iXStart);
|
||||||
@ -633,7 +633,7 @@ void TUI::vTruncateText(string *psText, uint16_t u16MaxLenght)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TUI::displaySelectedDrive(Drive drive, int stdscrX, int stdscrY)
|
void TUI::displaySelectedDrive(Drive &drive, int stdscrX, int stdscrY)
|
||||||
{
|
{
|
||||||
struct MenuState menustate;
|
struct MenuState menustate;
|
||||||
static bool dialogIsActive;
|
static bool dialogIsActive;
|
||||||
@ -646,27 +646,27 @@ void TUI::displaySelectedDrive(Drive drive, int stdscrX, int stdscrY)
|
|||||||
// set menustate based on drive state
|
// set menustate based on drive state
|
||||||
switch (drive.state)
|
switch (drive.state)
|
||||||
{
|
{
|
||||||
case Drive::NONE: // no task running or selected for this drive
|
case Drive::TaskState::NONE: // no task running or selected for this drive
|
||||||
menustate.bShred = true;
|
menustate.bShred = true;
|
||||||
menustate.bDelete = true;
|
menustate.bDelete = true;
|
||||||
break;
|
break;
|
||||||
case Drive::DELETE_ACTIVE: // delete task running for this drive
|
case Drive::TaskState::DELETE_ACTIVE: // delete task running for this drive
|
||||||
menustate.bAbort = true;
|
menustate.bAbort = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Drive::SHRED_ACTIVE: // shred task running for this drive
|
case Drive::TaskState::SHRED_ACTIVE: // shred task running for this drive
|
||||||
menustate.bAbort = true;
|
menustate.bAbort = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Drive::CHECK_ACTIVE: // check task running for this drive
|
case Drive::TaskState::CHECK_ACTIVE: // check task running for this drive
|
||||||
menustate.bAbort = true;
|
menustate.bAbort = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Drive::DELETE_SELECTED: // delete task selected for this drive
|
case Drive::TaskState::DELETE_SELECTED: // delete task selected for this drive
|
||||||
menustate.bConfirmDelete = true;
|
menustate.bConfirmDelete = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Drive::SHRED_SELECTED: // shred task selected for this drive
|
case Drive::TaskState::SHRED_SELECTED: // shred task selected for this drive
|
||||||
menustate.bConfirmShred = true;
|
menustate.bConfirmShred = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user