First stable version #58
39
src/tui.cpp
39
src/tui.cpp
|
@ -9,7 +9,8 @@
|
|||
|
||||
static std::mutex mxUIrefresh;
|
||||
|
||||
TUI::TUI(void){
|
||||
TUI::TUI(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -61,10 +62,11 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
|
|||
|
||||
refresh();
|
||||
|
||||
overview=createOverViewWindow((int)(u16StdscrX/3), (u16StdscrY));
|
||||
//overview window is 3/7 of the x-size
|
||||
overview=createOverViewWindow((int)(u16StdscrX *(float)(3.0/7.0)), (u16StdscrY-1));
|
||||
wrefresh(overview);
|
||||
|
||||
systemview=createSystemStats((int)(u16StdscrX/3), 10, u16StdscrX-(int)(u16StdscrX/3)-2, (u16StdscrY-11 ));
|
||||
systemview=createSystemStats(((int)(u16StdscrX *(float)(2.0/7.0)))-6, 12, (int)(u16StdscrX *(float)(5.0/7.0)+4), (u16StdscrY-13 ));
|
||||
wrefresh(systemview);
|
||||
|
||||
delwin(detailview);
|
||||
|
@ -169,11 +171,12 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
|
|||
|
||||
uint16_t u16StartOffsetY = (6 * (u8Index));
|
||||
|
||||
if(u8Index == 0){
|
||||
if(u8Index == 0)
|
||||
{
|
||||
u16StartOffsetY = u16StartOffsetY + 2;
|
||||
}
|
||||
|
||||
WINDOW * tmp = createEntryWindow( ((int)(u16StdscrX/3) - 2), 4, 3, u16StartOffsetY, (distance(plistDrives->begin(), it)+1), sModelFamily, sSerial, sCapacity, sState, sTime, sSpeed, sTemp, bSelectedEntry);
|
||||
WINDOW * tmp = createEntryWindow( (int)(u16StdscrX *(float)(3.0/7.0) - 2), 4, 3, u16StartOffsetY, (distance(plistDrives->begin(), it)+1), sModelFamily, sSerial, sCapacity, sState, sTime, sSpeed, sTemp, bSelectedEntry);
|
||||
wrefresh(tmp);
|
||||
u8Index++;
|
||||
}//end loop though drives
|
||||
|
@ -189,11 +192,11 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
|
|||
menustate.bDelete = false;
|
||||
menustate.bShred = false;
|
||||
|
||||
menuview=createMenuView(((int)(u16StdscrX/3)-10 ), 10, (int)(u16StdscrX/3)+5,(u16StdscrY-11), menustate);
|
||||
wrefresh(menuview);
|
||||
|
||||
detailview=overwriteDetailViewWindow(((u16StdscrX)-(int)(u16StdscrX/3)-7), (u16StdscrY-15), (int)(u16StdscrX/3)+5);
|
||||
detailview=overwriteDetailViewWindow((u16StdscrX)-((int)(u16StdscrX *(float)(3.0/7.0)))-7, (u16StdscrY-15), (int)(u16StdscrX *(float)(3.0/7.0)+5));
|
||||
wrefresh(detailview);
|
||||
|
||||
menuview=createMenuView(((int)(u16StdscrX *(float)(2.0/7.0)))-3, 12, (int)(u16StdscrX *(float)(3.0/7.0)+5),(u16StdscrY-13), menustate);
|
||||
wrefresh(menuview);
|
||||
}
|
||||
|
||||
mxUIrefresh.unlock();
|
||||
|
@ -248,6 +251,9 @@ void TUI::centerTitle(WINDOW *pwin, const char * title)
|
|||
waddch(pwin, ACS_LTEE);
|
||||
}
|
||||
|
||||
/*
|
||||
left window that contains the drive entries
|
||||
*/
|
||||
WINDOW* TUI::createOverViewWindow( int iXSize, int iYSize)
|
||||
{
|
||||
WINDOW *newWindow;
|
||||
|
@ -300,7 +306,7 @@ WINDOW* TUI::createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive
|
|||
WINDOW* TUI::overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart)
|
||||
{
|
||||
WINDOW *newWindow;
|
||||
newWindow = newwin(iYSize, iXSize, 2, iXStart);
|
||||
newWindow = newwin(iYSize, iXSize, 1, iXStart);
|
||||
wbkgd(newWindow, COLOR_PAIR(COLOR_AREA_DETAIL));
|
||||
box(newWindow, ACS_VLINE, ACS_HLINE);
|
||||
|
||||
|
@ -354,12 +360,12 @@ WINDOW* TUI::createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,
|
|||
|
||||
mvwaddstr(newWindow,1, 5, sModelFamily.c_str());
|
||||
mvwaddstr(newWindow,2, 5, sSerial.c_str());
|
||||
mvwaddstr(newWindow,3, 5, sCapacity.c_str());
|
||||
mvwaddstr(newWindow,3, 5+sCapacity.length()+3, sTemp.c_str());
|
||||
//mvwaddstr(newWindow,3, 5, sCapacity.c_str());
|
||||
//mvwaddstr(newWindow,3, 5+sCapacity.length()+3, sTemp.c_str());
|
||||
|
||||
mvwaddstr(newWindow,1, iXSize-sSpeed.length()-5, sSpeed.c_str());
|
||||
mvwaddstr(newWindow,2, iXSize-sState.length()-5, sState.c_str());
|
||||
mvwaddstr(newWindow,3, iXSize-sTime.length()-5, sTime.c_str());
|
||||
// mvwaddstr(newWindow,3, iXSize-sTime.length()-5, sTime.c_str());
|
||||
|
||||
return newWindow;
|
||||
}
|
||||
|
@ -394,6 +400,7 @@ WINDOW* TUI::createSystemStats(int iXSize, int iYSize, int iXStart, int iYStart)
|
|||
uint16_t u16Line = 2;
|
||||
|
||||
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLine01.c_str());
|
||||
u16Line++;
|
||||
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLine02.c_str());
|
||||
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLine03.c_str());
|
||||
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLine04.c_str());
|
||||
|
@ -590,10 +597,12 @@ void TUI::displaySelectedDrive(Drive drive, int stdscrX, int stdscrY)
|
|||
break;
|
||||
}
|
||||
|
||||
detailview=createDetailViewWindow(((stdscrX)-(int)(stdscrX/3)-7), (stdscrY-15), (int)(stdscrX/3)+5, drive);
|
||||
|
||||
|
||||
detailview=createDetailViewWindow((stdscrX)-((int)(stdscrX *(float)(3.0/7.0)))-7, (stdscrY-15), (int)(stdscrX *(float)(3.0/7.0)+5), drive);
|
||||
wrefresh(detailview);
|
||||
|
||||
menuview=createMenuView(((int)(stdscrX/3)-10 ), 10, (int)(stdscrX/3)+5,(stdscrY-11), menustate);
|
||||
menuview=createMenuView(((int)(stdscrX *(float)(2.0/7.0)))-3, 12, (int)(stdscrX *(float)(3.0/7.0)+5),(stdscrY-13), menustate);
|
||||
wrefresh(menuview);
|
||||
|
||||
if(menustate.bConfirmShred == true)
|
||||
|
|
Loading…
Reference in New Issue