diff -r 24c7902a3e14 -r ba4a99830ad1 historywindow.cpp --- a/historywindow.cpp Wed May 02 15:31:17 2007 +0000 +++ b/historywindow.cpp Wed Dec 05 14:58:03 2007 +0000 @@ -9,7 +9,7 @@ HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent) { ui.setupUi (this); - ui.historyTable->setRowCount (20); + ui.historyTable->setRowCount (settings.value( "/mapeditor/stepsTotal",75).toInt()); ui.historyTable->setColumnCount (3); @@ -35,14 +35,22 @@ // Load Settings - for (int i=0; i<3; ++i) - ui.historyTable->setColumnWidth (i,settings.value( QString("/historywindow/geometry/columnWidth/%1").arg(i),150).toInt()); + resize (settings.value ( "/satellite/historywindow/geometry/size", QSize(1000,400)).toSize()); + move (settings.value ( "/satellite/historywindow/geometry/pos", QPoint (0,450)).toPoint()); + + ui.historyTable->setColumnWidth (0,settings.value("/satellite/historywindow/geometry/columnWidth/0",250).toInt()); + ui.historyTable->setColumnWidth (1,settings.value("/satellite/historywindow/geometry/columnWidth/1",350).toInt()); + ui.historyTable->setColumnWidth (2,settings.value("/satellite/historywindow/geometry/columnWidth/2",250).toInt()); } HistoryWindow::~HistoryWindow() { + // Save settings + settings.setValue( "/satellite/historywindow/geometry/size", size() ); + settings.setValue( "/satellite/historywindow/geometry/pos", pos() ); + for (int i=0; i<3; ++i) - settings.setValue( QString("/historywindow/geometry/columnWidth/%1").arg(i), ui.historyTable->columnWidth (i) ); + settings.setValue( QString("/satellite/historywindow/geometry/columnWidth/%1").arg(i), ui.historyTable->columnWidth (i) ); } void HistoryWindow::clearRow(int row) @@ -81,6 +89,9 @@ int r=undosAvail-1; QTableWidgetItem *item; + // Update number of rows + ui.historyTable->setRowCount (undosAvail + redosAvail +1); + // Update buttons if (undosAvail<1) ui.undoButton->setEnabled (false); @@ -132,18 +143,17 @@ for (i=undosAvail+redosAvail+1;i<= stepsTotal; i++) clearRow (i); - ui.historyTable->resizeColumnsToContents(); + //ui.historyTable->resizeColumnsToContents(); } void HistoryWindow::setStepsTotal (int st) { // Number of steps + "current" bar ui.historyTable->setRowCount (st+1); - } -void HistoryWindow::closeEvent (QCloseEvent *ce) +void HistoryWindow::closeEvent (QCloseEvent *) { emit (windowClosed() ); } @@ -160,5 +170,6 @@ void HistoryWindow::select() { + cout <<"HW::select "<row (ui.historyTable->selectedItems().first())<gotoHistoryStep (ui.historyTable->row (ui.historyTable->selectedItems().first())); }