UI: display drive count with index

This commit is contained in:
Hendrik Schutter 2022-08-23 00:03:45 +02:00
parent 50bd896cb9
commit a656d0a9f4
2 changed files with 8 additions and 6 deletions

View File

@ -56,7 +56,7 @@ private:
static WINDOW *createOverViewWindow( int iXSize, int iYSize);
static WINDOW *createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive drive);
static WINDOW *overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart);
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, bool bSelected);
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, bool bSelected);
static WINDOW *createSystemStats(int iXSize, int iYSize, int iXStart, int iYStart);
static WINDOW *createMenuView(int iXSize, int iYSize, int iXStart, int iYStart, struct MenuState menustate);
static WINDOW *createDialog(int iXSize, int iYSize, int iXStart, int iYStart, string selectedTask, string optionA, string optionB);

View File

@ -151,7 +151,7 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
break;
}
WINDOW * tmp = createEntryWindow( ((int)(u16StdscrX/3) - 2), 5, 3, (5* (u8Index) )+3, sModelFamily, sSerial, sCapacity, sState, sTime, sSpeed, bSelectedEntry);
WINDOW * tmp = createEntryWindow( ((int)(u16StdscrX/3) - 2), 5, 3, (5* (u8Index) )+3, (distance(plistDrives->begin(), it)+1), sModelFamily, sSerial, sCapacity, sState, sTime, sSpeed, bSelectedEntry);
wrefresh(tmp);
u8Index++;
}//end loop though drives
@ -308,7 +308,7 @@ WINDOW* TUI::overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart)
return newWindow;
}
WINDOW* TUI::createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, bool bSelected)
WINDOW* TUI::createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, bool bSelected)
{
WINDOW *newWindow;
newWindow = newwin(iYSize, iXSize, iYStart, iXStart);
@ -328,9 +328,11 @@ WINDOW* TUI::createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,
box(newWindow, ACS_VLINE, ACS_HLINE);
mvwaddstr(newWindow,1, 1, sModelFamily.c_str());
mvwaddstr(newWindow,2, 1, sSerial.c_str());
mvwaddstr(newWindow,3, 1, sCapacity.c_str());
mvwaddstr(newWindow,1, 1, to_string(iListIndex).c_str());
mvwaddstr(newWindow,1, 5, sModelFamily.c_str());
mvwaddstr(newWindow,2, 5, sSerial.c_str());
mvwaddstr(newWindow,3, 5, sCapacity.c_str());
mvwaddstr(newWindow,1, iXSize-sSpeed.length()-5, sSpeed.c_str());
mvwaddstr(newWindow,2, iXSize-sState.length()-5, sState.c_str());