added logging basics

This commit is contained in:
2020-09-07 17:23:15 +02:00
parent eab95844b8
commit 730b1205f7
5 changed files with 344 additions and 22 deletions

View File

@ -11,10 +11,8 @@ static std::mutex mxUIrefresh;
TUI::TUI(void)
{
}
/**
* \brief wipe drive with shred
* \param pointer of Drive instance
@ -33,6 +31,7 @@ void TUI::initTUI()
else
{
printf("Your terminal does not support color\n");
Logger::logThis()->error("Your terminal does not support color");
exit(1);
}
clear();
@ -48,6 +47,7 @@ void TUI::initTUI()
init_pair(COLOR_AREA_DETAIL, COLOR_BLACK, COLOR_WHITE);
mvprintw(0, 2, "reHDD - HDD refurbishing tool - GPL 3.0 ");
Logger::logThis()->info("UI successfully initialized");
}
void TUI::updateTUI(vector <Drive>* pvecDrives, uint8_t u8SelectedEntry)
@ -122,6 +122,7 @@ void TUI::updateTUI(vector <Drive>* pvecDrives, uint8_t u8SelectedEntry)
if(pvecDrives->size() == 0)
{
//no selected drive present
Logger::logThis()->warning("no selected drive present");
struct MenuState menustate;
menustate.bAbort = false;
menustate.bConfirmDelete = false;
@ -195,7 +196,6 @@ WINDOW* TUI::createOverViewWindow( int iXSize, int iYSize)
centerTitle(newWindow, "Detected Drives");
//keypad(newWindow, TRUE);
return newWindow;
}
@ -261,7 +261,6 @@ WINDOW* TUI::createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive
mvwaddstr(newWindow,u16Line++, 3, sErrorCount.c_str());
}
//keypad(newWindow, TRUE);
return newWindow;
}
@ -295,7 +294,6 @@ WINDOW* TUI::overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart)
attroff(COLOR_PAIR(COLOR_AREA_DETAIL));
//keypad(newWindow, TRUE);
return newWindow;
}
@ -325,14 +323,11 @@ WINDOW* TUI::createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,
mvwaddstr(newWindow,2, iXSize-sState.length()-5, sState.c_str());
//keypad(newWindow, TRUE);
return newWindow;
}
WINDOW* TUI::createSystemStats(int iXSize, int iYSize, int iYStart)
{
WINDOW *newWindow;
newWindow = newwin(iYSize, iXSize, iYStart, 2);
@ -351,7 +346,6 @@ WINDOW* TUI::createSystemStats(int iXSize, int iYSize, int iYStart)
mvwaddstr(newWindow,2, 2, time.c_str());
//keypad(newWindow, TRUE);
return newWindow;
}
@ -380,7 +374,7 @@ WINDOW* TUI::createMenuView(int iXSize, int iYSize, int iXStart, int iYStart, st
{
mvwaddstr(newWindow,u16Line++, 3, "Press D for Delete");
}
//keypad(newWindow, TRUE);
return newWindow;
}
@ -398,7 +392,6 @@ WINDOW* TUI::createDialog(int iXSize, int iYSize, int iXStart, int iYStart, stri
mvwaddstr(newWindow,u16Line++, 3, optionA.c_str());
mvwaddstr(newWindow,u16Line++, 3, optionB.c_str());
//keypad(newWindow, TRUE);
return newWindow;
}