diff -r a40af6315ac6 -r 3a58c9ef4a18 historywindow.cpp --- a/historywindow.cpp Thu Sep 14 11:38:17 2006 +0000 +++ b/historywindow.cpp Thu Sep 14 11:38:18 2006 +0000 @@ -10,13 +10,13 @@ QTableWidgetItem *item; - item= new QTableWidgetItem(tr("Action")); + item= new QTableWidgetItem(tr("Action","Table with actions")); ui.historyTable->setHorizontalHeaderItem(0, item); - item= new QTableWidgetItem(tr("Comment")); + item= new QTableWidgetItem(tr("Comment","Table with actions")); ui.historyTable->setHorizontalHeaderItem(1, item); - item= new QTableWidgetItem(tr("Undo action")); + item= new QTableWidgetItem(tr("Undo action","Table with actions")); ui.historyTable->setHorizontalHeaderItem(2, item); ui.historyTable->setSelectionBehavior (QAbstractItemView::SelectRows); @@ -27,6 +27,17 @@ } +void HistoryWindow::clearRow(int row) +{ + QTableWidgetItem *it; + it=ui.historyTable->item (row,0); + if (it) it->setText (""); + it=ui.historyTable->item (row,1); + if (it) it->setText (""); + it=ui.historyTable->item (row,2); + if (it) it->setText (""); +} + void HistoryWindow::updateRow(int row, int step, SimpleSettings &set) { QTableWidgetItem *item; @@ -63,7 +74,7 @@ else ui.redoButton->setEnabled (true); - // Update table + // Update undos in table for (i=undosAvail; i>0; i--) { updateRow (r,s,set); @@ -83,20 +94,24 @@ ui.historyTable->setItem(undosAvail, i, item); } } - item=new QTableWidgetItem(" - " +tr("Current state","current bar in history hwindow")+ " - "); + item=new QTableWidgetItem(" - " +tr("Current state","Current bar in history hwindow")+ " - "); item->setBackgroundColor (c); ui.historyTable->setItem(undosAvail, 1, item); + // Update Redos in table s=curStep; s++; if (s>stepsTotal) s=1; - for (i=1;i<= redosAvail; i++) { updateRow (undosAvail+i,s,set); s++; if (s>stepsTotal) s=1; } + // Delete the rest + for (i=undosAvail+redosAvail+1;i<= stepsTotal; i++) + clearRow (i); + ui.historyTable->resizeColumnsToContents(); }