Moved the qt4-port branch to HEAD
authorinsilmaril
Tue Sep 05 09:47:13 2006 +0000 (2006-09-05)
changeset 3647b74fa3772bf
parent 363 3dc98c8843bc
child 365 1cc73bd7ee1f
Moved the qt4-port branch to HEAD
aboutdialog.cpp
aboutdialog.h
api.cpp
branchobj.cpp
branchobj.h
exportxhtmldialog.ui.h
findwindow.cpp
findwindow.h
mapcenterobj.cpp
mapcenterobj.h
selection.cpp
selection.h
toolbars.h
     1.1 --- a/aboutdialog.cpp	Tue Aug 01 09:30:57 2006 +0000
     1.2 +++ b/aboutdialog.cpp	Tue Sep 05 09:47:13 2006 +0000
     1.3 @@ -1,5 +1,6 @@
     1.4 -#include <qmime.h>
     1.5 -#include <qprocess.h>
     1.6 +#include <QProcess>
     1.7 +#include <QVBoxLayout>
     1.8 +#include <QFrame>
     1.9  
    1.10  #include "aboutdialog.h"
    1.11  #include "version.h"
    1.12 @@ -18,9 +19,9 @@
    1.13      mainLayout=new QVBoxLayout( this, 10);
    1.14  
    1.15      tabs=new QTabWidget (this);
    1.16 -    credits=new AboutTextBrowser (this,"credits");
    1.17 +    credits=new AboutTextBrowser (parent,"credits");
    1.18  
    1.19 -    credits->setText (
    1.20 +    credits->setHtml(
    1.21  	"<center><img src=\""+iconPath+"vym-128x128.png\"></center>"
    1.22  	"<h3><center>VYM - View Your Mind </h3>"
    1.23  	"<p align=\"center\"> A tool to put the things you have got in your mind into a map.</p>"
    1.24 @@ -52,11 +53,12 @@
    1.25      credits->setFrameStyle( QFrame::Panel | QFrame::Plain );
    1.26      tabs->addTab (credits,"Credits");
    1.27  
    1.28 -    license=new AboutTextBrowser (this,"license");
    1.29 -	//license->setTextFormat (PlainText);
    1.30 +    license=new AboutTextBrowser (parent,"license");
    1.31      license->setText (
    1.32 +	"<center>"
    1.33  	"<h3>VYM - View Your Mind</h3>"
    1.34 -    "<p>Copyright (C) 2004-2005  Uwe Drechsel</p>"  
    1.35 +    "<p>Copyright (C) 2004-2006  Uwe Drechsel</p>"  
    1.36 +	"</center>"
    1.37  
    1.38      "<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>"
    1.39  
    1.40 @@ -185,19 +187,9 @@
    1.41      
    1.42  }
    1.43  
    1.44 -void AboutTextBrowser::setSource(const QString &name)
    1.45 +void AboutTextBrowser::setSource(const QUrl &url )
    1.46  {
    1.47 -    QMimeSourceFactory *factory = QMimeSourceFactory::defaultFactory();
    1.48 -    const QMimeSource *data = factory->data(name);
    1.49 -    if (data) {
    1.50 -	QTextBrowser::setSource(name);
    1.51 -    } else {
    1.52 -	QProcess *proc = new QProcess( this );
    1.53 -	proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL" ));
    1.54 -	proc->addArgument( name);
    1.55 -	
    1.56 -	if ( !proc->start() ) 
    1.57 -	    if (mainWindow->settingsURL() ) 
    1.58 -		setSource(name);
    1.59 -    }
    1.60 +	QProcess *proc= new QProcess ();
    1.61 +	proc->start( settings.value("/mainwindow/readerURL").toString(),QStringList ()<<url.toString());
    1.62 +	if (!proc->waitForStarted() &&mainWindow->settingsURL() ) setSource(url);
    1.63  }
     2.1 --- a/aboutdialog.h	Tue Aug 01 09:30:57 2006 +0000
     2.2 +++ b/aboutdialog.h	Tue Sep 05 09:47:13 2006 +0000
     2.3 @@ -1,12 +1,12 @@
     2.4  #ifndef ABOUTDIALOG_H
     2.5  #define ABOUTDIALOG_H
     2.6  
     2.7 -#include <qtabwidget.h>
     2.8 -#include <qtextbrowser.h>
     2.9 -#include <qlayout.h>
    2.10 -#include <qdialog.h>
    2.11 -#include <qpushbutton.h>
    2.12 -#include <qstring.h>
    2.13 +#include <QTabWidget>
    2.14 +#include <QTextBrowser>
    2.15 +#include <QLayout>
    2.16 +#include <QDialog>
    2.17 +#include <QPushButton>
    2.18 +#include <QString>
    2.19  
    2.20  class AboutTextBrowser;
    2.21  /////////////////////////////////////////////////////////////////////////////
    2.22 @@ -22,9 +22,9 @@
    2.23  	AboutTextBrowser *credits;
    2.24  	AboutTextBrowser *license;
    2.25  
    2.26 -	QBoxLayout *mainLayout;
    2.27 -	QBoxLayout *topLayout;
    2.28 -	QBoxLayout *bottomLayout;
    2.29 +	QLayout *mainLayout;
    2.30 +	QLayout *topLayout;
    2.31 +	QLayout *bottomLayout;
    2.32  	QPushButton *okbutton;
    2.33  	
    2.34  };
    2.35 @@ -35,7 +35,7 @@
    2.36   public:
    2.37    AboutTextBrowser(QWidget *parent, const char *name = 0);
    2.38   public slots:
    2.39 -   void setSource(const QString &name);
    2.40 +	virtual void setSource(const QUrl &url);
    2.41  };
    2.42  
    2.43  #endif
     3.1 --- a/api.cpp	Tue Aug 01 09:30:57 2006 +0000
     3.2 +++ b/api.cpp	Tue Sep 05 09:47:13 2006 +0000
     3.3 @@ -126,9 +126,7 @@
     3.4  int API::parInt (bool &ok,const uint &index)
     3.5  {
     3.6  	if (checkParamIsInt (index))
     3.7 -	{
     3.8  		return paramList[index].toInt (&ok, 10);
     3.9 -	}
    3.10  	ok=false;
    3.11  	return 0;
    3.12  }
     4.1 --- a/branchobj.cpp	Tue Aug 01 09:30:57 2006 +0000
     4.2 +++ b/branchobj.cpp	Tue Sep 05 09:47:13 2006 +0000
     4.3 @@ -14,6 +14,7 @@
     4.4  /////////////////////////////////////////////////////////////////
     4.5  
     4.6  BranchObj* BranchObj::itLast=NULL;
     4.7 +BranchObj* BranchObj::itFirst=NULL;
     4.8  
     4.9  
    4.10  BranchObj::BranchObj () :OrnamentedObj()
    4.11 @@ -24,14 +25,14 @@
    4.12      depth=-1;
    4.13  }
    4.14  
    4.15 -BranchObj::BranchObj (QCanvas* c):OrnamentedObj (c)
    4.16 +BranchObj::BranchObj (Q3Canvas* c):OrnamentedObj (c)
    4.17  {
    4.18  //    cout << "Const BranchObj (c)  called from MapCenterObj (c)\n";
    4.19  	parObj=NULL;
    4.20      canvas=c;
    4.21  }
    4.22  
    4.23 -BranchObj::BranchObj (QCanvas* c, LinkableMapObj* p):OrnamentedObj (c)
    4.24 +BranchObj::BranchObj (Q3Canvas* c, LinkableMapObj* p):OrnamentedObj (c)
    4.25  {
    4.26  //    cout << "Const BranchObj (c,p)\n";
    4.27      canvas=c;
    4.28 @@ -72,7 +73,7 @@
    4.29      return angle == other.angle;
    4.30  }
    4.31  
    4.32 -int BranchObjPtrList::compareItems ( QPtrCollection::Item i, QPtrCollection::Item j)
    4.33 +int BranchObjPtrList::compareItems ( Q3PtrCollection::Item i, Q3PtrCollection::Item j)
    4.34  {
    4.35  	// Make sure PtrList::find works
    4.36  	if (i==j) return 0;
    4.37 @@ -149,7 +150,7 @@
    4.38  int BranchObj::getNum()
    4.39  {
    4.40  	if (parObj)
    4.41 -		return ((BranchObj*)(parObj))->getNum ((BranchObj*)(this));
    4.42 +		return ((BranchObj*)parObj)->getNum (this);
    4.43  	else
    4.44  		return 0;
    4.45  }
    4.46 @@ -158,9 +159,10 @@
    4.47  {
    4.48  	// keep current pointer in branch, 
    4.49  	// otherwise save might fail
    4.50 -	int cur=branch.at();
    4.51 +	// FIXME is this _really_ still true?
    4.52 +//	int cur=branch.at();
    4.53  	int ind=branch.findRef (bo);
    4.54 -	branch.at(cur);
    4.55 +//	branch.at(cur);
    4.56  	return ind;
    4.57  }
    4.58  
    4.59 @@ -406,6 +408,7 @@
    4.60  BranchObj* BranchObj::first()
    4.61  {
    4.62  	itLast=NULL;	
    4.63 +	itFirst=this;
    4.64  	return this; 
    4.65  }
    4.66  	
    4.67 @@ -416,15 +419,17 @@
    4.68  	BranchObj *po=(BranchObj*)(parObj);
    4.69  
    4.70  	if (!itLast)
    4.71 -	{	// We are just beginning at the mapCenter
    4.72 +	{
    4.73  		if (bo) 
    4.74 -		{
    4.75 +		{	// We are just beginning, 
    4.76 +			// return first child  
    4.77  			itLast=this;
    4.78  			return bo;
    4.79  		}	
    4.80  		else
    4.81  		{
    4.82 -			itLast=NULL;
    4.83 +			// No childs
    4.84 +			itLast=this;
    4.85  			return NULL;
    4.86  		}	
    4.87  	}
    4.88 @@ -457,7 +462,7 @@
    4.89  		}
    4.90  	}
    4.91  
    4.92 -	// Try to find last child, we came from, in my own childs
    4.93 +	// Try to find last child, where we came from, in my own childs
    4.94  	bool searching=true;
    4.95  	while (bo && searching)
    4.96  	{
    4.97 @@ -476,6 +481,7 @@
    4.98  		{
    4.99  			if (po)
   4.100  			{
   4.101 +				if (this==itFirst) return NULL;	// Stop at starting point
   4.102  				// go up
   4.103  				itLast=this;
   4.104  				lmo=po->next();
   4.105 @@ -791,6 +797,11 @@
   4.106  	// save names of flags set
   4.107  	s+=standardFlags->saveToDir(tmpdir,prefix,0);
   4.108  	
   4.109 +	// Save FloatImages
   4.110 +	FloatImageObj *fio;
   4.111 +	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   4.112 +		s+=fio->saveToDir (tmpdir,prefix,offset);
   4.113 +
   4.114  	// save note
   4.115  	if (!note.isEmpty() )
   4.116  		s+=note.saveToDir();
   4.117 @@ -800,14 +811,8 @@
   4.118      for (bo=branch.first(); bo; bo=branch.next() )
   4.119  		s+=bo->saveToDir(tmpdir,prefix,offset);
   4.120  
   4.121 -	// Save FloatImages
   4.122 -	FloatImageObj *fio;
   4.123 -	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   4.124 -		s+=fio->saveToDir (tmpdir,prefix,offset);
   4.125 -
   4.126  	// Save XLinks
   4.127  	XLinkObj *xlo;
   4.128 -	//FIXME exponential increase in xlinks...
   4.129  	QString ol;	// old link
   4.130  	QString cl;	// current link
   4.131      for (xlo=xlink.first(); xlo; xlo=xlink.next() )
   4.132 @@ -877,7 +882,6 @@
   4.133  	calcBBoxSize();
   4.134  	positionBBox();
   4.135  	requestReposition();
   4.136 -	//FIXME undo needed
   4.137  }
   4.138  
   4.139  bool BranchObj::getIncludeImagesVer()
   4.140 @@ -891,7 +895,6 @@
   4.141  	calcBBoxSize();
   4.142  	positionBBox();
   4.143  	requestReposition();
   4.144 -	//FIXME undo needed
   4.145  }
   4.146  
   4.147  bool BranchObj::getIncludeImagesHor()
   4.148 @@ -925,7 +928,6 @@
   4.149  	positionBBox();
   4.150  	requestReposition();
   4.151  	return newfi;
   4.152 -	//FIXME undo needed
   4.153  }
   4.154  
   4.155  LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
   4.156 @@ -941,7 +943,6 @@
   4.157  	positionBBox();
   4.158  	requestReposition();
   4.159  	return newfi;
   4.160 -	// FIMXE undo needed
   4.161  }
   4.162  
   4.163  FloatImageObj* BranchObj::getFirstFloatImage ()
   4.164 @@ -1150,7 +1151,7 @@
   4.165  
   4.166  bool BranchObj::canMoveBranchUp() 
   4.167  {
   4.168 -	if (!parObj) return false;
   4.169 +	if (!parObj || depth==1) return false;
   4.170  	BranchObj* par=(BranchObj*)parObj;
   4.171  	if (this==par->getFirstBranch())
   4.172  		return false;
   4.173 @@ -1158,23 +1159,24 @@
   4.174  		return true;
   4.175  }
   4.176  
   4.177 -BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
   4.178 +BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // modify my childlist
   4.179  {
   4.180  	savePosInAngle();
   4.181      int i=branch.find(bo1);
   4.182 +	cout << "BO: i="<<i<<endl;
   4.183      if (i>0) 
   4.184  	{	// -1 if bo1 not found 
   4.185  		branch.at(i)->angle--;
   4.186  		branch.at(i-1)->angle++;
   4.187  		branch.sort();
   4.188 -		return branch.at(i-1);
   4.189 +		return branch.at(i);
   4.190  	} else
   4.191 -		return branch.at(i);
   4.192 +		return NULL;
   4.193  }
   4.194  
   4.195  bool BranchObj::canMoveBranchDown() 
   4.196  {
   4.197 -	if (!parObj) return false;
   4.198 +	if (!parObj|| depth==1) return false;
   4.199  	BranchObj* par=(BranchObj*)parObj;
   4.200  	if (this==par->getLastBranch())
   4.201  		return false;
   4.202 @@ -1182,7 +1184,7 @@
   4.203  		return true;
   4.204  }
   4.205  
   4.206 -BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
   4.207 +BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)// modify my childlist
   4.208  {
   4.209  	savePosInAngle();
   4.210      int i=branch.find(bo1);
   4.211 @@ -1193,9 +1195,9 @@
   4.212  		branch.at(i)->angle++;
   4.213  		branch.at(j)->angle--;
   4.214  		branch.sort();
   4.215 -		return branch.at(j);
   4.216 +		return branch.at(i);
   4.217  	} else
   4.218 -		return branch.at(i);
   4.219 +		return NULL;
   4.220  }
   4.221  
   4.222  BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos)
   4.223 @@ -1203,7 +1205,7 @@
   4.224  	// Find current parent and 
   4.225  	// remove pointer to myself there
   4.226  	if (!dst) return NULL;
   4.227 -	BranchObj *par=(BranchObj*)(parObj);
   4.228 +	BranchObj *par=(BranchObj*)parObj;
   4.229  	if (par)
   4.230  		par->removeBranchPtr (this);
   4.231  	else
   4.232 @@ -1248,7 +1250,7 @@
   4.233  
   4.234  	// If I am the mapcenter or a mainbranch, reposition heading
   4.235  	if (depth<2)
   4.236 -	{	//FIXME ugly! optimize this   move for MCO needed to initially position text in box...
   4.237 +	{
   4.238  		if (depth==1)
   4.239  			// Calc angle to mapCenter if I am a mainbranch
   4.240  			// needed for reordering the mainbranches clockwise 
   4.241 @@ -1447,7 +1449,7 @@
   4.242  	if (!status.isEmpty()) mainWindow->statusMessage (status);
   4.243  
   4.244  	// Update Toolbar
   4.245 -	standardFlags->updateToolbar();
   4.246 +	updateFlagsToolbar();
   4.247  
   4.248  	// Update actions in mapeditor
   4.249  	mapEditor->updateActions();
     5.1 --- a/branchobj.h	Tue Aug 01 09:30:57 2006 +0000
     5.2 +++ b/branchobj.h	Tue Sep 05 09:47:13 2006 +0000
     5.3 @@ -5,10 +5,12 @@
     5.4  #include "linkablemapobj.h"
     5.5  #include "ornamentedobj.h"
     5.6  #include "xlinkobj.h"
     5.7 +//Added by qt3to4:
     5.8 +#include <Q3PtrList>
     5.9  
    5.10 -class BranchObjPtrList : public QPtrList<BranchObj>
    5.11 +class BranchObjPtrList : public Q3PtrList<BranchObj>
    5.12  {
    5.13 -	virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
    5.14 +	virtual int compareItems (Q3PtrCollection::Item i, Q3PtrCollection::Item j);
    5.15  };
    5.16  
    5.17  enum BranchModification {NewBranch, MovedBranch};
    5.18 @@ -18,8 +20,8 @@
    5.19  class BranchObj:public OrnamentedObj {
    5.20  public:
    5.21      BranchObj ();
    5.22 -    BranchObj (QCanvas*);
    5.23 -    BranchObj (QCanvas*, LinkableMapObj* parent);
    5.24 +    BranchObj (Q3Canvas*);
    5.25 +    BranchObj (Q3Canvas*, LinkableMapObj* parent);
    5.26      ~BranchObj ();
    5.27  	bool operator< ( const BranchObj & );
    5.28  	bool operator== ( const BranchObj & );
    5.29 @@ -122,9 +124,10 @@
    5.30  
    5.31  protected:
    5.32  	static BranchObj* itLast;		// iterator for first(), next()
    5.33 +	static BranchObj* itFirst;		// first iterator for first(), next()
    5.34      BranchObjPtrList branch;		// all child branches
    5.35 -	QPtrList<FloatImageObj> floatimage;	// child images
    5.36 -	QPtrList<XLinkObj> xlink;		// xlinks to other branches
    5.37 +	Q3PtrList<FloatImageObj> floatimage;	// child images
    5.38 +	Q3PtrList<XLinkObj> xlink;		// xlinks to other branches
    5.39  public:	
    5.40  	float angle;					// used in mainbranch to reorder mainbranches
    5.41  protected:	
     6.1 --- a/exportxhtmldialog.ui.h	Tue Aug 01 09:30:57 2006 +0000
     6.2 +++ b/exportxhtmldialog.ui.h	Tue Sep 05 09:47:13 2006 +0000
     6.3 @@ -1,3 +1,6 @@
     6.4 +//Added by qt3to4:
     6.5 +#include <QPixmap>
     6.6 +#include <QTextStream>
     6.7  /****************************************************************************
     6.8  ** ui.h extension file, included from the uic-generated form implementation.
     6.9  **
    6.10 @@ -22,42 +25,42 @@
    6.11  void ExportXHTMLDialog::readSettings()
    6.12  {
    6.13  
    6.14 -	dir=settings.readLocalEntry (filepath,"/vym/export/xhtml/exportDir",vymBaseDir.currentDirPath() );
    6.15 +	dir=settings.readLocalEntry (filepath,"/export/xhtml/exportDir",vymBaseDir.currentDirPath() );
    6.16  	lineEditDir->setText(dir);
    6.17  	
    6.18 -    if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/useImage","yes")=="yes")
    6.19 +    if ( settings.readLocalEntry (filepath,"/export/xhtml/useImage","yes")=="yes")
    6.20  		useImage=true;
    6.21  	else	
    6.22  		useImage=false;
    6.23  	imageButton->setChecked(useImage);
    6.24  		
    6.25 -	if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/useTextColor","no")=="yes")
    6.26 +	if ( settings.readLocalEntry (filepath,"/export/xhtml/useTextColor","no")=="yes")
    6.27  		useTextColor=true;
    6.28  	else	
    6.29  		useTextColor=false;
    6.30  	textColorButton->setChecked(useTextColor);
    6.31  	
    6.32  /* FIXME this was used in old html export, is not yet in new stylesheet
    6.33 -	if ( settings.readEntry ("/vym/export/html/useHeading","no")=="yes")
    6.34 +	if ( settings.readEntry ("/export/html/useHeading","no")=="yes")
    6.35  		useHeading=true;
    6.36  	else	
    6.37  		useHeading=false;
    6.38  	checkBox4_2->setChecked(useHeading);
    6.39  */		
    6.40  
    6.41 -	if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/saveSettingsInMap","no")=="yes")
    6.42 +	if ( settings.readLocalEntry (filepath,"/export/xhtml/saveSettingsInMap","no")=="yes")
    6.43  		saveSettingsInMap=true;
    6.44  	else	
    6.45  		saveSettingsInMap=false;
    6.46  	saveSettingsInMapButton->setChecked(saveSettingsInMap);
    6.47  
    6.48 -	if ( settings.readEntry ("/vym/export/xhtml/showWarnings","yes")=="yes")
    6.49 +	if ( settings.readEntry ("/export/xhtml/showWarnings","yes")=="yes")
    6.50  		showWarnings=true;
    6.51  	else	
    6.52  		showWarnings=false;
    6.53  	warningsButton->setChecked(showWarnings);
    6.54  	
    6.55 -	if ( settings.readEntry ("/vym/export/xhtml/showOutput","no")=="yes")
    6.56 +	if ( settings.readEntry ("/export/xhtml/showOutput","no")=="yes")
    6.57  		showOutput=true;
    6.58  	else	
    6.59  		showOutput=false;
    6.60 @@ -71,19 +74,19 @@
    6.61  	} else
    6.62  	{
    6.63  		xsl=settings.readLocalEntry 
    6.64 -			(filepath,"/vym/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
    6.65 +			(filepath,"/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
    6.66  		css=settings.readLocalEntry 
    6.67 -			(filepath,"/vym/export/xhtml/css","/usr/share/vym/styles/vym.css");	
    6.68 +			(filepath,"/export/xhtml/css","/usr/share/vym/styles/vym.css");	
    6.69  	}
    6.70  	lineEditXSL->setText(xsl);
    6.71  	lineEditCSS->setText(css);
    6.72  	
    6.73  	prescript=settings.readLocalEntry
    6.74 -		(filepath,"/vym/export/xhtml/prescript","");
    6.75 +		(filepath,"/export/xhtml/prescript","");
    6.76  	lineEditPreScript->setText (prescript);	
    6.77  	
    6.78  	postscript=settings.readLocalEntry
    6.79 -		(filepath,"/vym/export/xhtml/postscript","");
    6.80 +		(filepath,"/export/xhtml/postscript","");
    6.81  	lineEditPostScript->setText (postscript);	
    6.82  
    6.83  	if (!prescript.isEmpty() || !postscript.isEmpty())
    6.84 @@ -112,8 +115,8 @@
    6.85  
    6.86  void ExportXHTMLDialog::browseDirectoryPressed()
    6.87  {
    6.88 -   	QFileDialog fd( this, tr("VYM - Export HTML to directory"));
    6.89 -	fd.setMode (QFileDialog::DirectoryOnly);
    6.90 +   	Q3FileDialog fd( this, tr("VYM - Export HTML to directory"));
    6.91 +	fd.setMode (Q3FileDialog::DirectoryOnly);
    6.92  	fd.setCaption(tr("VYM - Export HTML to directory"));
    6.93  	fd.setModal (true);
    6.94  	fd.show();
    6.95 @@ -165,7 +168,7 @@
    6.96  
    6.97  void ExportXHTMLDialog::browseCSSPressed()
    6.98  {
    6.99 -   	QFileDialog fd( this, tr("VYM - Path to CSS file"));
   6.100 +   	Q3FileDialog fd( this, tr("VYM - Path to CSS file"));
   6.101  	fd.setModal (true);
   6.102  	fd.addFilter ("Cascading Stylesheet (*.css)");
   6.103  	fd.show();
   6.104 @@ -192,7 +195,7 @@
   6.105  
   6.106  void ExportXHTMLDialog::browseXSLPressed()
   6.107  {
   6.108 -   	QFileDialog fd( this, tr("VYM - Path to XSL file"));
   6.109 +   	Q3FileDialog fd( this, tr("VYM - Path to XSL file"));
   6.110  	fd.setModal (true);
   6.111  	fd.addFilter ("Extensible Stylesheet Language (*.xsl)");
   6.112  	fd.show();
   6.113 @@ -213,7 +216,7 @@
   6.114  
   6.115  void ExportXHTMLDialog::browsePreExportButtonPressed()
   6.116  {
   6.117 -	QFileDialog fd( this, tr("VYM - Path to pre export script"));
   6.118 +	Q3FileDialog fd( this, tr("VYM - Path to pre export script"));
   6.119  	fd.setModal (true);
   6.120  	fd.addFilter ("Scripts (*.sh *.pl *.py *.php)");
   6.121  	fd.show();
   6.122 @@ -229,7 +232,7 @@
   6.123  
   6.124  void ExportXHTMLDialog::browsePostExportButtonPressed()
   6.125  {
   6.126 -	QFileDialog fd( this, tr("VYM - Path to post export script"));
   6.127 +	Q3FileDialog fd( this, tr("VYM - Path to post export script"));
   6.128  	fd.setModal (true);
   6.129  	fd.addFilter ("Scripts (*.sh *.pl *.py *.php)");
   6.130  	fd.show();
   6.131 @@ -248,38 +251,38 @@
   6.132  	// Save options to settings file 
   6.133  	// (but don't save at destructor, which
   6.134  	// is called for "cancel", too)
   6.135 -	settings.setLocalEntry (filepath,"/vym/export/xhtml/exportDir",dir);
   6.136 -	settings.setLocalEntry (filepath,"/vym/export/xhtml/prescript",prescript);
   6.137 -	settings.setLocalEntry (filepath,"/vym/export/xhtml/postscript",postscript);
   6.138 +	settings.setLocalEntry (filepath,"/export/xhtml/exportDir",dir);
   6.139 +	settings.setLocalEntry (filepath,"/export/xhtml/prescript",prescript);
   6.140 +	settings.setLocalEntry (filepath,"/export/xhtml/postscript",postscript);
   6.141  
   6.142      if (useImage)
   6.143 -		settings.setLocalEntry (filepath,"/vym/export/xhtml/useImage","yes");
   6.144 +		settings.setLocalEntry (filepath,"/export/xhtml/useImage","yes");
   6.145      else
   6.146 -		settings.setLocalEntry (filepath,"/vym/export/xhtml/useImage","no");	
   6.147 +		settings.setLocalEntry (filepath,"/export/xhtml/useImage","no");	
   6.148  	
   6.149    if (useTextColor)
   6.150 -		settings.setLocalEntry (filepath,"/vym/export/xhtml/useTextColor","yes");
   6.151 +		settings.setLocalEntry (filepath,"/export/xhtml/useTextColor","yes");
   6.152      else
   6.153 -		settings.setLocalEntry (filepath,"/vym/export/xhtml/useTextColor","no");	
   6.154 +		settings.setLocalEntry (filepath,"/export/xhtml/useTextColor","no");	
   6.155  	
   6.156     if (showWarnings)
   6.157 -		settings.writeEntry ("/vym/export/xhtml/showWarnings","yes");
   6.158 +		settings.writeEntry ("/export/xhtml/showWarnings","yes");
   6.159      else
   6.160 -		settings.writeEntry ("/vym/export/xhtml/showWarnings","no");	
   6.161 +		settings.writeEntry ("/export/xhtml/showWarnings","no");	
   6.162  			
   6.163  	if (showOutput)
   6.164 -		settings.writeEntry ("/vym/export/xhtml/showOutput","yes");
   6.165 +		settings.writeEntry ("/export/xhtml/showOutput","yes");
   6.166  	else
   6.167 -		settings.writeEntry ("/vym/export/xhtml/showOutput","no");	
   6.168 +		settings.writeEntry ("/export/xhtml/showOutput","no");	
   6.169  
   6.170  	QString ipath;	
   6.171  	ipath=vymBaseDir.path()+"/flags/flag-url-16x16.png";
   6.172  	if (!options.isOn ("local"))
   6.173  	{
   6.174  		settings.setLocalEntry 
   6.175 -			(filepath,"/vym/export/xhtml/xsl",xsl);
   6.176 +			(filepath,"/export/xhtml/xsl",xsl);
   6.177  		settings.setLocalEntry 
   6.178 -			(filepath,"/vym/export/xhtml/css",css);	
   6.179 +			(filepath,"/export/xhtml/css",css);	
   6.180  	}
   6.181  
   6.182  	// Provide a smaller URL-icon to improve Layout
   6.183 @@ -291,19 +294,19 @@
   6.184  	if(!pm.save (dir + "flags/flag-url-16x16.png","PNG"))
   6.185  		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not write %1").arg(ipath));
   6.186  	if (!saveSettingsInMap)
   6.187 -		settings.clearLocal("/vym/export/xhtml");
   6.188 +		settings.clearLocal("/export/xhtml");
   6.189  	else	
   6.190  		settings.setLocalEntry 
   6.191 -			(filepath,"/vym/export/xhtml/saveSettingsInMap","yes");
   6.192 +			(filepath,"/export/xhtml/saveSettingsInMap","yes");
   6.193  
   6.194  	// Copy CSS file
   6.195  	QFile css_src (css);
   6.196  	QFile css_dst (dir+"vym.css");
   6.197 -	if (!css_src.open ( IO_ReadOnly))
   6.198 -		QMessageBox::warning( 0, tr( "Warning" ),+tr("Could not open %1").arg(css));
   6.199 +	if (!css_src.open ( QIODevice::ReadOnly))
   6.200 +		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(css));
   6.201  	else
   6.202  	{
   6.203 -		if (!css_dst.open( IO_WriteOnly))
   6.204 +		if (!css_dst.open( QIODevice::WriteOnly))
   6.205  			QMessageBox::warning( 0, tr( "Warning" ), tr("Could not open %1").arg(dir+"vym.css"));
   6.206  		else
   6.207  		{	
     7.1 --- a/findwindow.cpp	Tue Aug 01 09:30:57 2006 +0000
     7.2 +++ b/findwindow.cpp	Tue Sep 05 09:47:13 2006 +0000
     7.3 @@ -1,22 +1,26 @@
     7.4  #include <qlineedit.h>
     7.5 +//Added by qt3to4:
     7.6 +#include <Q3HBoxLayout>
     7.7 +#include <Q3VBoxLayout>
     7.8 +#include <QLabel>
     7.9  
    7.10  #include "findwindow.h"
    7.11  #include "version.h"
    7.12  
    7.13  
    7.14  FindWindow::FindWindow(QWidget* parent, const char* name) 
    7.15 -	: QGroupBox( 0, Horizontal, "Find", parent, name )
    7.16 +	: Q3GroupBox( 0, Qt::Horizontal, "Find", parent, name )
    7.17  
    7.18  {
    7.19  	setCaption (__VYM " - " +tr("Find Text"));
    7.20  	//resize (180,130);
    7.21  	move (130,130);
    7.22  
    7.23 -	setMargin( 100 );
    7.24 +	//FIXME not avail in QT4 setMargin( 100 );
    7.25  
    7.26 -    QVBoxLayout* box = new QVBoxLayout( layout() );
    7.27 +    Q3VBoxLayout* box = new Q3VBoxLayout( layout() );
    7.28      
    7.29 -    QHBoxLayout *row1 = new QHBoxLayout( box );
    7.30 +    Q3HBoxLayout *row1 = new Q3HBoxLayout( box );
    7.31      row1->setMargin( 10 );
    7.32  
    7.33      // Create a Label
    7.34 @@ -24,7 +28,7 @@
    7.35      row1->addWidget( label );
    7.36  
    7.37  	// Create LineEdit (here QComboBox)
    7.38 -    QHBoxLayout *row2 = new QHBoxLayout( box );
    7.39 +    Q3HBoxLayout *row2 = new Q3HBoxLayout( box );
    7.40      row2->setMargin( 10 );
    7.41      findcombo = new QComboBox( true, this );
    7.42  	findcombo->setMinimumWidth(150);
    7.43 @@ -36,7 +40,7 @@
    7.44      //findcombo->insertItem( "Normal", -1 );
    7.45  
    7.46  	// Create Buttons
    7.47 -    QHBoxLayout *row3 = new QHBoxLayout( box );
    7.48 +    Q3HBoxLayout *row3 = new Q3HBoxLayout( box );
    7.49      row3->setMargin( 10 );
    7.50  	clearbutton = new QPushButton (tr("Clear"),this);
    7.51  	connect ( clearbutton, SIGNAL( clicked() ), 
    7.52 @@ -47,7 +51,7 @@
    7.53  	row3->addItem(si1);
    7.54  	
    7.55  	cancelbutton = new QPushButton (tr("Cancel"),this);
    7.56 -	cancelbutton->setAccel (Key_Escape);
    7.57 +	cancelbutton->setAccel (Qt::Key_Escape);
    7.58  	connect ( cancelbutton, SIGNAL( clicked() ), 
    7.59  		this, SLOT( cancelPressed() ) );
    7.60  	row3->addWidget (cancelbutton);
     8.1 --- a/findwindow.h	Tue Aug 01 09:30:57 2006 +0000
     8.2 +++ b/findwindow.h	Tue Sep 05 09:47:13 2006 +0000
     8.3 @@ -1,15 +1,15 @@
     8.4  #ifndef FINDWINDOW_H 
     8.5  #define FINDWINDOW_H
     8.6  
     8.7 -#include <qmainwindow.h>
     8.8 +#include <q3mainwindow.h>
     8.9  #include <qcombobox.h>
    8.10  #include <qpushbutton.h>
    8.11 -#include <qgroupbox.h>
    8.12 +#include <q3groupbox.h>
    8.13  #include <qlayout.h>
    8.14  #include <qlabel.h>
    8.15  
    8.16  
    8.17 -class FindWindow : public QGroupBox
    8.18 +class FindWindow : public Q3GroupBox
    8.19  {
    8.20  	Q_OBJECT
    8.21  
    8.22 @@ -27,7 +27,7 @@
    8.23  	void somethingChanged();	// emit to mainwindow
    8.24  
    8.25  private:
    8.26 -	QGroupBox *findbox;
    8.27 +	Q3GroupBox *findbox;
    8.28  	QComboBox *findcombo;
    8.29  	QPushButton *clearbutton;
    8.30  	QPushButton *findbutton;
     9.1 --- a/mapcenterobj.cpp	Tue Aug 01 09:30:57 2006 +0000
     9.2 +++ b/mapcenterobj.cpp	Tue Sep 05 09:47:13 2006 +0000
     9.3 @@ -13,7 +13,7 @@
     9.4      init();
     9.5  }
     9.6  
     9.7 -MapCenterObj::MapCenterObj(QCanvas* c) : BranchObj (c)
     9.8 +MapCenterObj::MapCenterObj(Q3Canvas* c) : BranchObj (c)
     9.9  {
    9.10  //    cout << "Const MapCenterObj   canvas="<<c<<"\n";
    9.11      init();
    10.1 --- a/mapcenterobj.h	Tue Aug 01 09:30:57 2006 +0000
    10.2 +++ b/mapcenterobj.h	Tue Sep 05 09:47:13 2006 +0000
    10.3 @@ -1,6 +1,9 @@
    10.4  #ifndef MAPCENTEROBJ_H
    10.5  #define MAPCENTEROBJ_H
    10.6  
    10.7 +
    10.8 +#include <QDate>
    10.9 +
   10.10  #include "branchobj.h"
   10.11  #include "xlinkobj.h"
   10.12  #include "version.h"
   10.13 @@ -9,7 +12,7 @@
   10.14  class MapCenterObj:public BranchObj {
   10.15  public:
   10.16      MapCenterObj ();
   10.17 -    MapCenterObj (QCanvas*);
   10.18 +    MapCenterObj (Q3Canvas*);
   10.19      ~MapCenterObj ();
   10.20      void clear();
   10.21      void init();
    11.1 --- a/selection.cpp	Tue Aug 01 09:30:57 2006 +0000
    11.2 +++ b/selection.cpp	Tue Sep 05 09:47:13 2006 +0000
    11.3 @@ -5,21 +5,19 @@
    11.4  {
    11.5  }
    11.6  
    11.7 -Selection::Selection(const Selection &other)
    11.8 -{
    11.9 -}
   11.10 -
   11.11  Selection::~Selection()
   11.12  {
   11.13  }
   11.14  
   11.15 -void Selection::init()
   11.16 +void Selection::setMapCenter(MapCenterObj *mco)
   11.17  {
   11.18 -	selectList.setAutoDelete(true);
   11.19 +	mapCenter=mco;
   11.20  }
   11.21  
   11.22  void Selection::copy(const Selection &other)
   11.23  {
   11.24 +	mapCenter=other.mapCenter;
   11.25 +	selectList=other.selectList;
   11.26  }
   11.27  
   11.28  void Selection::clear()
   11.29 @@ -29,11 +27,29 @@
   11.30  
   11.31  bool Selection::select(LinkableMapObj *lmo)
   11.32  {
   11.33 +	clear();
   11.34 +	selectList.append (lmo);
   11.35  	return false;
   11.36  }
   11.37  
   11.38 -void Selection::unselect(LinkableMapObj *lmo)
   11.39 +bool Selection::select (const QString &s)
   11.40  {
   11.41 +	LinkableMapObj *lmo=mapCenter->findObjBySelect(s);
   11.42 +
   11.43 +	// Finally select the found object
   11.44 +	if (lmo)
   11.45 +	{
   11.46 +		clear();
   11.47 +		select (lmo);
   11.48 +		return true;
   11.49 +	} 
   11.50 +	return false;
   11.51 +
   11.52 +}
   11.53 +
   11.54 +void Selection::unselect()
   11.55 +{
   11.56 +	clear();
   11.57  }
   11.58  
   11.59  bool Selection::isEmpty()
   11.60 @@ -45,3 +61,14 @@
   11.61  {
   11.62  	return selectList.count();
   11.63  }
   11.64 +
   11.65 +QString Selection::getSelectString()
   11.66 +{
   11.67 +	// TODO multiselection (maybe separated by ";")
   11.68 +	if (selectList.count()==1)
   11.69 +		return selectList.first()->getSelectString();
   11.70 +	else
   11.71 +		return"";
   11.72 +}
   11.73 +
   11.74 +
    12.1 --- a/selection.h	Tue Aug 01 09:30:57 2006 +0000
    12.2 +++ b/selection.h	Tue Sep 05 09:47:13 2006 +0000
    12.3 @@ -1,26 +1,32 @@
    12.4 -#ifndef SELECTIONOBJ_H
    12.5 -#define SELECTIONOBJ_H
    12.6 +#ifndef SELECTION_H
    12.7 +#define SELECTION_H
    12.8 +
    12.9 +#include <q3ptrlist.h>
   12.10  
   12.11  #include "linkablemapobj.h"
   12.12 -#include <qptrlist.h>
   12.13 +#include "mapcenterobj.h"
   12.14  
   12.15  class Selection 
   12.16  {
   12.17  public:
   12.18  	Selection ();
   12.19 -	Selection (const Selection&);
   12.20  	~Selection();
   12.21 -	void init();
   12.22  	void copy(const Selection&);
   12.23  	void clear();
   12.24 +	void setMapCenter (MapCenterObj *);
   12.25  	
   12.26  	bool select (LinkableMapObj*);
   12.27 -	void unselect (LinkableMapObj*);
   12.28 +	bool select (const QString &);
   12.29 +	void unselect ();
   12.30  	bool isEmpty();
   12.31  	uint count();
   12.32  
   12.33 +	QString getSelectString();
   12.34 +
   12.35  private:
   12.36 -	QPtrList <LinkableMapObj> selectList;
   12.37 +	void init();
   12.38 +	QList <LinkableMapObj*> selectList;
   12.39 +	MapCenterObj *mapCenter;
   12.40  };
   12.41  #endif
   12.42  
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/toolbars.h	Tue Sep 05 09:47:13 2006 +0000
    13.3 @@ -0,0 +1,31 @@
    13.4 +#ifndef TOOLBARS_H
    13.5 +#define TOOLBARS_H
    13.6 +
    13.7 +#include <QToolBar>
    13.8 +
    13.9 +#include "settings.h"
   13.10 +
   13.11 +class ToolBar:public QToolBar
   13.12 +{
   13.13 +	Q_OBJECT
   13.14 +
   13.15 +public:
   13.16 +	void loadSettings (const Settings &);
   13.17 +	void saveSettings (const Settings &);
   13.18 +
   13.19 +private:
   13.20 +};
   13.21 +
   13.22 +/////////////////////////////////////////////////////////////////////////////
   13.23 +class ToolBarSet
   13.24 +{
   13.25 +public:
   13.26 +	ToolBarSet();
   13.27 +	void loadSettings(const Settings &);	
   13.28 +	void saveSettings(const Settings &);	
   13.29 +	void add (QToolBar *);
   13.30 +private:
   13.31 +	QList <ToolBar*> list;
   13.32 +};
   13.33 +
   13.34 +#endif