historywindow moved to mainwindow. Started to get rid of Q3PtrList finally
authorinsilmaril
Mon, 20 Nov 2006 12:12:02 +0000
changeset 40453efc2562a7d
parent 403 7c3ee77f4449
child 405 a4532e5c2ce3
historywindow moved to mainwindow. Started to get rid of Q3PtrList finally
aboutdialog.cpp
branchobj.cpp
branchobj.h
demos/todo.vym
exports.cpp
historywindow.cpp
historywindow.h
linkablemapobj.cpp
main.cpp
mainwindow.cpp
mainwindow.h
mapcenterobj.cpp
mapcenterobj.h
mapeditor.cpp
mapeditor.h
texteditor.cpp
version.cpp
version.h
xml.cpp
     1.1 --- a/aboutdialog.cpp	Mon Nov 20 12:12:00 2006 +0000
     1.2 +++ b/aboutdialog.cpp	Mon Nov 20 12:12:02 2006 +0000
     1.3 @@ -3,12 +3,13 @@
     1.4  #include <QFrame>
     1.5  
     1.6  #include "aboutdialog.h"
     1.7 -#include "version.h"
     1.8  #include "settings.h"
     1.9  
    1.10  
    1.11  extern Settings settings;
    1.12  extern QString iconPath;
    1.13 +extern QString vymVersion;
    1.14 +extern QString vymBuildDate;
    1.15  
    1.16  AboutDialog::AboutDialog( QWidget *parent, const char *name)
    1.17      : QDialog( parent, name)
    1.18 @@ -24,7 +25,7 @@
    1.19  	"<h3><center>VYM - View Your Mind </h3>"
    1.20  	"<p align=\"center\"> A tool to put the things you have got in your mind into a map.</p>"
    1.21  	"<p align=\"center\"> (c) by Uwe Drechsel (<a href=\"mailto:vym@InSilmaril.de\">vym@InSilmaril.de</a>)</p>"
    1.22 -	"<p align=\"center\"> Version " __VYM_VERSION" - " __BUILD_DATE"</p>"
    1.23 +	"<p align=\"center\"> Version " +vymVersion+" - " +vymBuildDate+"</p>"
    1.24  	"<ul>"
    1.25  	"<li> Contact</li>"
    1.26  		"<ul>"
     2.1 --- a/branchobj.cpp	Mon Nov 20 12:12:00 2006 +0000
     2.2 +++ b/branchobj.cpp	Mon Nov 20 12:12:02 2006 +0000
     2.3 @@ -86,7 +86,6 @@
     2.4  void BranchObj::init () 
     2.5  {
     2.6      branch.setAutoDelete (false);
     2.7 -    floatimage.setAutoDelete (true);
     2.8      xlink.setAutoDelete (false);
     2.9  
    2.10  	if (parObj)
    2.11 @@ -118,10 +117,8 @@
    2.12  		// Those will get a deep copy, too
    2.13  		addBranch(b);	
    2.14  
    2.15 -	FloatImageObj *fi;
    2.16 -	for (fi=other->floatimage.first(); fi;fi=other->floatimage.next() )
    2.17 -		addFloatImage (fi);
    2.18 -
    2.19 +	for (int i=0; i<other->floatimage.size(); ++i)
    2.20 +		addFloatImage  (other->floatimage.at(i));
    2.21  	scrolled=other->scrolled;
    2.22  	tmpUnscrolled=other->tmpUnscrolled;
    2.23  	setVisibility (other->visible);
    2.24 @@ -133,7 +130,9 @@
    2.25  
    2.26  void BranchObj::clear() 
    2.27  {
    2.28 -	floatimage.clear();
    2.29 +	while (!floatimage.isEmpty())
    2.30 +		delete floatimage.takeFirst();
    2.31 +
    2.32  	while (!xlink.isEmpty())
    2.33  		deleteXLink (xlink.first() );
    2.34  
    2.35 @@ -166,7 +165,7 @@
    2.36  
    2.37  int BranchObj::getFloatImageNum(FloatImageObj *fio)
    2.38  {
    2.39 -	return floatimage.findRef (fio);
    2.40 +	return floatimage.indexOf(fio);
    2.41  }
    2.42  
    2.43  int BranchObj::countBranches()
    2.44 @@ -366,9 +365,8 @@
    2.45  			BranchObj* b;
    2.46  			for (b=branch.first(); b;b=branch.next() ) 
    2.47  				b->setVisibility (v,toDepth);	
    2.48 -			FloatImageObj *fio;
    2.49 -			for (fio=floatimage.first(); fio; fio=floatimage.next())
    2.50 -				fio->setVisibility (v);
    2.51 +			for (int i=0; i<floatimage.size(); ++i)
    2.52 +				floatimage.at(i)->setVisibility (v);
    2.53  			XLinkObj* xlo;
    2.54  			for (xlo=xlink.first(); xlo;xlo=xlink.next() ) 
    2.55  				xlo->setVisibility ();	
    2.56 @@ -535,18 +533,16 @@
    2.57  
    2.58  void BranchObj::positionContents()
    2.59  {
    2.60 -	FloatImageObj *fio;
    2.61 -    for (fio=floatimage.first(); fio; fio=floatimage.next() )
    2.62 -		fio->reposition();
    2.63 +    for (int i=0; i<floatimage.size(); ++i )
    2.64 +		floatimage.at(i)->reposition();
    2.65  	OrnamentedObj::positionContents();
    2.66  }
    2.67  
    2.68  void BranchObj::move (double x, double y)
    2.69  {
    2.70  	OrnamentedObj::move (x,y);
    2.71 -	FloatImageObj *fio;
    2.72 -    for (fio=floatimage.first(); fio; fio=floatimage.next() )
    2.73 -		fio->reposition();
    2.74 +    for (int i=0; i<floatimage.size(); ++i )
    2.75 +		floatimage.at(i)->reposition();
    2.76      positionBBox();
    2.77  }
    2.78  
    2.79 @@ -614,22 +610,21 @@
    2.80  
    2.81  	// Floatimages 
    2.82  	QPoint rp;
    2.83 -	FloatImageObj *foi;
    2.84  
    2.85  	topPad=botPad=leftPad=rightPad=0;
    2.86  	if (includeImagesVer || includeImagesHor)
    2.87  	{
    2.88  		if (countFloatImages()>0)
    2.89  		{
    2.90 -			for (foi=floatimage.first(); foi; foi=floatimage.next() )
    2.91 +			for (int i=0; i<floatimage.size(); ++i )
    2.92  			{
    2.93 -				rp=foi->getRelPos();
    2.94 +				rp=floatimage.at(i)->getRelPos();
    2.95  				if (includeImagesVer)
    2.96  				{
    2.97  					if (rp.y() < 0) 
    2.98  						topPad=max (topPad,-rp.y()-h);
    2.99 -					if (rp.y()+foi->height() > 0)
   2.100 -						botPad=max (botPad,rp.y()+foi->height());
   2.101 +					if (rp.y()+floatimage.at(i)->height() > 0)
   2.102 +						botPad=max (botPad,rp.y()+floatimage.at(i)->height());
   2.103  				}		
   2.104  				if (includeImagesHor)
   2.105  				{
   2.106 @@ -637,14 +632,14 @@
   2.107  					{
   2.108  						if (-rp.x()-w > 0) 
   2.109  							leftPad=max (leftPad,-rp.x()-w);
   2.110 -						if (rp.x()+foi->width() > 0)
   2.111 -							rightPad=max (rightPad,rp.x()+foi->width());
   2.112 +						if (rp.x()+floatimage.at(i)->width() > 0)
   2.113 +							rightPad=max (rightPad,rp.x()+floatimage.at(i)->width());
   2.114  					} else
   2.115  					{
   2.116  						if (rp.x()< 0) 
   2.117  							leftPad=max (leftPad,-rp.x());
   2.118 -						if (rp.x()+foi->width() > w)
   2.119 -							rightPad=max (rightPad,rp.x()+foi->width()-w);
   2.120 +						if (rp.x()+floatimage.at(i)->width() > w)
   2.121 +							rightPad=max (rightPad,rp.x()+floatimage.at(i)->width()-w);
   2.122  					}
   2.123  				}		
   2.124  			}	
   2.125 @@ -691,13 +686,12 @@
   2.126  		return this;
   2.127  
   2.128  	// Search float images
   2.129 -	FloatImageObj *foi;
   2.130 -    for (foi=floatimage.first(); foi; foi=floatimage.next() )
   2.131 -		if (foi->inBox(p) && 
   2.132 -			(foi != excludeLMO) && 
   2.133 -			foi->getParObj()!= excludeLMO &&
   2.134 -			foi->isVisibleObj() 
   2.135 -		) return foi;
   2.136 +    for (int i=0; i<floatimage.size(); ++i )
   2.137 +		if (floatimage.at(i)->inBox(p) && 
   2.138 +			(floatimage.at(i) != excludeLMO) && 
   2.139 +			floatimage.at(i)->getParObj()!= excludeLMO &&
   2.140 +			floatimage.at(i)->isVisibleObj() 
   2.141 +		) return floatimage.at(i);
   2.142  
   2.143      return NULL;
   2.144  }
   2.145 @@ -803,9 +797,8 @@
   2.146  	s+=standardFlags->saveToDir(tmpdir,prefix,0);
   2.147  	
   2.148  	// Save FloatImages
   2.149 -	FloatImageObj *fio;
   2.150 -	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   2.151 -		s+=fio->saveToDir (tmpdir,prefix);
   2.152 +	for (int i=0; i<floatimage.size(); ++i)
   2.153 +		s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
   2.154  
   2.155  	// save note
   2.156  	if (!note.isEmpty() )
   2.157 @@ -971,7 +964,8 @@
   2.158  
   2.159  void BranchObj::removeFloatImage (FloatImageObj *fio)
   2.160  {
   2.161 -	floatimage.remove (fio);
   2.162 +	int i=floatimage.indexOf (fio);
   2.163 +	if (i!=-1) floatimage.takeAt (i);
   2.164  	calcBBoxSize();
   2.165  	positionBBox();
   2.166  	requestReposition();
   2.167 @@ -1379,10 +1373,9 @@
   2.168  		if (!b->isHidden())
   2.169  			r=addBBox(b->getTotalBBox(),r);
   2.170  
   2.171 -	FloatImageObj* fio;
   2.172 -	for (fio=floatimage.first();fio ;fio=floatimage.next() )
   2.173 -		if (!fio->isHidden())
   2.174 -			r=addBBox(fio->getTotalBBox(),r);
   2.175 +	for (int i=0; i<floatimage.size(); ++i)
   2.176 +		if (!floatimage.at(i)->isHidden())
   2.177 +			r=addBBox(floatimage.at(i)->getTotalBBox(),r);
   2.178  		
   2.179  	return r;
   2.180  }
     3.1 --- a/branchobj.h	Mon Nov 20 12:12:00 2006 +0000
     3.2 +++ b/branchobj.h	Mon Nov 20 12:12:02 2006 +0000
     3.3 @@ -128,7 +128,7 @@
     3.4  	static BranchObj* itLast;		// iterator for first(), next()
     3.5  	static BranchObj* itFirst;		// first iterator for first(), next()
     3.6      BranchObjPtrList branch;		// all child branches
     3.7 -	Q3PtrList<FloatImageObj> floatimage;	// child images
     3.8 +	QList<FloatImageObj*> floatimage;// child images
     3.9  	Q3PtrList<XLinkObj> xlink;		// xlinks to other branches
    3.10  public:	
    3.11  	float angle;					// used in mainbranch to reorder mainbranches
     4.1 Binary file demos/todo.vym has changed
     5.1 --- a/exports.cpp	Mon Nov 20 12:12:00 2006 +0000
     5.2 +++ b/exports.cpp	Mon Nov 20 12:12:02 2006 +0000
     5.3 @@ -1,8 +1,3 @@
     5.4 -//#include <q3filedialog.h>
     5.5 -//#include <QMessageBox>
     5.6 -//#include <QProcess>
     5.7 -//#include <QTextStream>
     5.8 -
     5.9  #include "exports.h"
    5.10  #include "file.h"
    5.11  #include "linkablemapobj.h"
    5.12 @@ -13,7 +8,7 @@
    5.13  
    5.14  extern Main *mainWindow;
    5.15  extern QDir vymBaseDir;
    5.16 -
    5.17 +extern QString vymName;
    5.18  
    5.19  ExportBase::ExportBase()
    5.20  {
    5.21 @@ -70,7 +65,7 @@
    5.22  		{
    5.23  			if (QFile (fd->selectedFile()).exists() )
    5.24  			{
    5.25 -				QMessageBox mb( __VYM,
    5.26 +				QMessageBox mb( vymName,
    5.27  					QObject::tr("The file %1 exists already.\nDo you want to overwrite it?").arg(fd->selectedFile()), 
    5.28  				QMessageBox::Warning,
    5.29  				QMessageBox::Yes | QMessageBox::Default,
     6.1 --- a/historywindow.cpp	Mon Nov 20 12:12:00 2006 +0000
     6.2 +++ b/historywindow.cpp	Mon Nov 20 12:12:02 2006 +0000
     6.3 @@ -1,7 +1,10 @@
     6.4  #include "historywindow.h"
     6.5 -#include "mapeditor.h"
     6.6 +#include "mainwindow.h"
     6.7 +
     6.8  
     6.9  extern QString iconPath;
    6.10 +extern Settings settings;
    6.11 +extern Main *mainWindow;
    6.12  
    6.13  HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent)
    6.14  {
    6.15 @@ -29,8 +32,25 @@
    6.16  	connect ( ui.undoButton, SIGNAL (clicked()), this, SLOT (undo()));
    6.17  	connect ( ui.redoButton, SIGNAL (clicked()), this, SLOT (redo()));
    6.18  	connect ( ui.historyTable, SIGNAL (itemSelectionChanged()), this, SLOT (select()));
    6.19 +
    6.20 +	// Load Settings
    6.21 +	resize (settings.value ( "/historywindow/geometry/size", QSize(450,600)).toSize());
    6.22 +	move   (settings.value ( "/historywindow/geometry/pos", QPoint (250,50)).toPoint());
    6.23 +
    6.24 +/*
    6.25 +	if (settings.value ( "/historywindow/showWithMain",false).toBool())
    6.26 +		setShowWithMain(true);
    6.27 +	else	
    6.28 +		setShowWithMain(false);
    6.29 +*/
    6.30  }
    6.31  
    6.32 +HistoryWindow::~HistoryWindow()
    6.33 +{
    6.34 +	settings.setValue( "/historywindow/geometry/size", size() );
    6.35 +	settings.setValue( "/historywindow/geometry/pos", pos() );
    6.36 +	//settings.setValue( "/historywindow/showWithMain",showWithMain());
    6.37 +}
    6.38  
    6.39  void HistoryWindow::clearRow(int row)
    6.40  {
    6.41 @@ -122,11 +142,6 @@
    6.42  	ui.historyTable->resizeColumnsToContents();
    6.43  }
    6.44  
    6.45 -void HistoryWindow::setME (MapEditor *me)
    6.46 -{
    6.47 -	mapEditor=me;
    6.48 -}
    6.49 -
    6.50  void HistoryWindow::setStepsTotal (int st)
    6.51  {
    6.52  	// Number of steps + "current" bar
    6.53 @@ -136,15 +151,15 @@
    6.54  
    6.55  void HistoryWindow::undo()
    6.56  {
    6.57 -	mapEditor->undo();
    6.58 +	mainWindow->editUndo();
    6.59  }
    6.60  
    6.61  void HistoryWindow::redo()
    6.62  {
    6.63 -	mapEditor->redo();
    6.64 +	mainWindow->editRedo();
    6.65  }
    6.66  
    6.67  void HistoryWindow::select()
    6.68  {
    6.69 -	mapEditor->gotoStep (ui.historyTable->row (ui.historyTable->selectedItems().first()));
    6.70 +	mainWindow->gotoHistoryStep (ui.historyTable->row (ui.historyTable->selectedItems().first()));
    6.71  }
     7.1 --- a/historywindow.h	Mon Nov 20 12:12:00 2006 +0000
     7.2 +++ b/historywindow.h	Mon Nov 20 12:12:02 2006 +0000
     7.3 @@ -5,8 +5,6 @@
     7.4  #include "ui_historywindow.h"
     7.5  
     7.6  
     7.7 -class MapEditor;
     7.8 -
     7.9  /////////////////////////////////////////////////////////////////////////////
    7.10  class HistoryWindow:public QDialog
    7.11  {
    7.12 @@ -14,8 +12,8 @@
    7.13  
    7.14  public:
    7.15  	HistoryWindow(QWidget* parent = 0);
    7.16 +	~HistoryWindow();
    7.17  	void update (SimpleSettings &);
    7.18 -	void setME (MapEditor *);
    7.19  	void setStepsTotal (int);
    7.20  
    7.21  private slots:	
    7.22 @@ -27,7 +25,6 @@
    7.23  	void clearRow (int);
    7.24  	void updateRow (int, int, SimpleSettings &);
    7.25  	Ui::HistoryWindow ui;
    7.26 -	MapEditor *mapEditor;
    7.27  };
    7.28  
    7.29  
     8.1 --- a/linkablemapobj.cpp	Mon Nov 20 12:12:00 2006 +0000
     8.2 +++ b/linkablemapobj.cpp	Mon Nov 20 12:12:02 2006 +0000
     8.3 @@ -4,7 +4,6 @@
     8.4  #include "branchobj.h"
     8.5  #include "mapeditor.h"
     8.6  
     8.7 -#include "version.h"
     8.8  //Added by qt3to4:
     8.9  #include <Q3PointArray>
    8.10  
     9.1 --- a/main.cpp	Mon Nov 20 12:12:00 2006 +0000
     9.2 +++ b/main.cpp	Mon Nov 20 12:12:02 2006 +0000
     9.3 @@ -1,14 +1,18 @@
     9.4  #include <QApplication>
     9.5  #include <q3network.h>
     9.6  
     9.7 +#include "flagrowobj.h"
     9.8 +#include "mainwindow.h"
     9.9 +#include "options.h"
    9.10  #include "settings.h"
    9.11 -#include "options.h"
    9.12 -#include "mainwindow.h"
    9.13 -#include "flagrowobj.h"
    9.14 +#include "version.h"
    9.15  
    9.16  // Global variables
    9.17  TextEditor *textEditor;			// used in Constr. of LinkableMapObj
    9.18  								// initialized in mainwindow
    9.19 +QString vymName(__VYM_NAME);
    9.20 +QString vymVersion(__VYM_VERSION);
    9.21 +QString vymBuildDate(__VYM_BUILD_DATE);
    9.22  
    9.23  Main *mainWindow;				// used in BranchObj::select()								
    9.24  QString tmpVymDir;				// All temp files go there, created in mainwindow
    9.25 @@ -60,7 +64,7 @@
    9.26  	{
    9.27  		cout << "vym version "<<__VYM_VERSION
    9.28  			<<"  (c) 2004-2006 Uwe Drechsel - "
    9.29 -			<<__BUILD_DATE<<endl;
    9.30 +			<<__VYM_BUILD_DATE<<endl;
    9.31  			
    9.32  		return 0;	
    9.33  	}		
    10.1 --- a/mainwindow.cpp	Mon Nov 20 12:12:00 2006 +0000
    10.2 +++ b/mainwindow.cpp	Mon Nov 20 12:12:02 2006 +0000
    10.3 @@ -2,13 +2,7 @@
    10.4  
    10.5  #include <QtGui>
    10.6  
    10.7 -#include <q3filedialog.h>
    10.8 -#include <Q3StrList>
    10.9 -#include <Q3PtrList>
   10.10 -
   10.11  #include <iostream>
   10.12 -#include <cstdlib>
   10.13 -#include <typeinfo>
   10.14  
   10.15  #include "aboutdialog.h"
   10.16  #include "exportoofiledialog.h"
   10.17 @@ -24,7 +18,6 @@
   10.18  #include "process.h"
   10.19  #include "settings.h"
   10.20  #include "texteditor.h"
   10.21 -#include "version.h"
   10.22  
   10.23  extern TextEditor *textEditor;
   10.24  extern Main *mainWindow;
   10.25 @@ -34,6 +27,9 @@
   10.26  extern int statusbarTime;
   10.27  extern FlagRowObj* standardFlagsDefault;
   10.28  extern FlagRowObj* systemFlagsDefault;
   10.29 +extern QString vymName;
   10.30 +extern QString vymVersion;
   10.31 +extern QString vymBuildDate;
   10.32  
   10.33  QMenu* branchContextMenu;
   10.34  QMenu* branchAddContextMenu;
   10.35 @@ -94,11 +90,9 @@
   10.36  
   10.37  	procBrowser=NULL;
   10.38  
   10.39 -	// FIXME not used currently
   10.40 -	// Set random seed (random used for object IDs)
   10.41 -    // QTime t = QTime::currentTime();		// set random seed
   10.42 -    // srand( t.hour()*12+t.minute()*60+t.second()*60 );
   10.43 -
   10.44 +	// Initialize history window;
   10.45 +	historyWindow=new HistoryWindow();
   10.46 +	// FIXME historyWindow.setStepsTotal(stepsTotal);
   10.47  
   10.48  	// Initialize some settings, which are platform dependant
   10.49  	QString p,s;
   10.50 @@ -178,8 +172,8 @@
   10.51  
   10.52  	settings.setValue ("/mainwindow/state",saveState(0));
   10.53  
   10.54 -	settings.setValue( "/version/version", __VYM_VERSION );
   10.55 -	settings.setValue( "/version/builddate", __BUILD_DATE );
   10.56 +	settings.setValue( "/version/version", vymVersion );
   10.57 +	settings.setValue( "/version/builddate", vymBuildDate );
   10.58  
   10.59  	settings.setValue( "/mapeditor/editmode/autoSelectHeading",actionSettingsAutoSelectHeading->isOn() );
   10.60  	settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
   10.61 @@ -188,8 +182,9 @@
   10.62  	settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
   10.63  	settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
   10.64  
   10.65 -	// To make the texteditor save its settings, call the destructor
   10.66 +	// call the destructors
   10.67  	delete (textEditor);
   10.68 +	delete historyWindow;
   10.69  
   10.70  	// Remove temporary directory
   10.71  	removeDir (QDir(tmpVymDir));
   10.72 @@ -348,8 +343,8 @@
   10.73  	fileMenu->addAction (a);
   10.74      connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
   10.75  
   10.76 -    a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+__VYM, this);
   10.77 -	a->setStatusTip ( tr( "Exit")+" "+__VYM );
   10.78 +    a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
   10.79 +	a->setStatusTip ( tr( "Exit")+" "+vymName );
   10.80  	a->setShortcut (Qt::CTRL + Qt::Key_Q );
   10.81  	fileMenu->addAction (a);
   10.82      connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
   10.83 @@ -942,10 +937,11 @@
   10.84      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
   10.85  	actionViewToggleNoteEditor=a;
   10.86  
   10.87 -    a = new QAction(  tr( "Show history window","View action" ),this );
   10.88 +    a = new QAction(QPixmap(iconPath+"history.png"),  tr( "Show history window","View action" ),this );
   10.89  	a->setStatusTip ( tr( "Show history window" ));
   10.90  	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
   10.91  	a->setToggleAction(false);
   10.92 +    a->addTo( tb );
   10.93  	viewMenu->addAction (a);
   10.94      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
   10.95  	actionViewToggleHistoryWindow=a;
   10.96 @@ -1408,7 +1404,7 @@
   10.97  	helpMenu->addAction (a);
   10.98  
   10.99      a = new QAction( tr( "About VYM","Help action" ), this);
  10.100 -    a->setStatusTip( tr( "About VYM")+" "__VYM);
  10.101 +    a->setStatusTip( tr( "About VYM")+vymName);
  10.102      connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
  10.103  	helpMenu->addAction (a);
  10.104  
  10.105 @@ -1559,7 +1555,7 @@
  10.106  	if (eList.first() =="..") eList.pop_front();	// remove "."
  10.107  	if (!eList.isEmpty())
  10.108  	{
  10.109 -		QMessageBox mb( __VYM,
  10.110 +		QMessageBox mb( vymName,
  10.111  			tr("The directory %1 is not empty.\nDo you risk to overwrite its contents?","write directory").arg(dir),
  10.112  		QMessageBox::Warning,
  10.113  		QMessageBox::Yes ,
  10.114 @@ -1583,9 +1579,9 @@
  10.115  
  10.116  QString Main::browseDirectory (const QString &caption)
  10.117  {
  10.118 -	Q3FileDialog fd(this,caption);
  10.119 -	fd.setMode (Q3FileDialog::DirectoryOnly);
  10.120 -	fd.setCaption(__VYM " - "+caption);
  10.121 +	QFileDialog fd(this,caption);
  10.122 +	fd.setMode (QFileDialog::DirectoryOnly);
  10.123 +	fd.setCaption(vymName+ " - "+caption);
  10.124  	fd.show();
  10.125  	
  10.126  	if ( fd.exec() == QDialog::Accepted )
  10.127 @@ -1602,15 +1598,6 @@
  10.128      return NULL;	
  10.129  }
  10.130  
  10.131 -//TODO not used now, maybe use this for overview window later
  10.132 -void Main::newView() 
  10.133 -{
  10.134 -    // Open a new view... have it delete when closed.
  10.135 -    Main *m = new Main(0, 0, Qt::WDestructiveClose);
  10.136 -    qApp->setMainWidget(m);
  10.137 -    m->show();
  10.138 -    qApp->setMainWidget(0);
  10.139 -}
  10.140  
  10.141  void Main::editorChanged(QWidget *)
  10.142  {
  10.143 @@ -1663,7 +1650,7 @@
  10.144  			if (me->getFilePath() == fn)
  10.145  			{
  10.146  				// Already there, ask for confirmation
  10.147 -				QMessageBox mb( __VYM,
  10.148 +				QMessageBox mb( vymName,
  10.149  					tr("The map %1\nis already opened."
  10.150  					"Opening the same map in multiple editors may lead \n"
  10.151  					"to confusion when finishing working with vym."
  10.152 @@ -1711,7 +1698,7 @@
  10.153  		// from command line
  10.154  		if (!QFile(fn).exists() )
  10.155  		{
  10.156 -			QMessageBox mb( __VYM,
  10.157 +			QMessageBox mb( vymName,
  10.158  				tr("This map does not exist:\n  %1\nDo you want to create a new one?").arg(fn),
  10.159  				QMessageBox::Question,
  10.160  				QMessageBox::Yes ,
  10.161 @@ -1853,13 +1840,13 @@
  10.162  	switch (lmode)
  10.163  	{
  10.164  		case NewMap:
  10.165 -			fd->setCaption(__VYM " - " +tr("Load vym map"));
  10.166 +			fd->setCaption(vymName+ " - " +tr("Load vym map"));
  10.167  			break;
  10.168  		case ImportAdd:
  10.169 -			fd->setCaption(__VYM " - " +tr("Import: Add vym map to selection"));
  10.170 +			fd->setCaption(vymName+ " - " +tr("Import: Add vym map to selection"));
  10.171  			break;
  10.172  		case ImportReplace:
  10.173 -			fd->setCaption(__VYM " - " +tr("Import: Replace selection with vym map"));
  10.174 +			fd->setCaption(vymName+ " - " +tr("Import: Replace selection with vym map"));
  10.175  			break;
  10.176  	}
  10.177  	fd->show();
  10.178 @@ -1937,7 +1924,7 @@
  10.179  			// Look, if we should zip the data:
  10.180  			if (!saveZipped)
  10.181  			{
  10.182 -				QMessageBox mb( __VYM,
  10.183 +				QMessageBox mb( vymName,
  10.184  					tr("The map %1\ndid not use the compressed "
  10.185  					"vym file format.\nWriting it uncompressed will also write images \n"
  10.186  					"and flags and thus may overwrite files in the "
  10.187 @@ -2041,7 +2028,7 @@
  10.188  			// Check for existing file
  10.189  			if (QFile (fn).exists())
  10.190  			{
  10.191 -				QMessageBox mb( __VYM,
  10.192 +				QMessageBox mb( vymName,
  10.193  					tr("The file %1\nexists already. Do you want to").arg(fn),
  10.194  					QMessageBox::Warning,
  10.195  					QMessageBox::Yes | QMessageBox::Default,
  10.196 @@ -2239,7 +2226,7 @@
  10.197  		ExportASCII ex;
  10.198  		ex.setMapCenter(me->getMapCenter());
  10.199  		ex.addFilter ("TXT (*.txt)");
  10.200 -		ex.setCaption(__VYM " -" +tr("Export as ASCII")+" "+tr("(still experimental)"));
  10.201 +		ex.setCaption(vymName+ " -" +tr("Export as ASCII")+" "+tr("(still experimental)"));
  10.202  		if (ex.execDialog() ) 
  10.203  		{
  10.204  			me->setExportMode(true);
  10.205 @@ -2257,7 +2244,7 @@
  10.206  		ExportLaTeX ex;
  10.207  		ex.setMapCenter(me->getMapCenter());
  10.208  		ex.addFilter ("Tex (*.tex)");
  10.209 -		ex.setCaption(__VYM " -" +tr("Export as LaTeX")+" "+tr("(still experimental)"));
  10.210 +		ex.setCaption(vymName+ " -" +tr("Export as LaTeX")+" "+tr("(still experimental)"));
  10.211  		if (ex.execDialog() ) 
  10.212  		{
  10.213  			me->setExportMode(true);
  10.214 @@ -2285,7 +2272,7 @@
  10.215  	if (me)
  10.216  	{
  10.217  		ex.setMapCenter (me->getMapCenter() );
  10.218 -		ex.setCaption ( __VYM " - "+tr("Export to")+" Taskjuggler"+tr("(still experimental)"));
  10.219 +		ex.setCaption ( vymName+" - "+tr("Export to")+" Taskjuggler"+tr("(still experimental)"));
  10.220  		ex.addFilter ("Taskjuggler (*.tjp)");
  10.221  		if (ex.execDialog() ) 
  10.222  		{
  10.223 @@ -2298,13 +2285,13 @@
  10.224  
  10.225  void Main::fileExportOOPresentation()
  10.226  {
  10.227 -	ExportOOFileDialog *fd=new ExportOOFileDialog( this,__VYM " - "+tr("Export to")+" Open Office");
  10.228 +	ExportOOFileDialog *fd=new ExportOOFileDialog( this,vymName+" - "+tr("Export to")+" Open Office");
  10.229  	// TODO add preview in dialog
  10.230  	//ImagePreview *p =new ImagePreview (fd);
  10.231  	//fd->setContentsPreviewEnabled( TRUE );
  10.232  	//fd->setContentsPreview( p, p );
  10.233  	//fd->setPreviewMode( QFileDialog::Contents );
  10.234 -	fd->setCaption(__VYM " - " +tr("Export to")+" Open Office");
  10.235 +	fd->setCaption(vymName+" - " +tr("Export to")+" Open Office");
  10.236  	fd->setDir (QDir().current());
  10.237  	if (fd->foundConfig())
  10.238  	{
  10.239 @@ -2334,7 +2321,7 @@
  10.240  	{
  10.241  		if (currentMapEditor()->hasChanged())
  10.242  		{
  10.243 -			QMessageBox mb( __VYM,
  10.244 +			QMessageBox mb( vymName,
  10.245  				tr("The map %1 has been modified but not saved yet. Do you want to").arg(currentMapEditor()->getFileName()),
  10.246  				QMessageBox::Warning,
  10.247  				QMessageBox::Yes | QMessageBox::Default,
  10.248 @@ -2383,7 +2370,7 @@
  10.249  		if (me->isUnsaved())
  10.250  		{
  10.251  			tabWidget->setCurrentPage(i);
  10.252 -			QMessageBox mb( __VYM,
  10.253 +			QMessageBox mb( vymName,
  10.254  				tr("This map is not saved yet. Do you want to"),
  10.255  				QMessageBox::Warning,
  10.256  				QMessageBox::Yes | QMessageBox::Default,
  10.257 @@ -2423,6 +2410,12 @@
  10.258  		currentMapEditor()->redo();
  10.259  }
  10.260  
  10.261 +void Main::gotoHistoryStep (int i)	   
  10.262 +{
  10.263 +	if (currentMapEditor())
  10.264 +		currentMapEditor()->gotoHistoryStep (i);
  10.265 +}
  10.266 +
  10.267  void Main::editCopy()
  10.268  {
  10.269  	if (currentMapEditor())
  10.270 @@ -3142,8 +3135,16 @@
  10.271  
  10.272  void Main::windowToggleHistory()
  10.273  {
  10.274 -	if (currentMapEditor())
  10.275 -		currentMapEditor()->toggleHistoryWindow();
  10.276 +	if (historyWindow->isVisible())
  10.277 +		historyWindow->hide();
  10.278 +	else	
  10.279 +		historyWindow->show();
  10.280 +
  10.281 +}
  10.282 +
  10.283 +void Main::updateHistory(SimpleSettings &undoSet)
  10.284 +{
  10.285 +	historyWindow->update (undoSet);
  10.286  }
  10.287  
  10.288  void Main::updateNoteFlag()
  10.289 @@ -3410,7 +3411,7 @@
  10.290  	if (!currentMapEditor()) return;
  10.291  	bool ok;
  10.292  	QString com = QInputDialog::getText(
  10.293 -			__VYM, "Enter Command:", QLineEdit::Normal,"command", &ok, this );
  10.294 +			vymName, "Enter Command:", QLineEdit::Normal,"command", &ok, this );
  10.295  	if (ok) currentMapEditor()->parseAtom(com);
  10.296  }
  10.297  
    11.1 --- a/mainwindow.h	Mon Nov 20 12:12:00 2006 +0000
    11.2 +++ b/mainwindow.h	Mon Nov 20 12:12:02 2006 +0000
    11.3 @@ -5,6 +5,7 @@
    11.4  
    11.5  #include "file.h"
    11.6  #include "findwindow.h"
    11.7 +#include "historywindow.h"
    11.8  #include "mapeditor.h"
    11.9  #include "texteditor.h"
   11.10  #include "xml.h"
   11.11 @@ -47,7 +48,6 @@
   11.12  	MapEditor* currentMapEditor() const;
   11.13      
   11.14  private slots:
   11.15 -    void newView();
   11.16  	void editorChanged(QWidget*);
   11.17  
   11.18      ErrorCode fileLoad(QString ,const LoadMode &);
   11.19 @@ -75,8 +75,11 @@
   11.20      void filePrint();
   11.21      void fileExitVYM();
   11.22  
   11.23 +public slots:
   11.24      void editUndo();	
   11.25      void editRedo();	
   11.26 +	void gotoHistoryStep (int);
   11.27 +private slots:	
   11.28      void editCopy();	
   11.29      void editPaste();	
   11.30      void editCut();	
   11.31 @@ -159,6 +162,7 @@
   11.32  
   11.33  	void windowToggleNoteEditor();
   11.34  	void windowToggleHistory();
   11.35 +	void updateHistory(SimpleSettings &);
   11.36  	void updateNoteFlag();
   11.37  	void updateActions();
   11.38  	ModMode getModMode();
   11.39 @@ -191,6 +195,8 @@
   11.40  	QLineEdit *lineedit;	// to enter headings of branches
   11.41  	QString prevSelection;
   11.42  
   11.43 +	HistoryWindow *historyWindow;
   11.44 +
   11.45  	Q3PtrList <QAction> actionListBranches;
   11.46  
   11.47  	QColor currentColor;
    12.1 --- a/mapcenterobj.cpp	Mon Nov 20 12:12:00 2006 +0000
    12.2 +++ b/mapcenterobj.cpp	Mon Nov 20 12:12:02 2006 +0000
    12.3 @@ -2,7 +2,6 @@
    12.4  
    12.5  #include "mapcenterobj.h"
    12.6  #include "floatimageobj.h"
    12.7 -#include "mapeditor.h"
    12.8  
    12.9  /////////////////////////////////////////////////////////////////
   12.10  // MapCenterObj
   12.11 @@ -92,8 +91,8 @@
   12.12  		b->setOrientation();
   12.13  	}
   12.14  	
   12.15 -	FloatObj *fo;
   12.16 -	for (fo=floatimage.first(); fo; fo=floatimage.next() ) fo->setRelPos();
   12.17 +	for (int i=0; i<floatimage.size(); ++i)
   12.18 +		floatimage.at(i)->setRelPos();
   12.19  
   12.20  	if (repositionRequest) reposition();
   12.21  }
   12.22 @@ -113,9 +112,8 @@
   12.23  	if (inBox (p) && (this != excludeLMO) ) return this;
   12.24  
   12.25  	// Search float images
   12.26 -	FloatImageObj *foi;
   12.27 -	for (foi=floatimage.first(); foi; foi=floatimage.next() )
   12.28 -		if (foi->inBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
   12.29 +	for (int i=0; i<floatimage.size(); ++i)
   12.30 +		if (floatimage.at(i)->inBox(p) && (floatimage.at(i) != excludeLMO) && floatimage.at(i)->getParObj()!= excludeLMO) return floatimage.at(i);
   12.31  
   12.32  	// nothing found
   12.33  	return NULL;
   12.34 @@ -168,9 +166,8 @@
   12.35  		s+=bo->saveToDir(tmpdir,prefix, offset);
   12.36  
   12.37  	// Save FloatImages
   12.38 -	FloatImageObj *fio;
   12.39 -	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   12.40 -		s+=fio->saveToDir (tmpdir,prefix);
   12.41 +	for (int i=0; i<floatimage.size(); ++i)
   12.42 +		s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
   12.43  
   12.44  	// Save XLinks
   12.45  	XLinkObj *xlo;
    13.1 --- a/mapcenterobj.h	Mon Nov 20 12:12:00 2006 +0000
    13.2 +++ b/mapcenterobj.h	Mon Nov 20 12:12:02 2006 +0000
    13.3 @@ -5,8 +5,6 @@
    13.4  #include <QDate>
    13.5  
    13.6  #include "branchobj.h"
    13.7 -#include "xlinkobj.h"
    13.8 -#include "version.h"
    13.9  
   13.10  /////////////////////////////////////////////////////////////////////////////
   13.11  class MapCenterObj:public BranchObj {
    14.1 --- a/mapeditor.cpp	Mon Nov 20 12:12:00 2006 +0000
    14.2 +++ b/mapeditor.cpp	Mon Nov 20 12:12:02 2006 +0000
    14.3 @@ -46,6 +46,9 @@
    14.4  extern Settings settings;
    14.5  extern ImageIO imageIO;
    14.6  
    14.7 +extern QString vymName;
    14.8 +extern QString vymVersion;
    14.9 +
   14.10  extern QString iconPath;
   14.11  extern QDir vymBaseDir;
   14.12  extern QDir lastImageDir;
   14.13 @@ -87,16 +90,10 @@
   14.14  	linkstyle=StylePolyParabel;
   14.15  
   14.16  	// Create bitmap cursors, platform dependant
   14.17 -	// FIXME should now work also on Mac...
   14.18 -	//#if defined(Q_OS_MACX)
   14.19 -	//	HandOpenCursor=QCursor ( QPixmap(iconPath+"cursorhandopen16.png"),1,1 );		
   14.20 -	//	PickColorCursor=QCursor ( QPixmap (iconPath+"cursorcolorpicker16.png"), 1,15 ); 
   14.21 -	//#else
   14.22 -		HandOpenCursor=QCursor (QPixmap(iconPath+"cursorhandopen.png"),1,1);		
   14.23 -		PickColorCursor=QCursor ( QPixmap(iconPath+"cursorcolorpicker.png"), 5,27 ); 
   14.24 -		CopyCursor=QCursor ( QPixmap(iconPath+"cursorcopy.png"), 5,5 ); 
   14.25 -		XLinkCursor=QCursor ( QPixmap(iconPath+"cursorxlink.png"), 5,27 ); 
   14.26 -	//#endif
   14.27 +	HandOpenCursor=QCursor (QPixmap(iconPath+"cursorhandopen.png"),1,1);		
   14.28 +	PickColorCursor=QCursor ( QPixmap(iconPath+"cursorcolorpicker.png"), 5,27 ); 
   14.29 +	CopyCursor=QCursor ( QPixmap(iconPath+"cursorcopy.png"), 1,1 ); 
   14.30 +	XLinkCursor=QCursor ( QPixmap(iconPath+"cursorxlink.png"), 1,7 ); 
   14.31  
   14.32  	setFocusPolicy (Qt::StrongFocus);
   14.33  
   14.34 @@ -146,10 +143,6 @@
   14.35  
   14.36  	mapCenter->reposition();	//	for positioning heading
   14.37  
   14.38 -	// Initialize history window;
   14.39 -	historyWindow.setME(this);
   14.40 -	historyWindow.setStepsTotal(stepsTotal);
   14.41 -	historyWindow.update (undoSet);
   14.42  }
   14.43  
   14.44  MapEditor::~MapEditor()
   14.45 @@ -299,7 +292,7 @@
   14.46  	if (linkcolorhint==HeadingColor) 
   14.47  		colhint=attribut("linkColorHint","HeadingColor");
   14.48  
   14.49 -	QString mapAttr=attribut("version",__VYM_VERSION);
   14.50 +	QString mapAttr=attribut("version",vymVersion);
   14.51  	if (!saveSel || saveSel==mapCenter)
   14.52  		mapAttr+= attribut("author",mapCenter->getAuthor()) +
   14.53  				  attribut("comment",mapCenter->getComment()) +
   14.54 @@ -487,7 +480,7 @@
   14.55  	undoSet.setEntry (QString("/history/step-%1/redoCommand").arg(curStep),redoCom);
   14.56  	undoSet.setEntry (QString("/history/step-%1/redoSelection").arg(curStep),redoSelection);
   14.57  	undoSet.setEntry (QString("/history/step-%1/comment").arg(curStep),comment);
   14.58 -	undoSet.setEntry (QString("/history/version"),__VYM_VERSION);
   14.59 +	undoSet.setEntry (QString("/history/version"),vymVersion);
   14.60  	undoSet.writeSettings(histPath);
   14.61  
   14.62  	/* TODO remove after testing
   14.63 @@ -506,7 +499,7 @@
   14.64  	if (saveSel) cout << "    saveSel="<<saveSel->getSelectString().ascii()<<endl;
   14.65  	cout << "    ---------------------------"<<endl;
   14.66  
   14.67 -	historyWindow.update (undoSet);
   14.68 +	mainWindow->updateHistory (undoSet);
   14.69  	setChanged();
   14.70  	updateActions();
   14.71  }
   14.72 @@ -962,14 +955,6 @@
   14.73  	} 
   14.74  }
   14.75  
   14.76 -void MapEditor::toggleHistoryWindow()
   14.77 -{
   14.78 -	if (historyWindow.isVisible())
   14.79 -		historyWindow.hide();
   14.80 -	else	
   14.81 -		historyWindow.show();
   14.82 -}
   14.83 -
   14.84  
   14.85  bool MapEditor::isDefault()
   14.86  {
   14.87 @@ -1033,9 +1018,6 @@
   14.88  
   14.89  		// Forget the .vym (or .xml) for name of map
   14.90  		mapName=fileName.left(fileName.findRev(".",-1,true) );
   14.91 -
   14.92 -		// Adjust history window
   14.93 -		historyWindow.setCaption (__VYM " - " +tr("History for ")+fileName);
   14.94  	}
   14.95  }
   14.96  
   14.97 @@ -1493,7 +1475,7 @@
   14.98  
   14.99  	if (!checkVersion(version))
  14.100  		QMessageBox::warning(0,tr("Warning"),
  14.101 -			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(__VYM_VERSION));
  14.102 +			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(vymVersion));
  14.103  
  14.104  
  14.105  	// Find out current undo directory
  14.106 @@ -1514,7 +1496,6 @@
  14.107  	cout << "    ---------------------------"<<endl<<endl;
  14.108  
  14.109  	// select  object before redo
  14.110 -	// FIXME better give up if no selection there...
  14.111  	if (!redoSelection.isEmpty())
  14.112  		select (redoSelection);
  14.113  
  14.114 @@ -1529,16 +1510,16 @@
  14.115  	undoSet.setEntry ("/history/curStep",QString::number(curStep));
  14.116  	undoSet.writeSettings(histPath);
  14.117  
  14.118 -	historyWindow.update (undoSet);
  14.119 +	mainWindow->updateHistory (undoSet);
  14.120  	updateActions();
  14.121  
  14.122  	/* TODO remove testing
  14.123 -*/
  14.124  	cout << "ME::redo() end\n";
  14.125  	cout << "    undosAvail="<<undosAvail<<endl;
  14.126  	cout << "    redosAvail="<<redosAvail<<endl;
  14.127  	cout << "       curStep="<<curStep<<endl;
  14.128  	cout << "    ---------------------------"<<endl<<endl;
  14.129 +	*/
  14.130  
  14.131  
  14.132  }
  14.133 @@ -1572,7 +1553,7 @@
  14.134  
  14.135  	if (!checkVersion(version))
  14.136  		QMessageBox::warning(0,tr("Warning"),
  14.137 -			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(__VYM_VERSION));
  14.138 +			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(vymVersion));
  14.139  
  14.140  	// Find out current undo directory
  14.141  	QString bakMapDir=QDir::convertSeparators (QString(tmpMapDir+"/undo-%1").arg(curStep));
  14.142 @@ -1605,19 +1586,19 @@
  14.143  
  14.144  	blockSaveState=false;
  14.145  /* TODO remove testing
  14.146 -*/
  14.147  	cout << "ME::undo() end\n";
  14.148  	cout << "    undosAvail="<<undosAvail<<endl;
  14.149  	cout << "    redosAvail="<<redosAvail<<endl;
  14.150  	cout << "       curStep="<<curStep<<endl;
  14.151  	cout << "    ---------------------------"<<endl<<endl;
  14.152 +*/
  14.153  
  14.154  	undoSet.setEntry ("/history/undosAvail",QString::number(undosAvail));
  14.155  	undoSet.setEntry ("/history/redosAvail",QString::number(redosAvail));
  14.156  	undoSet.setEntry ("/history/curStep",QString::number(curStep));
  14.157  	undoSet.writeSettings(histPath);
  14.158  
  14.159 -	historyWindow.update (undoSet);
  14.160 +	mainWindow->updateHistory (undoSet);
  14.161  	updateActions();
  14.162  }
  14.163  
  14.164 @@ -1629,14 +1610,12 @@
  14.165  		return false;
  14.166  }
  14.167  
  14.168 -void MapEditor::gotoStep (int i)
  14.169 +void MapEditor::gotoHistoryStep (int i)
  14.170  {
  14.171  	// Restore variables
  14.172  	int undosAvail=undoSet.readNumEntry (QString("/history/undosAvail"));
  14.173  	int redosAvail=undoSet.readNumEntry (QString("/history/redosAvail"));
  14.174  
  14.175 -	cout << "ME::goto "<<i<<endl;
  14.176 -	
  14.177  	if (i<0) i=undosAvail+redosAvail;
  14.178  
  14.179  	// Clicking above current step makes us undo things
  14.180 @@ -2759,11 +2738,13 @@
  14.181  			typeid(*selection) == typeid(MapCenterObj)) )
  14.182  	{		
  14.183  		BranchObj *bo=(BranchObj*)selection;
  14.184 -		Q3FileDialog *fd=new Q3FileDialog( this,__VYM " - " +tr("Link to another map"));
  14.185 -		fd->addFilter (QString (tr("vym map") + " (*.vym)"));
  14.186 -		fd->setCaption(__VYM " - " +tr("Link to another map"));
  14.187 +		QStringList filters;
  14.188 +		filters <<"VYM map (*.vym)";
  14.189 +		QFileDialog *fd=new QFileDialog( this,vymName+" - " +tr("Link to another map"));
  14.190 +		fd->setFilters (filters);
  14.191 +		fd->setCaption(vymName+" - " +tr("Link to another map"));
  14.192  		if (! bo->getVymLink().isEmpty() )
  14.193 -			fd->setSelection( bo->getVymLink() );
  14.194 +			fd->selectFile( bo->getVymLink() );
  14.195  		fd->show();
  14.196  
  14.197  		QString fn;
  14.198 @@ -3163,7 +3144,7 @@
  14.199  		fd->setContentsPreviewEnabled( TRUE );
  14.200  		fd->setContentsPreview( p, p );
  14.201  		fd->setPreviewMode( Q3FileDialog::Contents );
  14.202 -		fd->setCaption(__VYM " - " +tr("Load image"));
  14.203 +		fd->setCaption(vymName+" - " +tr("Load image"));
  14.204  		fd->setDir (lastImageDir);
  14.205  		fd->show();
  14.206  
  14.207 @@ -3210,7 +3191,7 @@
  14.208  		FloatImageObj *fio=((FloatImageObj*)selection);
  14.209  		QFileDialog *fd=new QFileDialog( this);
  14.210  		fd->setFilters (imageIO.getFilters());
  14.211 -		fd->setCaption(__VYM " - " +tr("Save image"));
  14.212 +		fd->setCaption(vymName+" - " +tr("Save image"));
  14.213  		fd->setFileMode( QFileDialog::AnyFile );
  14.214  		fd->setDirectory (lastImageDir);
  14.215  //		fd->setSelection (fio->getOriginalFilename());
  14.216 @@ -3221,7 +3202,7 @@
  14.217  		{
  14.218  			if (QFile (fd->selectedFile()).exists() )
  14.219  			{
  14.220 -				QMessageBox mb( __VYM,
  14.221 +				QMessageBox mb( vymName,
  14.222  					tr("The file %1 exists already.\n"
  14.223  					"Do you want to overwrite it?").arg(fd->selectedFile()),
  14.224  				QMessageBox::Warning,
  14.225 @@ -3344,10 +3325,12 @@
  14.226  		(typeid(*selection) == typeid(BranchObj)) || 
  14.227  		(typeid(*selection) == typeid(MapCenterObj))  )
  14.228  	{
  14.229 -		Q3FileDialog *fd=new Q3FileDialog( this,__VYM " - " +tr("Choose directory structure to import"));
  14.230 -		fd->setMode (Q3FileDialog::DirectoryOnly);
  14.231 -		fd->addFilter (QString (tr("vym map") + " (*.vym)"));
  14.232 -		fd->setCaption(__VYM " - " +tr("Choose directory structure to import"));
  14.233 +		QStringList filters;
  14.234 +		filters <<"VYM map (*.vym)";
  14.235 +		QFileDialog *fd=new QFileDialog( this,vymName+ " - " +tr("Choose directory structure to import"));
  14.236 +		fd->setMode (QFileDialog::DirectoryOnly);
  14.237 +		fd->setFilters (filters);
  14.238 +		fd->setCaption(vymName+" - " +tr("Choose directory structure to import"));
  14.239  		fd->show();
  14.240  
  14.241  		QString fn;
    15.1 --- a/mapeditor.h	Mon Nov 20 12:12:00 2006 +0000
    15.2 +++ b/mapeditor.h	Mon Nov 20 12:12:02 2006 +0000
    15.3 @@ -6,7 +6,6 @@
    15.4  
    15.5  #include "mapcenterobj.h"
    15.6  #include "file.h"
    15.7 -#include "historywindow.h"
    15.8  #include "misc.h"
    15.9  #include "selection.h"
   15.10  #include "settings.h"
   15.11 @@ -79,7 +78,7 @@
   15.12  	bool isRedoAvailable();
   15.13      void undo();		// undo last action
   15.14  	bool isUndoAvailable();
   15.15 -	void gotoStep (int);// goto a step in history
   15.16 +	void gotoHistoryStep (int);// goto a step in history
   15.17  private:	
   15.18      void addMapReplaceInt(const QString & undoSel, const QString & path);
   15.19      void addMapInsertInt (const QString & path, int pos);
   15.20 @@ -261,9 +260,6 @@
   15.21  	Q3UrlOperator *urlOperator;
   15.22  	QDataStream *imageData;
   15.23  	QBuffer *imageBuffer;
   15.24 -
   15.25 -	HistoryWindow historyWindow;
   15.26 -
   15.27  };
   15.28  #endif
   15.29  
    16.1 --- a/texteditor.cpp	Mon Nov 20 12:12:00 2006 +0000
    16.2 +++ b/texteditor.cpp	Mon Nov 20 12:12:02 2006 +0000
    16.3 @@ -5,14 +5,16 @@
    16.4  #include <typeinfo>
    16.5  
    16.6  #include "noteobj.h"
    16.7 +#include "settings.h"
    16.8  #include "version.h"
    16.9  
   16.10  extern int statusbarTime;
   16.11 -extern QSettings settings;
   16.12 +extern Settings settings;
   16.13  
   16.14  extern QAction *actionViewToggleNoteEditor;
   16.15  
   16.16  extern QString iconPath;
   16.17 +extern QString vymName;
   16.18  
   16.19  using namespace std;
   16.20  
   16.21 @@ -35,7 +37,7 @@
   16.22  	connect (e, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
   16.23      setCentralWidget( e );
   16.24      statusBar()->message( tr("Ready","Statusbar message"), statusbarTime);
   16.25 -	setCaption(__VYM " - " +tr ("Note Editor","Window caption"));
   16.26 +	setCaption(vymName +" - " +tr ("Note Editor","Window caption"));
   16.27  
   16.28  
   16.29  	connect(e, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
   16.30 @@ -454,7 +456,7 @@
   16.31  	{
   16.32  		if (e->text().length()) 
   16.33  		{
   16.34 -			QMessageBox mb( __VYM " - " +tr("Note Editor"),
   16.35 +			QMessageBox mb( vymName + " - " +tr("Note Editor"),
   16.36  				"Loading will overwrite the existing note",
   16.37  				QMessageBox::Warning,
   16.38  				QMessageBox::Yes | QMessageBox::Default,
   16.39 @@ -558,7 +560,7 @@
   16.40  		QFile file (fn);
   16.41  		if (file.exists())
   16.42  		{
   16.43 -			QMessageBox mb( __VYM,
   16.44 +			QMessageBox mb( vymName,
   16.45  				tr("The file %1\nexists already.\nDo you want to overwrite it?","dialog 'save note as'").arg(fn),
   16.46  			QMessageBox::Warning,
   16.47  			QMessageBox::Yes | QMessageBox::Default,
   16.48 @@ -633,7 +635,7 @@
   16.49  		QFile file (fn);
   16.50  		if (file.exists())
   16.51  		{
   16.52 -			QMessageBox mb( __VYM,
   16.53 +			QMessageBox mb( vymName,
   16.54  				tr("The file %1\nexists already.\nDo you want to overwrite it?","dialog 'save note as'").arg(fn),
   16.55  			QMessageBox::Warning,
   16.56  			QMessageBox::Yes | QMessageBox::Default,
    17.1 --- a/version.cpp	Mon Nov 20 12:12:00 2006 +0000
    17.2 +++ b/version.cpp	Mon Nov 20 12:12:02 2006 +0000
    17.3 @@ -32,4 +32,4 @@
    17.4  		return false;
    17.5  	return true;	
    17.6  
    17.7 -}
    17.8 \ No newline at end of file
    17.9 +}
    18.1 --- a/version.h	Mon Nov 20 12:12:00 2006 +0000
    18.2 +++ b/version.h	Mon Nov 20 12:12:02 2006 +0000
    18.3 @@ -3,9 +3,9 @@
    18.4  
    18.5  #include <QString>
    18.6  
    18.7 -#define __VYM "VYM"
    18.8 +#define __VYM_NAME "VYM"
    18.9  #define __VYM_VERSION "1.8.59"
   18.10 -#define __BUILD_DATE "November 16, 2006"
   18.11 +#define __VYM_BUILD_DATE "November 20, 2006"
   18.12  
   18.13  
   18.14  bool checkVersion(const QString &);
    19.1 --- a/xml.cpp	Mon Nov 20 12:12:00 2006 +0000
    19.2 +++ b/xml.cpp	Mon Nov 20 12:12:02 2006 +0000
    19.3 @@ -3,14 +3,12 @@
    19.4  #include <qmessagebox.h>
    19.5  #include <qcolor.h>
    19.6  #include <q3stylesheet.h>
    19.7 -//Added by qt3to4:
    19.8  #include <QTextStream>
    19.9  #include <iostream>
   19.10  
   19.11  #include "misc.h"
   19.12  #include "settings.h"
   19.13  #include "linkablemapobj.h"
   19.14 -
   19.15  #include "version.h"
   19.16  
   19.17  static BranchObj *lastBranch;
   19.18 @@ -18,6 +16,7 @@
   19.19  static OrnamentedObj *lastOO;
   19.20  
   19.21  extern Settings settings;
   19.22 +extern QString vymVersion;
   19.23  
   19.24  mapBuilderHandler::mapBuilderHandler() {}
   19.25  
   19.26 @@ -67,7 +66,7 @@
   19.27  				   "<h3>Map is newer than VYM</h3>"
   19.28  				   "<p>The map you are just trying to load was "
   19.29  				   "saved using vym " +atts.value("version")+". "
   19.30 -				   "The version of this vym is " __VYM_VERSION
   19.31 +				   "The version of this vym is " + vymVersion + 
   19.32  				   ". If you run into problems after pressing "
   19.33  				   "the ok-button below, updating vym should help.");
   19.34  			else