historywindow.cpp
changeset 404 53efc2562a7d
parent 394 67cfa6e6b863
child 420 b7447adddc9a
     1.1 --- a/historywindow.cpp	Mon Nov 20 12:12:00 2006 +0000
     1.2 +++ b/historywindow.cpp	Mon Nov 20 12:12:02 2006 +0000
     1.3 @@ -1,7 +1,10 @@
     1.4  #include "historywindow.h"
     1.5 -#include "mapeditor.h"
     1.6 +#include "mainwindow.h"
     1.7 +
     1.8  
     1.9  extern QString iconPath;
    1.10 +extern Settings settings;
    1.11 +extern Main *mainWindow;
    1.12  
    1.13  HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent)
    1.14  {
    1.15 @@ -29,8 +32,25 @@
    1.16  	connect ( ui.undoButton, SIGNAL (clicked()), this, SLOT (undo()));
    1.17  	connect ( ui.redoButton, SIGNAL (clicked()), this, SLOT (redo()));
    1.18  	connect ( ui.historyTable, SIGNAL (itemSelectionChanged()), this, SLOT (select()));
    1.19 +
    1.20 +	// Load Settings
    1.21 +	resize (settings.value ( "/historywindow/geometry/size", QSize(450,600)).toSize());
    1.22 +	move   (settings.value ( "/historywindow/geometry/pos", QPoint (250,50)).toPoint());
    1.23 +
    1.24 +/*
    1.25 +	if (settings.value ( "/historywindow/showWithMain",false).toBool())
    1.26 +		setShowWithMain(true);
    1.27 +	else	
    1.28 +		setShowWithMain(false);
    1.29 +*/
    1.30  }
    1.31  
    1.32 +HistoryWindow::~HistoryWindow()
    1.33 +{
    1.34 +	settings.setValue( "/historywindow/geometry/size", size() );
    1.35 +	settings.setValue( "/historywindow/geometry/pos", pos() );
    1.36 +	//settings.setValue( "/historywindow/showWithMain",showWithMain());
    1.37 +}
    1.38  
    1.39  void HistoryWindow::clearRow(int row)
    1.40  {
    1.41 @@ -122,11 +142,6 @@
    1.42  	ui.historyTable->resizeColumnsToContents();
    1.43  }
    1.44  
    1.45 -void HistoryWindow::setME (MapEditor *me)
    1.46 -{
    1.47 -	mapEditor=me;
    1.48 -}
    1.49 -
    1.50  void HistoryWindow::setStepsTotal (int st)
    1.51  {
    1.52  	// Number of steps + "current" bar
    1.53 @@ -136,15 +151,15 @@
    1.54  
    1.55  void HistoryWindow::undo()
    1.56  {
    1.57 -	mapEditor->undo();
    1.58 +	mainWindow->editUndo();
    1.59  }
    1.60  
    1.61  void HistoryWindow::redo()
    1.62  {
    1.63 -	mapEditor->redo();
    1.64 +	mainWindow->editRedo();
    1.65  }
    1.66  
    1.67  void HistoryWindow::select()
    1.68  {
    1.69 -	mapEditor->gotoStep (ui.historyTable->row (ui.historyTable->selectedItems().first()));
    1.70 +	mainWindow->gotoHistoryStep (ui.historyTable->row (ui.historyTable->selectedItems().first()));
    1.71  }