diff -r 67cfa6e6b863 -r 1c8ff1928b97 historywindow.cpp --- a/historywindow.cpp Tue Oct 24 15:36:38 2006 +0000 +++ b/historywindow.cpp Thu Nov 23 13:53:08 2006 +0000 @@ -1,7 +1,10 @@ #include "historywindow.h" -#include "mapeditor.h" +#include "mainwindow.h" + extern QString iconPath; +extern Settings settings; +extern Main *mainWindow; HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent) { @@ -29,8 +32,25 @@ connect ( ui.undoButton, SIGNAL (clicked()), this, SLOT (undo())); connect ( ui.redoButton, SIGNAL (clicked()), this, SLOT (redo())); connect ( ui.historyTable, SIGNAL (itemSelectionChanged()), this, SLOT (select())); + + // Load Settings + resize (settings.value ( "/historywindow/geometry/size", QSize(450,600)).toSize()); + move (settings.value ( "/historywindow/geometry/pos", QPoint (250,50)).toPoint()); + +/* + if (settings.value ( "/historywindow/showWithMain",false).toBool()) + setShowWithMain(true); + else + setShowWithMain(false); +*/ } +HistoryWindow::~HistoryWindow() +{ + settings.setValue( "/historywindow/geometry/size", size() ); + settings.setValue( "/historywindow/geometry/pos", pos() ); + //settings.setValue( "/historywindow/showWithMain",showWithMain()); +} void HistoryWindow::clearRow(int row) { @@ -122,11 +142,6 @@ ui.historyTable->resizeColumnsToContents(); } -void HistoryWindow::setME (MapEditor *me) -{ - mapEditor=me; -} - void HistoryWindow::setStepsTotal (int st) { // Number of steps + "current" bar @@ -136,15 +151,15 @@ void HistoryWindow::undo() { - mapEditor->undo(); + mainWindow->editUndo(); } void HistoryWindow::redo() { - mapEditor->redo(); + mainWindow->editRedo(); } void HistoryWindow::select() { - mapEditor->gotoStep (ui.historyTable->row (ui.historyTable->selectedItems().first())); + mainWindow->gotoHistoryStep (ui.historyTable->row (ui.historyTable->selectedItems().first())); }