diff -r 7c3ee77f4449 -r 53efc2562a7d historywindow.cpp --- a/historywindow.cpp Mon Nov 20 12:12:00 2006 +0000 +++ b/historywindow.cpp Mon Nov 20 12:12:02 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())); }