{
m_populated = true;
m_firstpopulation = false;
- Freeze frz(*tableContent); /* disable updating*/
+// Freeze frz(*tableContent); /* disable updating*/
tableContent->clear();
+
int row = 0;
- QStringList results;
+ QStringList results_all;
QString cmd("status slots drive=0 storage=\"" + m_currentStorage + "\"");
- m_console->dir_cmd(cmd, results);
+
+ m_console->dir_cmd(cmd, results_all);
+ // skip non list messages
+ QStringList results = results_all.filter(QRegExp("[0-9]+\\|"));
+ Pmsg1(0, "count=%i\n", results.size());
+ tableContent->setRowCount(results.size());
+
foreach (QString resultline, results){
- Pmsg1(0, "s=%s\n", resultline.toUtf8().data());
+ int col=0;
QStringList fieldlist = resultline.split("|");
QStringListIterator fld(fieldlist);
+
if (fieldlist.size() < 9)
continue; /* some fields missing, ignore row */
+
Pmsg1(0, "s=%s\n", resultline.toUtf8().data());
+
TableItemFormatter slotitem(*tableContent, row);
- int col=0;
- slotitem.setNumericFld(col++, fld.next());
- Pmsg1(0, "s=%s\n", fld.next().toUtf8().data());
- slotitem.setTextFld(col++, fld.next());
- slotitem.setNumericFld(col++, fld.next());
- slotitem.setVolStatusFld(col++, fld.next());
- slotitem.setTextFld(col++, fld.next());
- slotitem.setTextFld(col++, fld.next());
- slotitem.setTextFld(col++, fld.next());
- slotitem.setTextFld(col++, fld.next());
+ slotitem.setNumericFld(col++, fld.next()); // Slot
+ Pmsg1(0, "s=%s\n", fld.next().toUtf8().data()); // Real Slot
+
+// if (fld.next() != "") { // skip "Real Slot"
+ slotitem.setTextFld(col++, fld.next()); // Volume
+ slotitem.setNumericFld(col++, fld.next()); // Bytes
+ slotitem.setVolStatusFld(col++, fld.next()); // Status
+ slotitem.setTextFld(col++, fld.next()); // MediaType
+ slotitem.setTextFld(col++, fld.next()); // Pool
+ slotitem.setTextFld(col++, fld.next()); // LastWritten
+ slotitem.setTextFld(col++, fld.next()); // Expire
+// }
row++;
}
+
tableContent->resizeColumnsToContents();
- tableContent->resizeRowsToContents();
tableContent->verticalHeader()->hide();
+ tableContent->sortByColumn(0, Qt::AscendingOrder);
+ tableContent->setSortingEnabled(true);
+
int rcnt = tableContent->rowCount();
int ccnt = tableContent->columnCount();
for(int r=0; r < rcnt; r++) {
}
}
+ tableContent->update();
+
+ tableDrive->verticalHeader()->hide();
}
/*
void Content::currentStackItem()
{
if(!m_populated) {
- populate();
+ populateContent();
}
}
<height>192</height>
</size>
</property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
<row>
<property name="text" >
<string>LTO1</string>
<height>0</height>
</size>
</property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="sortingEnabled" >
+ <bool>false</bool>
+ </property>
<column>
<property name="text" >
<string>Slot</string>
<layout class="QHBoxLayout" >
<item>
<widget class="QTableWidget" name="tableContent" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="sortingEnabled" >
+ <bool>true</bool>
+ </property>
+ <property name="rowCount" >
+ <number>0</number>
+ </property>
<column>
<property name="text" >
<string>Slot</string>