diff -r 626fd85b1f69 -r 5391ab620c95 historywindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/historywindow.cpp Wed Sep 06 12:47:06 2006 +0000 @@ -0,0 +1,46 @@ +#include "historywindow.h" + +HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent) +{ + ui.setupUi (this); + ui.historyTable->setRowCount (20); + ui.historyTable->setColumnCount (3); + + + QTableWidgetItem *item; + + item= new QTableWidgetItem(tr("Action")); + ui.historyTable->setHorizontalHeaderItem(0, item); + + item= new QTableWidgetItem(tr("Comment")); + ui.historyTable->setHorizontalHeaderItem(1, item); + + item= new QTableWidgetItem(tr("Undo action")); + ui.historyTable->setHorizontalHeaderItem(2, item); + + ui.historyTable->setSelectionBehavior (QAbstractItemView::SelectRows); +} + + +void HistoryWindow::update(SimpleSettings &set) +{ + //int rows=set.readNumEntry("/history/undosTotal"); + //ui.historyTable->setRowCount (rows); + + int i; + for (i=0;i<= set.readNumEntry("/history/undosAvail",0); i++) + { + QTableWidgetItem *item; + + item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/redoCommand").arg(i))); + ui.historyTable->setItem(i, 0, item); + + item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/comment").arg(i))); + ui.historyTable->setItem(i, 1, item); + + item=new QTableWidgetItem(set.readEntry(QString("/history/step-%1/undoCommand").arg(i))); + ui.historyTable->setItem(i, 2, item); + } + + ui.historyTable->resizeColumnsToContents(); +}