New mechanism for clipboard
authorinsilmaril
Mon, 10 Oct 2005 11:20:25 +0000
changeset 166325958acb69b
parent 165 4244bcd9e6ea
child 167 f7efd8c7c407
New mechanism for clipboard
branchobj.cpp
flagobj.cpp
flagrowobj.cpp
floatimageobj.cpp
floatimageobj.h
floatobj.h
headingobj.cpp
linkablemapobj.cpp
linkablemapobj.h
main.cpp
mainwindow.cpp
mainwindow.h
mapcenterobj.cpp
mapeditor.cpp
mapeditor.h
mapobj.cpp
misc.cpp
misc.h
tex/vym.changelog
version.h
xml.cpp
xml.h
     1.1 --- a/branchobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     1.2 +++ b/branchobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     1.3 @@ -569,18 +569,17 @@
     1.4  
     1.5  void BranchObj::positionBBox()
     1.6  {
     1.7 -	// TODO testing (optimization)
     1.8 -	/*
     1.9 +	/*// TODO testing (optimization)
    1.10  	QString h=getHeading();
    1.11  	if (!h.isEmpty())
    1.12  		cout << "BO::positionBBox("<<h<<")\n";
    1.13  	else	
    1.14  		cout << "BO::positionBBox (noHeading)\n";
    1.15 -	*/	
    1.16 +*/		
    1.17  
    1.18 -    heading->positionBBox();
    1.19 -	systemFlags->positionBBox();
    1.20 -	standardFlags->positionBBox();
    1.21 +	// Position contents by moving OO
    1.22 +	OrnamentedObj::move (absPos.x(),absPos.y());
    1.23 + 
    1.24  	// It seems that setting x,y also affects width,height
    1.25  	int w_old=bbox.width();
    1.26  	int h_old=bbox.height();
    1.27 @@ -654,6 +653,11 @@
    1.28  
    1.29  void BranchObj::setHeading(QString s)
    1.30  {
    1.31 +/* FIXME testing only
    1.32 +	cout << "BO::setHeading ("<<s<<")\n";
    1.33 +	cout << "   bo.pos="<<absPos<<endl;
    1.34 +	cout << "   ho.pos="<<heading->getPos()<<endl;
    1.35 +*/	
    1.36      heading->setText(s);	// set new heading
    1.37  	calcBBoxSize();			// recalculate bbox
    1.38      positionBBox();			// rearrange contents
    1.39 @@ -779,7 +783,7 @@
    1.40  	// Save FloatImages
    1.41  	FloatImageObj *fio;
    1.42  	for (fio=floatimage.first(); fio; fio=floatimage.next() )
    1.43 -		s+=fio->saveToDir (tmpdir,prefix);
    1.44 +		s+=fio->saveToDir (tmpdir,prefix,offset);
    1.45  
    1.46  	// Save XLinks
    1.47  	XLinkObj *xlo;
    1.48 @@ -1136,10 +1140,10 @@
    1.49  
    1.50  	// If I am the mapcenter or a mainbranch, reposition heading
    1.51  	if (depth<2)
    1.52 -	{
    1.53 -		move (absPos.x(),absPos.y());
    1.54 +	{	//FIXME optimize this   move for MCO needed to initially position text in box...
    1.55  		if (depth==1)
    1.56  		{
    1.57 +			move (absPos.x(),absPos.y());
    1.58  			// Calc angle to mapCenter if I am a mainbranch
    1.59  			// needed for reordering the mainbranches clockwise 
    1.60  			// around mapcenter 
     2.1 --- a/flagobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     2.2 +++ b/flagobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     2.3 @@ -5,13 +5,13 @@
     2.4  /////////////////////////////////////////////////////////////////
     2.5  FlagObj::FlagObj()
     2.6  {
     2.7 -//    cout << "Const FlagObj ()\n";
     2.8 +//	cout << "Const FlagObj ()\n";
     2.9      init ();
    2.10  }
    2.11  
    2.12  FlagObj::FlagObj(QCanvas* c):MapObj(c) 
    2.13  {
    2.14 -//    cout << "Const FlagObj\n";
    2.15 +//	cout << "Const FlagObj  canvas="<<c<<endl;
    2.16      init ();
    2.17  }
    2.18  
    2.19 @@ -23,7 +23,7 @@
    2.20  FlagObj::~FlagObj()
    2.21  {
    2.22  //    cout << "Destr FlagObj  " << name << "\n";
    2.23 -	delete (icon);
    2.24 +	if (icon) delete (icon);
    2.25  }
    2.26  
    2.27  
     3.1 --- a/flagrowobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     3.2 +++ b/flagrowobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     3.3 @@ -5,7 +5,7 @@
     3.4  /////////////////////////////////////////////////////////////////
     3.5  FlagRowObj::FlagRowObj()
     3.6  {
     3.7 -    cout << "Const FlagRowObj ()\n";
     3.8 +//    cout << "Const FlagRowObj ()\n";
     3.9      init ();
    3.10  }
    3.11  
    3.12 @@ -305,7 +305,7 @@
    3.13  					w, SLOT( standardFlagChanged() ) );
    3.14  		}
    3.15  	} else
    3.16 -		qWarning ("FlagRowObj::makeToolbar mustn't be called for ordinary rows");
    3.17 +		qWarning ("FlagRowObj::makeToolbar must not be called for ordinary rows");
    3.18  }
    3.19  
    3.20  void  FlagRowObj::updateToolbar()
     4.1 --- a/floatimageobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     4.2 +++ b/floatimageobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     4.3 @@ -138,7 +138,7 @@
     4.4  	// TODO
     4.5  }
     4.6  
     4.7 -QString FloatImageObj::saveToDir (const QString &tmpdir,const QString &prefix)
     4.8 +QString FloatImageObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint &p)
     4.9  {
    4.10  	counter++;
    4.11  
     5.1 --- a/floatimageobj.h	Thu Sep 22 12:56:05 2005 +0000
     5.2 +++ b/floatimageobj.h	Mon Oct 10 11:20:25 2005 +0000
     5.3 @@ -28,7 +28,7 @@
     5.4  	virtual QRect getTotalBBox();			// return BBox including childs			
     5.5  	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
     5.6  	virtual void calcBBoxSizeWithChilds();	// calc size of  BBox including childs recursivly
     5.7 -	virtual QString saveToDir(const QString &,const QString&);
     5.8 +	virtual QString saveToDir(const QString &,const QString&, const QPoint &);
     5.9  	virtual void resetSaveCounter();
    5.10  	virtual QString getSelectString();
    5.11  
     6.1 --- a/floatobj.h	Thu Sep 22 12:56:05 2005 +0000
     6.2 +++ b/floatobj.h	Mon Oct 10 11:20:25 2005 +0000
     6.3 @@ -29,7 +29,6 @@
     6.4  	virtual QRect getTotalBBox();			// return BBox including childs			
     6.5  	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
     6.6  
     6.7 -	virtual QString saveToDir(const QString &,const QString&)=0;
     6.8  	virtual void resetSaveCounter()=0;
     6.9  
    6.10  	virtual void select();
     7.1 --- a/headingobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     7.2 +++ b/headingobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     7.3 @@ -95,6 +95,7 @@
     7.4      t->setColor (color);
     7.5      t->setZ(Z_TEXT);
     7.6      t->setText(s);
     7.7 +	t->setTextFlags(Qt::AlignLeft);
     7.8      t->show();
     7.9      return t;
    7.10  }
     8.1 --- a/linkablemapobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     8.2 +++ b/linkablemapobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     8.3 @@ -653,7 +653,7 @@
     8.4  
     8.5  void LinkableMapObj::alignRelativeTo (QPoint ref)
     8.6  {
     8.7 -	// TODO testing, seems not to be used right now...
     8.8 +	// FIXME testing, seems not to be used right now...
     8.9  	cout << "LMO::alignRelTo   ref="<<ref<<endl;
    8.10  }
    8.11  
     9.1 --- a/linkablemapobj.h	Thu Sep 22 12:56:05 2005 +0000
     9.2 +++ b/linkablemapobj.h	Mon Oct 10 11:20:25 2005 +0000
     9.3 @@ -79,6 +79,7 @@
     9.4      virtual void select();
     9.5      virtual void unselect();
     9.6  	virtual	QString getSelectString()=0;
     9.7 +	virtual QString saveToDir (const QString&,const QString&, const QPoint&)=0;// Save data to tempdir
     9.8  
     9.9  protected:
    9.10  	void parabel(QPointArray &,double,double,double,double);	// Create Parabel connecting two points
    10.1 --- a/main.cpp	Thu Sep 22 12:56:05 2005 +0000
    10.2 +++ b/main.cpp	Mon Oct 10 11:20:25 2005 +0000
    10.3 @@ -22,7 +22,8 @@
    10.4  
    10.5  Main *mainWindow;				// used in BranchObj::select()								
    10.6  QString tmpVymDir;				// All temp files go there, created in mainwindow
    10.7 -MapEditor *clipboardME;			
    10.8 +QString clipboardDir;			// Clipboard used in all mapEditors
    10.9 +bool clipboardEmpty;			
   10.10  FlagRowObj *systemFlagsDefault;	// used to copy from in LinkableMapObj
   10.11  FlagRowObj *standardFlagsDefault;
   10.12  
   10.13 @@ -187,12 +188,7 @@
   10.14  	textEditor->setIcon (QPixmap (vym_editor_xpm));
   10.15  	if (textEditor->showWithMain()) textEditor->show();
   10.16  
   10.17 -	clipboardME = new MapEditor();
   10.18 -	clipboardME->resize (800,600);
   10.19 -	clipboardME->setCaption("VYM - clipboard");
   10.20 -	clipboardME->hide();
   10.21 -
   10.22 -	// Initialize mainwindow after Mapeditors (because of Flags)
   10.23 +	// Initialize mainwindow 
   10.24      Main m;
   10.25  	//m.resize(m.sizeHint());
   10.26  	m.setIcon (QPixmap (vym_logo_xpm));
    11.1 --- a/mainwindow.cpp	Thu Sep 22 12:56:05 2005 +0000
    11.2 +++ b/mainwindow.cpp	Mon Oct 10 11:20:25 2005 +0000
    11.3 @@ -19,6 +19,7 @@
    11.4  #include <cstdlib>
    11.5  #include <typeinfo>
    11.6  
    11.7 +#include "misc.h"
    11.8  #include "version.h"
    11.9  #include "aboutdialog.h"
   11.10  
   11.11 @@ -43,10 +44,29 @@
   11.12  #include "icons/modelink.xpm"
   11.13  #include "icons/modecopy.xpm"
   11.14  //#include "icons/vym-48x48.xpm"
   11.15 +
   11.16 +#include "icons/flag-questionmark.xpm"
   11.17 +#include "icons/flag-exclamationmark.xpm"
   11.18 +#include "icons/flag-hook-green.xpm"
   11.19 +#include "icons/flag-cross-red.xpm"
   11.20 +#include "icons/flag-stopsign.xpm"
   11.21 +#include "icons/flag-smiley-good.xpm"
   11.22 +#include "icons/flag-smiley-sad.xpm"
   11.23 +#include "icons/flag-clock.xpm"
   11.24 +#include "icons/flag-lamp.xpm"
   11.25 +#include "icons/flag-arrow-up.xpm"
   11.26 +#include "icons/flag-arrow-down.xpm"
   11.27 +#include "icons/flag-thumb-up.xpm"
   11.28 +#include "icons/flag-thumb-down.xpm"
   11.29 +#include "icons/flag-heart.xpm"
   11.30 +#include "icons/flag-flash.xpm"
   11.31 +#include "icons/flag-lifebelt.xpm"
   11.32 +
   11.33  #include "icons/flag-note.xpm"
   11.34  #include "icons/flag-url.xpm"
   11.35  #include "icons/flag-vymlink.xpm"	
   11.36  #include "icons/flag-scrolled-right.xpm"
   11.37 +#include "icons/flag-tmpUnscrolled-right.xpm"
   11.38  
   11.39  #include "flagrowobj.h"
   11.40  #include "texteditor.h"
   11.41 @@ -61,9 +81,12 @@
   11.42  extern TextEditor *textEditor;
   11.43  extern Main *mainWindow;
   11.44  extern QString tmpVymDir;
   11.45 +extern QString clipboardDir;
   11.46 +extern bool clipboardEmpty;
   11.47  extern int statusbarTime;
   11.48  extern MapEditor *clipboardME;
   11.49  extern FlagRowObj* standardFlagsDefault;
   11.50 +extern FlagRowObj* systemFlagsDefault;
   11.51  
   11.52  extern QPtrList <QAction> actionListBranches;
   11.53  
   11.54 @@ -172,11 +195,17 @@
   11.55  	// Create unique temporary directory
   11.56  	tmpVymDir=makeUniqueDir ("/tmp/vym-XXXXXX");
   11.57  
   11.58 -	// TODO Create direcctory for clipboard
   11.59 +	// Create direcctory for clipboard
   11.60 +	clipboardDir=tmpVymDir+"/clipboard";
   11.61 +	QDir d(clipboardDir);
   11.62 +	d.mkdir (clipboardDir,true);
   11.63 +	makeSubDirs (clipboardDir);
   11.64 +	clipboardEmpty=true;
   11.65  
   11.66 +	// FIXME not used currently
   11.67  	// Set random seed (random used for object IDs)
   11.68 -    QTime t = QTime::currentTime();		// set random seed
   11.69 -    srand( t.hour()*12+t.minute()*60+t.second()*60 );
   11.70 +    // QTime t = QTime::currentTime();		// set random seed
   11.71 +    // srand( t.hour()*12+t.minute()*60+t.second()*60 );
   11.72  
   11.73  
   11.74  	// Initialize some settings, which are platform dependant
   11.75 @@ -246,8 +275,6 @@
   11.76  	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
   11.77  
   11.78  	updateGeometry();
   11.79 -
   11.80 -	// Creating  the default map into first tab is done in main.cpp now...
   11.81  }
   11.82  
   11.83  Main::~Main()
   11.84 @@ -792,6 +819,134 @@
   11.85  // Flag Actions
   11.86  void Main::setupFlagActions()
   11.87  {
   11.88 +	// Create System Flags
   11.89 +	systemFlagsDefault = new FlagRowObj ();
   11.90 +	systemFlagsDefault->setVisibility (false);
   11.91 +	systemFlagsDefault->setName ("systemFlagsDef");
   11.92 +
   11.93 +	FlagObj *fo = new FlagObj ();
   11.94 +	fo->load(QPixmap(flag_note_xpm));
   11.95 +	fo->setName("note");
   11.96 +	fo->setToolTip(tr("Note","Systemflag"));
   11.97 +	systemFlagsDefault->addFlag (fo);	// makes deep copy
   11.98 +
   11.99 +	fo->load(QPixmap(flag_url_xpm));
  11.100 +	fo->setName("url");
  11.101 +	fo->setToolTip(tr("WWW Document (external)","Systemflag"));
  11.102 +	systemFlagsDefault->addFlag (fo);
  11.103 +	
  11.104 +	fo->load(QPixmap(flag_vymlink_xpm));
  11.105 +	fo->setName("vymLink");
  11.106 +	fo->setToolTip(tr("Link to another vym map","Systemflag"));
  11.107 +	systemFlagsDefault->addFlag (fo);	
  11.108 +
  11.109 +	fo->load(QPixmap(flag_scrolled_right_xpm));
  11.110 +	fo->setName("scrolledright");
  11.111 +	fo->setToolTip(tr("subtree is scrolled","Systemflag"));
  11.112 +	systemFlagsDefault->addFlag (fo);
  11.113 +	
  11.114 +	fo->load(QPixmap(flag_tmpUnscrolled_right_xpm));
  11.115 +	fo->setName("tmpUnscrolledright");
  11.116 +	fo->setToolTip(tr("subtree is temporary scrolled","Systemflag"));
  11.117 +	systemFlagsDefault->addFlag (fo);
  11.118 +
  11.119 +	// Create Standard Flags
  11.120 +	standardFlagsDefault = new FlagRowObj ();
  11.121 +	standardFlagsDefault->setVisibility (false);
  11.122 +	standardFlagsDefault->setName ("standardFlagsDef");
  11.123 +
  11.124 +	fo->load(QPixmap(flag_exclamationmark_xpm));
  11.125 +	fo->setName ("exclamationmark");
  11.126 +	fo->setGroup("standard-mark");
  11.127 +	fo->setToolTip(tr("Take care!","Standardflag"));
  11.128 +	standardFlagsDefault->addFlag (fo);	// makes deep copy
  11.129 +	
  11.130 +	fo->load(QPixmap(flag_questionmark_xpm));
  11.131 +	fo->setName("questionmark");
  11.132 +	fo->setGroup("standard-mark");
  11.133 +	fo->setToolTip(tr("Really?","Standardflag"));
  11.134 +	standardFlagsDefault->addFlag (fo);	
  11.135 +
  11.136 +	fo->load(QPixmap(flag_hook_green_xpm));
  11.137 +	fo->setName("hook-green");
  11.138 +	fo->setGroup("standard-hook");
  11.139 +	fo->setToolTip(tr("ok!","Standardflag"));
  11.140 +	standardFlagsDefault->addFlag (fo);	
  11.141 +
  11.142 +	fo->load(QPixmap(flag_cross_red_xpm));
  11.143 +	fo->setName("cross-red");
  11.144 +	fo->setGroup("standard-hook");
  11.145 +	fo->setToolTip(tr("Not ok!","Standardflag"));
  11.146 +	standardFlagsDefault->addFlag (fo);	
  11.147 +
  11.148 +	fo->load(QPixmap(flag_stopsign_xpm));
  11.149 +	fo->setName("stopsign");
  11.150 +	fo->setToolTip(tr("This won't work!","Standardflag"));
  11.151 +	standardFlagsDefault->addFlag (fo);	
  11.152 +
  11.153 +	fo->load(QPixmap(flag_smiley_good_xpm));
  11.154 +	fo->setName("smiley-good");
  11.155 +	fo->setGroup("standard-smiley");
  11.156 +	fo->setToolTip(tr("Good","Standardflag"));
  11.157 +	standardFlagsDefault->addFlag (fo);	
  11.158 +
  11.159 +	fo->load(QPixmap(flag_smiley_sad_xpm));
  11.160 +	fo->setName("smiley-sad");
  11.161 +	fo->setGroup("standard-smiley");
  11.162 +	fo->setToolTip(tr("Bad","Standardflag"));
  11.163 +	standardFlagsDefault->addFlag (fo);	
  11.164 +
  11.165 +	fo->load(QPixmap(flag_clock_xpm));
  11.166 +	fo->setName("clock");
  11.167 +	fo->setToolTip(tr("Time critical","Standardflag"));
  11.168 +	standardFlagsDefault->addFlag (fo);	
  11.169 +
  11.170 +	fo->load(QPixmap(flag_lamp_xpm));
  11.171 +	fo->setName("lamp");
  11.172 +	fo->setToolTip(tr("Idea!","Standardflag"));
  11.173 +	standardFlagsDefault->addFlag (fo);	
  11.174 +
  11.175 +	fo->load(QPixmap(flag_arrow_up_xpm));
  11.176 +	fo->setName("arrow-up");
  11.177 +	fo->setGroup("standard-arrow");
  11.178 +	fo->setToolTip(tr("Important","Standardflag"));
  11.179 +	standardFlagsDefault->addFlag (fo);	
  11.180 +
  11.181 +	fo->load(QPixmap(flag_arrow_down_xpm));
  11.182 +	fo->setName("arrow-down");
  11.183 +	fo->setGroup("standard-arrow");
  11.184 +	fo->setToolTip(tr("Unimportant","Standardflag"));
  11.185 +	standardFlagsDefault->addFlag (fo);	
  11.186 +
  11.187 +	fo->load(QPixmap(flag_thumb_up_xpm));
  11.188 +	fo->setName("thumb-up");
  11.189 +	fo->setGroup("standard-thumb");
  11.190 +	fo->setToolTip(tr("I like this","Standardflag"));
  11.191 +	standardFlagsDefault->addFlag (fo);	
  11.192 +
  11.193 +	fo->load(QPixmap(flag_thumb_down_xpm));
  11.194 +	fo->setName("thumb-down");
  11.195 +	fo->setGroup("standard-thumb");
  11.196 +	fo->setToolTip(tr("I like this","Standardflag"));
  11.197 +	fo->setToolTip(tr("I do not like this","Standardflag"));
  11.198 +	standardFlagsDefault->addFlag (fo);	
  11.199 +	
  11.200 +	fo->load(QPixmap(flag_heart_xpm));
  11.201 +	fo->setName("heart");
  11.202 +	fo->setToolTip(tr("I just love... ","Standardflag"));
  11.203 +	standardFlagsDefault->addFlag (fo);	
  11.204 +
  11.205 +	fo->load(QPixmap(flag_flash_xpm));
  11.206 +	fo->setName("flash");
  11.207 +	fo->setToolTip(tr("Dangerous","Standardflag"));
  11.208 +	standardFlagsDefault->addFlag (fo);	
  11.209 +	
  11.210 +	fo->load(QPixmap(flag_lifebelt_xpm));
  11.211 +	fo->setName("lifebelt");
  11.212 +	fo->setToolTip(tr("This will help","Standardflag"));
  11.213 +	standardFlagsDefault->addFlag (fo);	
  11.214 +	delete (fo);
  11.215 +
  11.216  	standardFlagsDefault->makeToolbar(this, "Standard Flags");
  11.217  }
  11.218  
  11.219 @@ -860,10 +1015,6 @@
  11.220      a = new QAction( tr( "Test Flag" ), QPixmap(), tr( "test flag" ), 0, this, "flag" );
  11.221      connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
  11.222      a->addTo( menu );
  11.223 -
  11.224 -	a = new QAction( tr( "Show Clipboard" ), QPixmap(), tr( "Show clipboard" ), 0, this, "clipboard" );
  11.225 -    connect( a, SIGNAL( activated() ), this, SLOT( testShowClipboard() ) );
  11.226 -    a->addTo( menu );
  11.227  }
  11.228  
  11.229  // Help Actions
  11.230 @@ -1159,7 +1310,8 @@
  11.231  	tabWidget->addTab (medit,fn);
  11.232  	tabWidget->showPage(medit);
  11.233  	medit->viewport()->setFocus();
  11.234 -	medit->select("mc:");
  11.235 +		// For the very first map we do not have flagrows yet...
  11.236 +		medit->select("mc:");
  11.237  }
  11.238  
  11.239  void Main::fileLoad(QString fn, const LoadMode &lmode)
  11.240 @@ -2361,11 +2513,6 @@
  11.241  	currentMapEditor()->testFunction();
  11.242  }
  11.243  
  11.244 -void Main::testShowClipboard()
  11.245 -{
  11.246 -	clipboardME->show();
  11.247 -}
  11.248 -
  11.249  void Main::helpDoc()
  11.250  {
  11.251  	QString docpath;
    12.1 --- a/mainwindow.h	Thu Sep 22 12:56:05 2005 +0000
    12.2 +++ b/mainwindow.h	Mon Oct 10 11:20:25 2005 +0000
    12.3 @@ -162,7 +162,6 @@
    12.4  	void standardFlagChanged();
    12.5  
    12.6      void testFunction();
    12.7 -    void testShowClipboard();
    12.8  
    12.9      void helpDoc();
   12.10      void helpAbout();
    13.1 --- a/mapcenterobj.cpp	Thu Sep 22 12:56:05 2005 +0000
    13.2 +++ b/mapcenterobj.cpp	Mon Oct 10 11:20:25 2005 +0000
    13.3 @@ -33,7 +33,6 @@
    13.4  {
    13.5  	BranchObj::init();
    13.6      orientation=OrientUndef;
    13.7 -    absPos=QPoint (canvas->width()/2, canvas->height()/2);
    13.8  
    13.9  	// FIXME this should be done in TextObj later...
   13.10  	//QFont font ("Sans Serif,16,-1,5,50,0,0,0,0,0");		
   13.11 @@ -41,9 +40,7 @@
   13.12  	depth=0;
   13.13  	setDefAttr(MovedBranch);
   13.14  
   13.15 -
   13.16  	frame->setFrameType (Rectangle);
   13.17 -	move (absPos.x(), absPos.y() );
   13.18  }
   13.19  
   13.20  void MapCenterObj::move (double x, double y)
   13.21 @@ -54,7 +51,8 @@
   13.22  
   13.23  void MapCenterObj::moveBy (double x, double y)
   13.24  {
   13.25 -	BranchObj::moveBy(x,y);
   13.26 +	//BranchObj::moveBy(x,y);
   13.27 +	move (x+absPos.x(),y+absPos.y() );
   13.28  	positionBBox();
   13.29  }
   13.30  
   13.31 @@ -144,9 +142,6 @@
   13.32  	s+=standardFlags->saveToDir(tmpdir+"/flags", "/standardFlag-", verbose);
   13.33      s=s+valueElement("heading", getHeading(),a);
   13.34  
   13.35 -	// Reset the counters before saving
   13.36 -	FloatImageObj (canvas).resetSaveCounter();
   13.37 -
   13.38  	// add link to file in s
   13.39  	if (!note.isEmpty() )
   13.40  		s+=note.saveToDir();
   13.41 @@ -159,7 +154,7 @@
   13.42  	// Save FloatImages
   13.43  	FloatImageObj *fio;
   13.44  	for (fio=floatimage.first(); fio; fio=floatimage.next() )
   13.45 -		s+=fio->saveToDir (tmpdir,prefix);
   13.46 +		s+=fio->saveToDir (tmpdir,prefix,offset);
   13.47  
   13.48  	// Save XLinks
   13.49  	XLinkObj *xlo;
    14.1 --- a/mapeditor.cpp	Thu Sep 22 12:56:05 2005 +0000
    14.2 +++ b/mapeditor.cpp	Mon Oct 10 11:20:25 2005 +0000
    14.3 @@ -37,35 +37,15 @@
    14.4  #include "editxlinkdialog.h"
    14.5  #include "settings.h"
    14.6  
    14.7 -#include "icons/flag-note.xpm"
    14.8 -#include "icons/flag-url.xpm"
    14.9 -#include "icons/flag-vymlink.xpm"	
   14.10 -#include "icons/flag-scrolled-right.xpm"
   14.11 -#include "icons/flag-tmpUnscrolled-right.xpm"
   14.12 -#include "icons/flag-questionmark.xpm"
   14.13 -#include "icons/flag-exclamationmark.xpm"
   14.14 -#include "icons/flag-hook-green.xpm"
   14.15 -#include "icons/flag-cross-red.xpm"
   14.16 -#include "icons/flag-stopsign.xpm"
   14.17 -#include "icons/flag-smiley-good.xpm"
   14.18 -#include "icons/flag-smiley-sad.xpm"
   14.19 -#include "icons/flag-clock.xpm"
   14.20 -#include "icons/flag-lamp.xpm"
   14.21 -#include "icons/flag-arrow-up.xpm"
   14.22 -#include "icons/flag-arrow-down.xpm"
   14.23 -#include "icons/flag-thumb-up.xpm"
   14.24 -#include "icons/flag-thumb-down.xpm"
   14.25 -#include "icons/flag-heart.xpm"
   14.26 -#include "icons/flag-flash.xpm"
   14.27 -#include "icons/flag-lifebelt.xpm"
   14.28  
   14.29  extern TextEditor *textEditor;
   14.30  extern int statusbarTime;
   14.31  extern Main *mainWindow;
   14.32  extern QString tmpVymDir;
   14.33 +extern QString clipboardDir;
   14.34 +extern bool clipboardEmpty;
   14.35  extern FlagRowObj *systemFlagsDefault;
   14.36  extern FlagRowObj *standardFlagsDefault;
   14.37 -extern MapEditor *clipboardME;
   14.38  
   14.39  extern QPtrList <QAction> actionListBranches;
   14.40  
   14.41 @@ -155,6 +135,7 @@
   14.42  
   14.43      mapCanvas = new QCanvas(1000,800);
   14.44  	mapCanvas->setAdvancePeriod(30);
   14.45 +	mapCanvas->setBackgroundColor (white);
   14.46  
   14.47      setCanvas (mapCanvas);
   14.48  	
   14.49 @@ -162,147 +143,11 @@
   14.50  	setVScrollBarMode ( QScrollView::AlwaysOn );
   14.51  	setHScrollBarMode ( QScrollView::AlwaysOn );
   14.52  
   14.53 -	// Now create the _global_ system flags _once_:
   14.54 -	// (Later all OrnamentedObj copy from this 
   14.55 -	// and set their own canvas)
   14.56 -	if (!systemFlagsDefault)
   14.57 -	{
   14.58 -		systemFlagsDefault = new FlagRowObj (mapCanvas);
   14.59 -		systemFlagsDefault->setVisibility (false);
   14.60 -		systemFlagsDefault->setName ("systemFlagsDef");
   14.61 -
   14.62 -		FlagObj *fo = new FlagObj (mapCanvas);
   14.63 -		fo->load(QPixmap(flag_note_xpm));
   14.64 -		fo->setName("note");
   14.65 -		fo->setToolTip(tr("Note","Systemflag"));
   14.66 -		systemFlagsDefault->addFlag (fo);	// makes deep copy
   14.67 -
   14.68 -		fo->load(QPixmap(flag_url_xpm));
   14.69 -		fo->setName("url");
   14.70 -		fo->setToolTip(tr("WWW Document (external)","Systemflag"));
   14.71 -		systemFlagsDefault->addFlag (fo);
   14.72 -		
   14.73 -		fo->load(QPixmap(flag_vymlink_xpm));
   14.74 -		fo->setName("vymLink");
   14.75 -		fo->setToolTip(tr("Link to another vym map","Systemflag"));
   14.76 -		systemFlagsDefault->addFlag (fo);	
   14.77 -
   14.78 -		fo->load(QPixmap(flag_scrolled_right_xpm));
   14.79 -		fo->setName("scrolledright");
   14.80 -		fo->setToolTip(tr("subtree is scrolled","Systemflag"));
   14.81 -		systemFlagsDefault->addFlag (fo);
   14.82 -		
   14.83 -		fo->load(QPixmap(flag_tmpUnscrolled_right_xpm));
   14.84 -		fo->setName("tmpUnscrolledright");
   14.85 -		fo->setToolTip(tr("subtree is temporary scrolled","Systemflag"));
   14.86 -		systemFlagsDefault->addFlag (fo);
   14.87 -		delete (fo);
   14.88 -	}
   14.89 -	if (!standardFlagsDefault)
   14.90 -	{
   14.91 -		standardFlagsDefault = new FlagRowObj (mapCanvas);
   14.92 -		standardFlagsDefault->setVisibility (false);
   14.93 -		standardFlagsDefault->setName ("standardFlagsDef");
   14.94 -
   14.95 -		FlagObj *fo = new FlagObj (mapCanvas);
   14.96 -		fo->load(QPixmap(flag_exclamationmark_xpm));
   14.97 -		fo->setName ("exclamationmark");
   14.98 -		fo->setGroup("standard-mark");
   14.99 -		fo->setToolTip(tr("Take care!","Standardflag"));
  14.100 -		standardFlagsDefault->addFlag (fo);	// makes deep copy
  14.101 -		
  14.102 -		fo->load(QPixmap(flag_questionmark_xpm));
  14.103 -		fo->setName("questionmark");
  14.104 -		fo->setGroup("standard-mark");
  14.105 -		fo->setToolTip(tr("Really?","Standardflag"));
  14.106 -		standardFlagsDefault->addFlag (fo);	
  14.107 -
  14.108 -		fo->load(QPixmap(flag_hook_green_xpm));
  14.109 -		fo->setName("hook-green");
  14.110 -		fo->setGroup("standard-hook");
  14.111 -		fo->setToolTip(tr("ok!","Standardflag"));
  14.112 -		standardFlagsDefault->addFlag (fo);	
  14.113 -
  14.114 -		fo->load(QPixmap(flag_cross_red_xpm));
  14.115 -		fo->setName("cross-red");
  14.116 -		fo->setGroup("standard-hook");
  14.117 -		fo->setToolTip(tr("Not ok!","Standardflag"));
  14.118 -		standardFlagsDefault->addFlag (fo);	
  14.119 -
  14.120 -		fo->load(QPixmap(flag_stopsign_xpm));
  14.121 -		fo->setName("stopsign");
  14.122 -		fo->setToolTip(tr("This won't work!","Standardflag"));
  14.123 -		standardFlagsDefault->addFlag (fo);	
  14.124 -
  14.125 -		fo->load(QPixmap(flag_smiley_good_xpm));
  14.126 -		fo->setName("smiley-good");
  14.127 -		fo->setGroup("standard-smiley");
  14.128 -		fo->setToolTip(tr("Good","Standardflag"));
  14.129 -		standardFlagsDefault->addFlag (fo);	
  14.130 -
  14.131 -		fo->load(QPixmap(flag_smiley_sad_xpm));
  14.132 -		fo->setName("smiley-sad");
  14.133 -		fo->setGroup("standard-smiley");
  14.134 -		fo->setToolTip(tr("Bad","Standardflag"));
  14.135 -		standardFlagsDefault->addFlag (fo);	
  14.136 -
  14.137 -		fo->load(QPixmap(flag_clock_xpm));
  14.138 -		fo->setName("clock");
  14.139 -		fo->setToolTip(tr("Time critical","Standardflag"));
  14.140 -		standardFlagsDefault->addFlag (fo);	
  14.141 -
  14.142 -		fo->load(QPixmap(flag_lamp_xpm));
  14.143 -		fo->setName("lamp");
  14.144 -		fo->setToolTip(tr("Idea!","Standardflag"));
  14.145 -		standardFlagsDefault->addFlag (fo);	
  14.146 -
  14.147 -		fo->load(QPixmap(flag_arrow_up_xpm));
  14.148 -		fo->setName("arrow-up");
  14.149 -		fo->setGroup("standard-arrow");
  14.150 -		fo->setToolTip(tr("Important","Standardflag"));
  14.151 -		standardFlagsDefault->addFlag (fo);	
  14.152 -
  14.153 -		fo->load(QPixmap(flag_arrow_down_xpm));
  14.154 -		fo->setName("arrow-down");
  14.155 -		fo->setGroup("standard-arrow");
  14.156 -		fo->setToolTip(tr("Unimportant","Standardflag"));
  14.157 -		standardFlagsDefault->addFlag (fo);	
  14.158 -
  14.159 -		fo->load(QPixmap(flag_thumb_up_xpm));
  14.160 -		fo->setName("thumb-up");
  14.161 -		fo->setGroup("standard-thumb");
  14.162 -		fo->setToolTip(tr("I like this","Standardflag"));
  14.163 -		standardFlagsDefault->addFlag (fo);	
  14.164 -
  14.165 -		fo->load(QPixmap(flag_thumb_down_xpm));
  14.166 -		fo->setName("thumb-down");
  14.167 -		fo->setGroup("standard-thumb");
  14.168 -		fo->setToolTip(tr("I like this","Standardflag"));
  14.169 -		fo->setToolTip(tr("I do not like this","Standardflag"));
  14.170 -		standardFlagsDefault->addFlag (fo);	
  14.171 -		
  14.172 -		fo->load(QPixmap(flag_heart_xpm));
  14.173 -		fo->setName("heart");
  14.174 -		fo->setToolTip(tr("I just love... ","Standardflag"));
  14.175 -		standardFlagsDefault->addFlag (fo);	
  14.176 -
  14.177 -		fo->load(QPixmap(flag_flash_xpm));
  14.178 -		fo->setName("flash");
  14.179 -		fo->setToolTip(tr("Dangerous","Standardflag"));
  14.180 -		standardFlagsDefault->addFlag (fo);	
  14.181 -		
  14.182 -		fo->load(QPixmap(flag_lifebelt_xpm));
  14.183 -		fo->setName("lifebelt");
  14.184 -		fo->setToolTip(tr("This will help","Standardflag"));
  14.185 -		standardFlagsDefault->addFlag (fo);	
  14.186 -		delete (fo);
  14.187 -
  14.188 -	}
  14.189 -	
  14.190      mapCenter = new MapCenterObj(mapCanvas);
  14.191      mapCenter->setVisibility (true);
  14.192  	mapCenter->setMapEditor (this);
  14.193  	mapCenter->setHeading (tr("New Map","Heading of mapcenter in new map"));
  14.194 +	mapCenter->move(mapCanvas->width()/2-mapCenter->width()/2,mapCanvas->height()/2-mapCenter->width()/2);
  14.195  
  14.196      printer=NULL;
  14.197  
  14.198 @@ -315,7 +160,6 @@
  14.199  	defXLinkColor=QColor (180,180,180);
  14.200  	linkcolorhint=DefaultColor;
  14.201  	linkstyle=StylePolyParabel;
  14.202 -	mapCanvas->setBackgroundColor (white);
  14.203  
  14.204  	// Create bitmap cursors, patform dependant
  14.205  	#if defined(Q_OS_MACX)
  14.206 @@ -468,6 +312,7 @@
  14.207  		mapCanvas->resize (cw,ch);
  14.208  		if ( (dx!=0) || (dy!=0) ) 
  14.209  		{
  14.210 +			cout << "ME:: canvas="<<cw<<","<<ch<<endl;
  14.211  			mapCenter->moveAllBy(dx,dy);
  14.212  			mapCenter->reposition();
  14.213  
  14.214 @@ -495,16 +340,6 @@
  14.215  	removeDir (QDir(tmpMapDir));
  14.216  }
  14.217  
  14.218 -
  14.219 -void MapEditor::makeSubDirs(const QString &s)
  14.220 -{
  14.221 -	QDir d(s);
  14.222 -	d.mkdir(s);
  14.223 -	d.mkdir ("images");	
  14.224 -	d.mkdir ("flags");	
  14.225 -}
  14.226 -
  14.227 -
  14.228  QString MapEditor::saveToDir(const QString &tmpdir, const QString &prefix, bool writeflags, const QPoint &offset, LinkableMapObj *saveSelection)
  14.229  {
  14.230  	// tmpdir		temporary directory to which data will be written
  14.231 @@ -512,8 +347,6 @@
  14.232  	// writeflags	Only write flags for "real" save of map, not undo
  14.233  	// offset		offset of bbox of whole map in canvas. 
  14.234  	//				Needed for XML export
  14.235 -	// completeMap	if false, only vympart will be written, without
  14.236 -	//				mapcenter
  14.237  	
  14.238  	// Save Header
  14.239  	QString ls;
  14.240 @@ -555,6 +388,9 @@
  14.241  	// Find the used flags while traversing the tree
  14.242  	standardFlagsDefault->resetUsedCounter();
  14.243  	
  14.244 +	// Reset the counters before saving
  14.245 +	FloatImageObj (mapCanvas).resetSaveCounter();
  14.246 +
  14.247  	// Build xml recursivly
  14.248  	if (!saveSelection)
  14.249  		s+=mapCenter->saveToDir(tmpdir,prefix,writeflags,offset);
  14.250 @@ -562,8 +398,10 @@
  14.251  	{
  14.252  		if ( typeid(*saveSelection) == typeid(BranchObj) )
  14.253  			s+=((BranchObj*)(saveSelection))->saveToDir(tmpdir,prefix,offset);
  14.254 -		else	
  14.255 -			if (selection && typeid(*selection)==typeid(BranchObj))
  14.256 +		else if ( typeid(*saveSelection) == typeid(FloatImageObj) )
  14.257 +			s+=((FloatImageObj*)(saveSelection))->saveToDir(tmpdir,prefix,offset);
  14.258 +			
  14.259 +		else if (selection && typeid(*selection)==typeid(BranchObj))
  14.260  				// This is used if selected branch is saved from mainwindow
  14.261  				s+=((BranchObj*)selection)->saveToDir(tmpdir,prefix,offset);
  14.262  	}
  14.263 @@ -921,7 +759,7 @@
  14.264  	return destPath;
  14.265  }
  14.266  
  14.267 -int MapEditor::load (QString &fname, const LoadMode &lmode)
  14.268 +int MapEditor::load (QString fname, LoadMode lmode)
  14.269  {
  14.270  	// Finish open lineEdits
  14.271  	if (lineedit) finishedLineEditNoSave();
  14.272 @@ -1394,59 +1232,27 @@
  14.273  
  14.274  	if (selection) 
  14.275  	{
  14.276 -		if (typeid(*selection) == typeid(BranchObj) ) 
  14.277 +		// write to directory
  14.278 +		QString clipfile="part";
  14.279 +		QString saveFile=saveToDir (fileDir,clipfile+"-",true,QPoint(),selection);
  14.280 +		QFile file;
  14.281 +
  14.282 +		file.setName ( clipboardDir + "/"+clipfile+".xml");
  14.283 +		if ( !file.open( IO_WriteOnly ) )
  14.284  		{
  14.285 -			BranchObj* to;
  14.286 -			BranchObj* from;
  14.287 -			clipboardME->clear();
  14.288 -			clipboardME->getMapCenter()->addBranch();
  14.289 -			to=clipboardME->getMapCenter()->getLastBranch();
  14.290 -			if (to) 
  14.291 -			{
  14.292 -				from=(BranchObj*)selection;
  14.293 -				to->copy(from);
  14.294 -
  14.295 -				// keep position relative to parent
  14.296 -				to->move2RelPos ( from->getRelPos());
  14.297 -
  14.298 -				// select data in clipboard
  14.299 -				// clipboardME->select ("bo:0");
  14.300 -
  14.301 -				// repositioning makes testing nicer,
  14.302 -				// but is not needed usually:
  14.303 -				if (clipboardME->isVisible())
  14.304 -					clipboardME->getMapCenter()->reposition();  
  14.305 -				else
  14.306 -					clipboardME->hide();
  14.307 -			}
  14.308 -		}    
  14.309 -		/* FIXME rewrite this using import/export
  14.310 -		   Currently there is a bug which would erase note, if
  14.311 -		   branchobj in clipboard is selected...
  14.312 -		if (typeid(*selection) == typeid(FloatImageObj) ) 
  14.313 -		{
  14.314 -			FloatImageObj* to;
  14.315 -			FloatImageObj* from;
  14.316 -			clipboardME->clear();
  14.317 -			clipboardME->getMapCenter()->addFloatImage();
  14.318 -			to=clipboardME->getMapCenter()->getLastFloatImage();
  14.319 -			if (to) 
  14.320 -			{
  14.321 -				from=(FloatImageObj*)selection;
  14.322 -				to->copy(from);
  14.323 -
  14.324 -				// select data in clipboard
  14.325 -				clipboardME->select ("fi:0");
  14.326 -
  14.327 -				// repositioning makes testing nicer,
  14.328 -				// but is not needed usually:
  14.329 -				if (clipboardME->isVisible())
  14.330 -					clipboardME->getMapCenter()->reposition();  
  14.331 -				else
  14.332 -					clipboardME->hide();
  14.333 -			}
  14.334 -		} 
  14.335 -		*/
  14.336 +			// This should neverever happen
  14.337 +			QMessageBox::critical (0,tr("Critical Export Error"),tr("MapEditor::exportXML couldn't open %1").arg(file.name()));
  14.338 +			return;
  14.339 +		}	
  14.340 +
  14.341 +		// Write it finally, and write in UTF8, no matter what 
  14.342 +		QTextStream ts( &file );
  14.343 +		ts.setEncoding (QTextStream::UnicodeUTF8);
  14.344 +		ts << saveFile;
  14.345 +		file.close();
  14.346 +
  14.347 +		clipboardEmpty=false;
  14.348 +		updateActions();
  14.349  	}	    
  14.350  }
  14.351  
  14.352 @@ -1618,74 +1424,30 @@
  14.353  	}							
  14.354  }
  14.355  
  14.356 -LinkableMapObj* MapEditor::pasteNoSave()
  14.357 +void MapEditor::pasteNoSave()
  14.358  {
  14.359  	// Finish open lineEdits
  14.360  	if (lineedit) finishedLineEditNoSave();
  14.361  
  14.362 -	clipboardME->select ("bo:0");
  14.363 -	LinkableMapObj *fromLMO=clipboardME->getSelection();
  14.364 -	LinkableMapObj *returnLMO=NULL;
  14.365 -
  14.366 -	if (selection && fromLMO) 
  14.367 -	{
  14.368 -		if (typeid(*fromLMO) == typeid(BranchObj) ) 
  14.369 -		{
  14.370 -			if (typeid(*selection) == typeid(MapCenterObj)) 
  14.371 -			{
  14.372 -				returnLMO=mapCenter->addBranch( (BranchObj*)(fromLMO) );
  14.373 -				((BranchObj*)(returnLMO))->move2RelPos(normalise(fromLMO->getRelPos() ) );
  14.374 -			}     
  14.375 -			if (typeid(*selection) == typeid(BranchObj)) 
  14.376 -					returnLMO=((BranchObj*)selection)->addBranch((BranchObj*)(fromLMO) );
  14.377 -		}
  14.378 -		
  14.379 -		if (typeid(*fromLMO) == typeid(FloatImageObj) &&
  14.380 -			(typeid(*selection) == typeid (BranchObj) || 
  14.381 -			 typeid(*selection)==typeid(MapCenterObj)) )
  14.382 -			returnLMO=((BranchObj*) selection)->addFloatImage ((FloatImageObj*)(fromLMO));
  14.383 -		
  14.384 -	}	    
  14.385 -	return returnLMO;
  14.386 +	load (clipboardDir+"/part.xml",ImportAdd);
  14.387  }
  14.388  
  14.389  void MapEditor::cutNoSave()
  14.390  {
  14.391 -	// Finish open lineEdits
  14.392 -	if (lineedit) finishedLineEditNoSave();
  14.393 -
  14.394 -	BranchObj* bo;
  14.395 -	BranchObj* par; 
  14.396 -	if (selection != NULL) {
  14.397 -		if (typeid(*selection) == typeid(BranchObj) ) 
  14.398 -		{
  14.399 -			bo=(BranchObj*)selection;
  14.400 -			par=(BranchObj*)(bo->getParObj());
  14.401 -			bo->unselect();
  14.402 -			selection=NULL;
  14.403 -			par->removeBranch(bo);
  14.404 -			selection=par;
  14.405 -			selection->select();
  14.406 -		}
  14.407 -		if (typeid(*selection) == typeid(FloatImageObj) ) 
  14.408 -		{
  14.409 -			FloatImageObj* fio=(FloatImageObj*)selection;
  14.410 -			par=(BranchObj*)(fio->getParObj());
  14.411 -			fio->unselect();
  14.412 -			selection=NULL;
  14.413 -			par->removeFloatImage(fio);
  14.414 -			selection=par;
  14.415 -			selection->select();
  14.416 -		}
  14.417 -	}	    
  14.418 +	copy();
  14.419 +	deleteSelection();
  14.420  }
  14.421  
  14.422  void MapEditor::paste()
  14.423  {   
  14.424 -	saveState(selection);
  14.425 -	pasteNoSave();
  14.426 -	mapCenter->reposition();
  14.427 -	adjustCanvasSize();
  14.428 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
  14.429 +				      typeid(*selection) == typeid(MapCenterObj))) 
  14.430 +	{
  14.431 +		saveState(selection);
  14.432 +		pasteNoSave();
  14.433 +		mapCenter->reposition();
  14.434 +		adjustCanvasSize();
  14.435 +	}
  14.436  }
  14.437  
  14.438  void MapEditor::cut()
  14.439 @@ -2807,7 +2569,7 @@
  14.440  
  14.441  			actionEditCopy->setEnabled (true);	
  14.442  			actionEditCut->setEnabled (true);	
  14.443 -			if (clipboardME->getMapCenter()->countBranches()>0 || clipboardME->getMapCenter()->countFloatImages()>0)
  14.444 +			if (!clipboardEmpty)
  14.445  				actionEditPaste->setEnabled (true);	
  14.446  			else	
  14.447  				actionEditPaste->setEnabled (false);	
  14.448 @@ -3247,8 +3009,7 @@
  14.449  void MapEditor::testFunction()
  14.450  {
  14.451  	cout << "MapEditor::testFunction() called\n";
  14.452 -	QDir d("/fasl");
  14.453 -	removeDir (d);
  14.454 +	load (clipboardDir+"/part.xml",ImportAdd);
  14.455  }
  14.456  
  14.457  void MapEditor::ensureSelectionVisible()
  14.458 @@ -3681,7 +3442,7 @@
  14.459  					bs->moveBranchTo ( (BranchObj*)(dst->getParObj()), ((BranchObj*)(dst))->getNum());
  14.460  				} else 
  14.461  				if (e->state() & QMouseEvent::ControlButton)
  14.462 -				{
  14.463 +			{
  14.464  					bs->moveBranchTo ( (BranchObj*)(dst->getParObj()), ((BranchObj*)(dst))->getNum()+1);
  14.465  				} else	
  14.466  				{
  14.467 @@ -3731,9 +3492,6 @@
  14.468  void MapEditor::resizeEvent (QResizeEvent* e)
  14.469  {
  14.470  	QCanvasView::resizeEvent( e );
  14.471 -	
  14.472 -	QString s="";
  14.473 -	if (!fileName.isEmpty()) s=fileName;
  14.474  	adjustCanvasSize();
  14.475  }
  14.476  
    15.1 --- a/mapeditor.h	Thu Sep 22 12:56:05 2005 +0000
    15.2 +++ b/mapeditor.h	Mon Oct 10 11:20:25 2005 +0000
    15.3 @@ -31,8 +31,6 @@
    15.4  private:
    15.5  	void makeTmpDirs();		// create temporary directories
    15.6  	void delTmpDirs();		// delete temporary directories
    15.7 -	void makeSubDirs(const QString&);		
    15.8 -							// create subdirs in dir
    15.9      QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*);
   15.10      void saveState();		// save actual state to backup
   15.11      void saveState(LinkableMapObj *);
   15.12 @@ -61,7 +59,7 @@
   15.13  	QString getFileName ();	// e.g. "map.xml"
   15.14  	QString getMapName ();	// e.g. "map"
   15.15  	QString getDestPath (); // e.g. "/home/tux/map.vym"
   15.16 -    int load (QString&, const LoadMode &);	// newmap, import/replace selection
   15.17 +    int load (QString, LoadMode );	// newmap, import/replace selection
   15.18  public:
   15.19      int save(const SaveMode &);	// Save map 
   15.20  	void setZipped(bool);		// save map zipped
   15.21 @@ -82,7 +80,7 @@
   15.22      void undo();		// undo last action
   15.23  private:	
   15.24      void undoXML(const QString &, const QString &);
   15.25 -    LinkableMapObj* pasteNoSave();		// paste clipboard to branch
   15.26 +    void pasteNoSave();		// paste clipboard to branch
   15.27      void cutNoSave();	// cut to clipboard
   15.28  public:	
   15.29      void paste();		// paste clipboard to branch and backup
    16.1 --- a/mapobj.cpp	Thu Sep 22 12:56:05 2005 +0000
    16.2 +++ b/mapobj.cpp	Mon Oct 10 11:20:25 2005 +0000
    16.3 @@ -6,9 +6,8 @@
    16.4  /////////////////////////////////////////////////////////////////
    16.5  MapObj::MapObj ()
    16.6  {
    16.7 -	// TODO not used any longer...
    16.8 -	cout << "Const MapObj (): Please set canvas somehow!!!\n";
    16.9 -    // canvas=actMapEditor->getCanvas();
   16.10 +	//qWarning ( "Const MapObj (): Please set canvas somehow!!!");
   16.11 +	canvas=NULL;
   16.12      init ();
   16.13  }
   16.14  
   16.15 @@ -94,7 +93,7 @@
   16.16  {
   16.17      if (p.x() >= bbox.left() && p.x() <= bbox.right()  
   16.18  	&& p.y() <= bbox.bottom() && p.y() >= bbox.top() )
   16.19 -	return true;
   16.20 +		return true;
   16.21      return false;	
   16.22  }
   16.23  
    17.1 --- a/misc.cpp	Thu Sep 22 12:56:05 2005 +0000
    17.2 +++ b/misc.cpp	Mon Oct 10 11:20:25 2005 +0000
    17.3 @@ -184,6 +184,14 @@
    17.4  		qWarning ("removeDir("+d.path()+") failed!");
    17.5  }		
    17.6  
    17.7 +void makeSubDirs (const QString &s)
    17.8 +{
    17.9 +	QDir d(s);
   17.10 +	d.mkdir(s);
   17.11 +	d.mkdir ("images");	
   17.12 +	d.mkdir ("flags");	
   17.13 +}
   17.14 +
   17.15  // returns masked "<" ">" "&"
   17.16  QString quotemeta(const QString &s)
   17.17  {
    18.1 --- a/misc.h	Thu Sep 22 12:56:05 2005 +0000
    18.2 +++ b/misc.h	Mon Oct 10 11:20:25 2005 +0000
    18.3 @@ -19,6 +19,7 @@
    18.4  QString convertToRel (const QString &,const QString &);
    18.5  QString makeUniqueDir (QString);
    18.6  void removeDir(QDir);
    18.7 +void makeSubDirs (const QString &);
    18.8  QString quotemeta(const QString&);	
    18.9  int max (int,int);
   18.10  class BranchObj;
    19.1 --- a/tex/vym.changelog	Thu Sep 22 12:56:05 2005 +0000
    19.2 +++ b/tex/vym.changelog	Mon Oct 10 11:20:25 2005 +0000
    19.3 @@ -1,3 +1,16 @@
    19.4 +-------------------------------------------------------------------
    19.5 +Mon Oct 10 13:18:29 CEST 2005 - uwedr
    19.6 +
    19.7 +- Bugfix: Copy/Paste was currently not possible for images. Now
    19.8 +  completly rewrote mechanism. Instead of invisible map now XML import
    19.9 +  is used (Multiple clipboards should be not difficult now) 
   19.10 +
   19.11 +-------------------------------------------------------------------
   19.12 +Mon Oct  3 10:33:09 CEST 2005 - uwe
   19.13 +
   19.14 +- Bugfix: Added small fix from Khaled Ahmed needed for display of 
   19.15 +  arabic languages 
   19.16 +
   19.17  -------------------------------------------------------------------
   19.18  Mon Sep 12 21:39:38 CEST 2005 - uwedr
   19.19  
   19.20 @@ -26,10 +39,10 @@
   19.21  Tue Aug 30 13:38:31 CEST 2005 - uwedr
   19.22  
   19.23  - Bugfix: Fixed pasting vymlinks: Pasting a branch to a target in
   19.24 -  another map caused vym to go in an endless loop, if the vymlink of the
   19.25 +  another map caused vym to go into an endless loop, if the vymlink of the
   19.26    branch pointed to the new map.
   19.27 -- Bugfix: Invisible floatimages (which have a scrolled parent) can
   19.28 -  no longer can be selected  
   19.29 +- Bugfix: Invisible floatimages (which have a scrolled parent) no longer
   19.30 +  can be selected  
   19.31  
   19.32  -------------------------------------------------------------------
   19.33  Fri Aug 19 09:12:49 CEST 2005 - uwedr
    20.1 --- a/version.h	Thu Sep 22 12:56:05 2005 +0000
    20.2 +++ b/version.h	Mon Oct 10 11:20:25 2005 +0000
    20.3 @@ -2,6 +2,6 @@
    20.4  #define VERSION_H
    20.5  
    20.6  #define __VYM_VERSION__ "1.7.5"
    20.7 -#define __BUILD_DATE__ "September 22, 2005"
    20.8 +#define __BUILD_DATE__ "October 10, 2005"
    20.9  
   20.10  #endif
    21.1 --- a/xml.cpp	Thu Sep 22 12:56:05 2005 +0000
    21.2 +++ b/xml.cpp	Mon Oct 10 11:20:25 2005 +0000
    21.3 @@ -176,11 +176,10 @@
    21.4          lastBranch->addFloatImage();
    21.5  		lastFloat=lastBranch->getLastFloatImage();
    21.6  		if (!readFloatImageAttr(atts)) return false;
    21.7 -	} else if ( eName == "branch" && state == StateMap) 
    21.8 +	} else if ( (eName == "branch"||eName=="floatimage") && state == StateMap) 
    21.9  	{
   21.10  		// This is used in vymparts, which have no mapcenter!
   21.11  		isVymPart=true;
   21.12 -		state=StateBranch;
   21.13  		LinkableMapObj* lmo=me->getSelection();
   21.14  		if (!lmo)
   21.15  		{
   21.16 @@ -194,17 +193,26 @@
   21.17  				|| (typeid(*lmo) == typeid(MapCenterObj) ) )
   21.18  		{
   21.19  			lastBranch=(BranchObj*)(lmo);
   21.20 -			if (loadMode==ImportAdd)
   21.21 +			if (eName=="branch")
   21.22  			{
   21.23 -				lastBranch->addBranch();
   21.24 -				lastBranch=lastBranch->getLastBranch();
   21.25 -				
   21.26 -			} else
   21.27 -				lastBranch->clear();
   21.28 -		} else
   21.29 -			return false;
   21.30 -		branchDepth=1;
   21.31 -		readBranchAttr (atts);
   21.32 +				state=StateBranch;
   21.33 +				if (loadMode==ImportAdd)
   21.34 +				{
   21.35 +					lastBranch->addBranch();
   21.36 +					lastBranch=lastBranch->getLastBranch();
   21.37 +					
   21.38 +				} else
   21.39 +					lastBranch->clear();
   21.40 +				branchDepth=1;
   21.41 +				readBranchAttr (atts);
   21.42 +			} else if (eName=="floatimage")
   21.43 +			{
   21.44 +				state=StateFloatImage;
   21.45 +				lastBranch->addFloatImage();
   21.46 +				lastFloat=lastBranch->getLastFloatImage();
   21.47 +				if (!readFloatImageAttr(atts)) return false;
   21.48 +			} else return false;
   21.49 +		} else return false;
   21.50  	} else if ( eName == "branch" && state == StateMapCenter) 
   21.51  	{
   21.52  		state=StateBranch;
   21.53 @@ -279,6 +287,7 @@
   21.54          case StateMapCenterHeading: state=StateMapCenter;  return true;
   21.55          case StateMapCenterNote: state=StateMapCenter;  return true;
   21.56          case StateMapCenterFloatImage: state=StateMapCenter;  return true;
   21.57 +        case StateFloatImage: state=StateMap; return true;
   21.58          case StateBranch: 
   21.59              if (branchDepth>1) 
   21.60  			{
    22.1 --- a/xml.h	Thu Sep 22 12:56:05 2005 +0000
    22.2 +++ b/xml.h	Mon Oct 10 11:20:25 2005 +0000
    22.3 @@ -16,7 +16,7 @@
    22.4  	~mapBuilderHandler();
    22.5  	QString errorProtocol();
    22.6  	bool startDocument();
    22.7 -	QString mapBuilderHandler::parseHREF(QString);
    22.8 +	QString parseHREF(QString);
    22.9  	bool startElement ( const QString&, const QString&,
   22.10                          const QString& eName, const QXmlAttributes& atts ); 
   22.11  	bool   endElement ( const QString&, const QString&, const QString& ); 
   22.12 @@ -40,6 +40,7 @@
   22.13  	{ 
   22.14  		StateInit, StateMap, StateMapSelect, 
   22.15  		StateMapSetting,
   22.16 +		StateFloatImage,
   22.17  		StateMapCenter, StateMapCenterStandardFlag,
   22.18  		StateMapCenterHeading, StateMapCenterNote, 
   22.19  		StateMapCenterFloatImage,