Switch to Qt 4.6.0: Removing QtAnimation framework
authorinsilmaril
Thu, 18 Mar 2010 11:31:02 +0000
changeset 8375ecd0462f76b
parent 836 62d621e3e550
child 838 e4a44912646c
Switch to Qt 4.6.0: Removing QtAnimation framework
findresultmodel.cpp
findresultmodel.h
flag.cpp
flag.h
mainwindow.cpp
mainwindow.h
mapeditor.cpp
mapeditor.h
tex/vym.changelog
version.h
vym.pro
vymmodel.cpp
vymmodel.h
vymview.cpp
xml-vym.cpp
     1.1 --- a/findresultmodel.cpp	Mon Mar 15 15:32:37 2010 +0000
     1.2 +++ b/findresultmodel.cpp	Thu Mar 18 11:31:02 2010 +0000
     1.3 @@ -223,4 +223,7 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 +void FindResultModel::addSubItem (TreeItem *parent,const QString &s, TreeItem *ti, int index)
     1.8 +{
     1.9 +}
    1.10  
     2.1 --- a/findresultmodel.h	Mon Mar 15 15:32:37 2010 +0000
     2.2 +++ b/findresultmodel.h	Thu Mar 18 11:31:02 2010 +0000
     2.3 @@ -48,6 +48,7 @@
     2.4  
     2.5  	void addItem (TreeItem *ti);
     2.6  	void addItem (const QString &s);
     2.7 +	void addSubItem (TreeItem *parent,const QString &s, TreeItem *ti, int index);
     2.8  
     2.9  private:
    2.10  
     3.1 --- a/flag.cpp	Mon Mar 15 15:32:37 2010 +0000
     3.2 +++ b/flag.cpp	Thu Mar 18 11:31:02 2010 +0000
     3.3 @@ -11,6 +11,12 @@
     3.4      init ();
     3.5  }
     3.6  
     3.7 +Flag::Flag(const QString &fname)
     3.8 +{
     3.9 +    init ();
    3.10 +	load (fname);
    3.11 +}
    3.12 +
    3.13  Flag::Flag (Flag* io)
    3.14  {
    3.15  	//cout << "Const Flag (Flag)\n";
    3.16 @@ -49,7 +55,7 @@
    3.17  void Flag::load (const QString &fn)
    3.18  {
    3.19  	if (!pixmap.load(fn))
    3.20 -		qDebug()<<"Flag::load failed to load "<<fn;
    3.21 +		qDebug()<<"Flag::load ("<<fn<<") failed.";
    3.22  }
    3.23  
    3.24  void Flag::load (const QPixmap &pm)
     4.1 --- a/flag.h	Mon Mar 15 15:32:37 2010 +0000
     4.2 +++ b/flag.h	Thu Mar 18 11:31:02 2010 +0000
     4.3 @@ -18,6 +18,7 @@
     4.4  class Flag:public XMLObj {
     4.5  public:
     4.6      Flag ();
     4.7 +    Flag (const QString &fname);
     4.8      Flag (Flag*);
     4.9      ~Flag ();
    4.10      virtual void init ();
     5.1 --- a/mainwindow.cpp	Mon Mar 15 15:32:37 2010 +0000
     5.2 +++ b/mainwindow.cpp	Thu Mar 18 11:31:02 2010 +0000
     5.3 @@ -272,6 +272,7 @@
     5.4  	settings.setValue( "/version/builddate", vymBuildDate );
     5.5  
     5.6  	settings.setValue( "/mainwindow/autosave/use",actionSettingsAutosaveToggle->isOn() );
     5.7 +	settings.setValue ("/mainwindow/autoLayout/use",actionSettingsAutoLayoutToggle->isOn() );
     5.8  	settings.setValue( "/mapeditor/editmode/autoSelectNewBranch",actionSettingsAutoSelectNewBranch->isOn() );
     5.9  	settings.setValue( "/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
    5.10  	settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
    5.11 @@ -666,16 +667,6 @@
    5.12  
    5.13  
    5.14  	// Add branch by inserting it at selection
    5.15 -	a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
    5.16 -	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
    5.17 -	a->setShortcut (Qt::ALT + Qt::Key_Insert );		//Insert branch
    5.18 -	a->setShortcutContext (Qt::WindowShortcut);
    5.19 -	switchboard.addConnection(a,tr("Edit","Shortcut group"));
    5.20 -	addAction (a);
    5.21 -	connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
    5.22 -	a->setEnabled (false);
    5.23 -	actionListBranches.append(a);
    5.24 -	actionAddBranchBefore=a;
    5.25  	a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
    5.26  	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
    5.27  	a->setShortcut ( Qt::ALT + Qt::Key_A );			//Insert branch
    5.28 @@ -684,6 +675,7 @@
    5.29  	addAction (a);
    5.30  	connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
    5.31  	actionListBranches.append(a);
    5.32 +	actionAddBranchBefore=a;
    5.33  
    5.34  	// Add branch above
    5.35  	a = new QAction(tr( "Add branch above","Edit menu" ), this);
    5.36 @@ -1214,7 +1206,7 @@
    5.37  
    5.38  	a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this);
    5.39  	a->setStatusTip (tr( "Show selection" ));
    5.40 -	a->setShortcut(Qt::CTRL + Qt::Key_Period);
    5.41 +	a->setShortcut(Qt::Key_Period);
    5.42  	switchboard.addConnection(a,tr("View shortcuts","Shortcut group"));
    5.43  	a->addTo( tb );
    5.44  	viewMenu->addAction (a);
    5.45 @@ -1332,28 +1324,25 @@
    5.46  	// Create System Flags
    5.47  	QToolBar *tb=NULL;
    5.48  
    5.49 -	Flag *flag=new Flag;;
    5.50 -	flag->setVisible(true);
    5.51 -
    5.52 -	flag->load(flagsPath+"flag-note.png");
    5.53 +	Flag *flag=new Flag(flagsPath+"flag-note.png");
    5.54  	setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
    5.55  
    5.56 -	flag->load(flagsPath+"flag-url.png");
    5.57 +	flag=new Flag(flagsPath+"flag-url.png");
    5.58  	setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
    5.59  
    5.60 -	flag->load(flagsPath+"flag-url-bugzilla-novell.png");
    5.61 +	flag=new Flag(flagsPath+"flag-url-bugzilla-novell.png");
    5.62  	setupFlag (flag,tb,"system-url-bugzilla-novell",tr("URL to Bugzilla ","SystemFlag"));
    5.63  
    5.64 -	flag->load(flagsPath+"flag-vymlink.png");
    5.65 +	flag=new Flag(flagsPath+"flag-vymlink.png");
    5.66  	setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
    5.67  
    5.68 -	flag->load(flagsPath+"flag-scrolled-right.png");
    5.69 +	flag=new Flag(flagsPath+"flag-scrolled-right.png");
    5.70  	setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
    5.71  
    5.72 -	flag->load(flagsPath+"flag-tmpUnscrolled-right.png");
    5.73 +	flag=new Flag(flagsPath+"flag-tmpUnscrolled-right.png");
    5.74  	setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
    5.75  
    5.76 -	flag->load(flagsPath+"flag-hideexport.png");
    5.77 +	flag=new Flag(flagsPath+"flag-hideexport.png");
    5.78  	setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
    5.79  
    5.80  	// Create Standard Flags
    5.81 @@ -1361,170 +1350,189 @@
    5.82  	tb->setObjectName ("standardFlagTB");
    5.83  	standardFlagsMaster->setToolBar (tb);
    5.84  
    5.85 -	flag->load(flagsPath+"flag-exclamationmark.png");
    5.86 +	flag=new Flag(flagsPath+"flag-exclamationmark.png");
    5.87  	flag->setGroup("standard-mark");
    5.88  	setupFlag (flag,tb,"exclamationmark",tr("Take care!","Standardflag"));
    5.89  
    5.90 -	flag->load(flagsPath+"flag-questionmark.png");
    5.91 +	flag=new Flag(flagsPath+"flag-questionmark.png");
    5.92  	flag->setGroup("standard-mark");
    5.93  	setupFlag (flag,tb,"questionmark",tr("Really?","Standardflag"));
    5.94  
    5.95 -	flag->load(flagsPath+"flag-hook-green.png");
    5.96 +	flag=new Flag(flagsPath+"flag-hook-green.png");
    5.97  	flag->setGroup("standard-status");
    5.98  	setupFlag (flag,tb,"hook-green",tr("Status - ok,done","Standardflag"));
    5.99  
   5.100 -	flag->load(flagsPath+"flag-wip.png");
   5.101 +	flag=new Flag(flagsPath+"flag-wip.png");
   5.102  	flag->setGroup("standard-status");
   5.103  	setupFlag (flag,tb,"wip",tr("Status - work in progress","Standardflag"));
   5.104  
   5.105 -	flag->load(flagsPath+"flag-cross-red.png");
   5.106 +	flag=new Flag(flagsPath+"flag-cross-red.png");
   5.107  	flag->setGroup("standard-status");
   5.108  	setupFlag (flag,tb,"cross-red",tr("Status - missing, not started","Standardflag"));
   5.109  	flag->unsetGroup();
   5.110  
   5.111 -	flag->load(flagsPath+"flag-stopsign.png");
   5.112 +	flag=new Flag(flagsPath+"flag-stopsign.png");
   5.113  	setupFlag (flag,tb,"stopsign",tr("This won't work!","Standardflag"));
   5.114  
   5.115 -	flag->load(flagsPath+"flag-smiley-good.png");
   5.116 +	flag=new Flag(flagsPath+"flag-smiley-good.png");
   5.117  	flag->setGroup("standard-smiley");
   5.118  	setupFlag (flag,tb,"smiley-good",tr("Good","Standardflag"));
   5.119  
   5.120 -	flag->load(flagsPath+"flag-smiley-sad.png");
   5.121 +	flag=new Flag(flagsPath+"flag-smiley-sad.png");
   5.122  	flag->setGroup("standard-smiley");
   5.123  	setupFlag (flag,tb,"smiley-sad",tr("Bad","Standardflag"));
   5.124  
   5.125 -	flag->load(flagsPath+"flag-smiley-omg.png");
   5.126 +	flag=new Flag(flagsPath+"flag-smiley-omg.png");
   5.127  	flag->setGroup("standard-smiley");
   5.128  	setupFlag (flag,tb,"smiley-omb",tr("Oh no!","Standardflag"));
   5.129  	// Original omg.png (in KDE emoticons)
   5.130  	flag->unsetGroup();
   5.131  
   5.132 -	flag->load(flagsPath+"flag-kalarm.png");
   5.133 +	flag=new Flag(flagsPath+"flag-kalarm.png");
   5.134  	setupFlag (flag,tb,"clock",tr("Time critical","Standardflag"));
   5.135  
   5.136 -	flag->load(flagsPath+"flag-phone.png");
   5.137 +	flag=new Flag(flagsPath+"flag-phone.png");
   5.138  	setupFlag (flag,tb,"phone",tr("Call...","Standardflag"));
   5.139  
   5.140 -	flag->load(flagsPath+"flag-lamp.png");
   5.141 +	flag=new Flag(flagsPath+"flag-lamp.png");
   5.142  	setupFlag (flag,tb,"lamp",tr("Idea!","Standardflag"));
   5.143  
   5.144 -	flag->load(flagsPath+"flag-arrow-up.png");
   5.145 +	flag=new Flag(flagsPath+"flag-arrow-up.png");
   5.146  	flag->setGroup("standard-arrow");
   5.147  	setupFlag (flag,tb,"arrow-up",tr("Important","Standardflag"));
   5.148  
   5.149 -	flag->load(flagsPath+"flag-arrow-down.png");
   5.150 +	flag=new Flag(flagsPath+"flag-arrow-down.png");
   5.151  	flag->setGroup("standard-arrow");
   5.152  	setupFlag (flag,tb,"arrow-down",tr("Unimportant","Standardflag"));
   5.153  
   5.154 -	flag->load(flagsPath+"flag-arrow-2up.png");
   5.155 +	flag=new Flag(flagsPath+"flag-arrow-2up.png");
   5.156  	flag->setGroup("standard-arrow");
   5.157  	setupFlag (flag,tb,"2arrow-up",tr("Very important!","Standardflag"));
   5.158  
   5.159 -	flag->load(flagsPath+"flag-arrow-2down.png");
   5.160 +	flag=new Flag(flagsPath+"flag-arrow-2down.png");
   5.161  	flag->setGroup("standard-arrow");
   5.162  	setupFlag (flag,tb,"2arrow-down",tr("Very unimportant!","Standardflag"));
   5.163  	flag->unsetGroup();
   5.164  
   5.165 -	flag->load(flagsPath+"flag-thumb-up.png");
   5.166 +	flag=new Flag(flagsPath+"flag-thumb-up.png");
   5.167  	flag->setGroup("standard-thumb");
   5.168  	setupFlag (flag,tb,"thumb-up",tr("I like this","Standardflag"));
   5.169  
   5.170 -	flag->load(flagsPath+"flag-thumb-down.png");
   5.171 +	flag=new Flag(flagsPath+"flag-thumb-down.png");
   5.172  	flag->setGroup("standard-thumb");
   5.173  	setupFlag (flag,tb,"thumb-down",tr("I do not like this","Standardflag"));
   5.174  	flag->unsetGroup();
   5.175  
   5.176 -	flag->load(flagsPath+"flag-rose.png");
   5.177 +	flag=new Flag(flagsPath+"flag-rose.png");
   5.178  	setupFlag (flag,tb,"rose",tr("Rose","Standardflag"));
   5.179  
   5.180 -	flag->load(flagsPath+"flag-heart.png");
   5.181 +	flag=new Flag(flagsPath+"flag-heart.png");
   5.182  	setupFlag (flag,tb,"heart",tr("I just love...","Standardflag"));
   5.183  
   5.184 -	flag->load(flagsPath+"flag-present.png");
   5.185 +	flag=new Flag(flagsPath+"flag-present.png");
   5.186  	setupFlag (flag,tb,"present",tr("Surprise!","Standardflag"));
   5.187  
   5.188 -	flag->load(flagsPath+"flag-flash.png");
   5.189 +	flag=new Flag(flagsPath+"flag-flash.png");
   5.190  	setupFlag (flag,tb,"flash",tr("Dangerous","Standardflag"));
   5.191  
   5.192  	// Original: xsldbg_output.png
   5.193 -	flag->load(flagsPath+"flag-info.png");
   5.194 +	flag=new Flag(flagsPath+"flag-info.png");
   5.195  	setupFlag (flag,tb,"info",tr("Info","Standardflag"));
   5.196  
   5.197  	// Original khelpcenter.png
   5.198 -	flag->load(flagsPath+"flag-lifebelt.png");
   5.199 +	flag=new Flag(flagsPath+"flag-lifebelt.png");
   5.200  	setupFlag (flag,tb,"lifebelt",tr("This will help","Standardflag"));
   5.201  
   5.202  	// Freemind flags
   5.203 +	flag=new Flag(flagsPath+"freemind/warning.png");
   5.204  	flag->setVisible(false);
   5.205 -	flag->load(flagsPath+"freemind/warning.png");
   5.206  	setupFlag (flag,tb,  "freemind-warning",tr("Important","Freemind-Flag"));
   5.207  
   5.208  	for (int i=1; i<8; i++)
   5.209  	{
   5.210 -		flag->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
   5.211 +		flag=new Flag(flagsPath+QString("freemind/priority-%1.png").arg(i));
   5.212  		setupFlag (flag,tb, QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
   5.213  	}
   5.214  
   5.215 -	flag->load(flagsPath+"freemind/back.png");
   5.216 +	flag=new Flag(flagsPath+"freemind/back.png");
   5.217 +	flag->setVisible(false);
   5.218  	setupFlag (flag,tb,"freemind-back",tr("Back","Freemind-Flag"));
   5.219  
   5.220 -	flag->load(flagsPath+"freemind/forward.png");
   5.221 +	flag=new Flag(flagsPath+"freemind/forward.png");
   5.222 +	flag->setVisible(false);
   5.223  	setupFlag (flag,tb,"freemind-forward",tr("forward","Freemind-Flag"));
   5.224  
   5.225 -	flag->load(flagsPath+"freemind/attach.png");
   5.226 +	flag=new Flag(flagsPath+"freemind/attach.png");
   5.227 +	flag->setVisible(false);
   5.228  	setupFlag (flag,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
   5.229  
   5.230 -	flag->load(flagsPath+"freemind/clanbomber.png");
   5.231 +	flag=new Flag(flagsPath+"freemind/clanbomber.png");
   5.232 +	flag->setVisible(false);
   5.233  	setupFlag (flag,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
   5.234  
   5.235 -	flag->load(flagsPath+"freemind/desktopnew.png");
   5.236 +	flag=new Flag(flagsPath+"freemind/desktopnew.png");
   5.237 +	flag->setVisible(false);
   5.238  	setupFlag (flag,tb,"freemind-desktopnew",tr("Don't flagrget","Freemind-Flag"));
   5.239  
   5.240 -	flag->load(flagsPath+"freemind/flag.png");
   5.241 +	flag=new Flag(flagsPath+"freemind/flag.png");
   5.242 +	flag->setVisible(false);
   5.243  	setupFlag (flag,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
   5.244  
   5.245  
   5.246 -	flag->load(flagsPath+"freemind/gohome.png");
   5.247 +	flag=new Flag(flagsPath+"freemind/gohome.png");
   5.248 +	flag->setVisible(false);
   5.249  	setupFlag (flag,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
   5.250  
   5.251 -
   5.252 -	flag->load(flagsPath+"freemind/kaddressbook.png");
   5.253 +	flag=new Flag(flagsPath+"freemind/kaddressbook.png");
   5.254 +	flag->setVisible(false);
   5.255  	setupFlag (flag,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
   5.256  
   5.257 -	flag->load(flagsPath+"freemind/knotify.png");
   5.258 +	flag=new Flag(flagsPath+"freemind/knotify.png");
   5.259 +	flag->setVisible(false);
   5.260  	setupFlag (flag,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
   5.261  
   5.262 -	flag->load(flagsPath+"freemind/korn.png");
   5.263 +	flag=new Flag(flagsPath+"freemind/korn.png");
   5.264 +	flag->setVisible(false);
   5.265  	setupFlag (flag,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
   5.266  
   5.267 -	flag->load(flagsPath+"freemind/mail.png");
   5.268 +	flag=new Flag(flagsPath+"freemind/mail.png");
   5.269 +	flag->setVisible(false);
   5.270  	setupFlag (flag,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
   5.271  
   5.272 -	flag->load(flagsPath+"freemind/password.png");
   5.273 +	flag=new Flag(flagsPath+"freemind/password.png");
   5.274 +	flag->setVisible(false);
   5.275  	setupFlag (flag,tb,"freemind-password",tr("Password","Freemind-Flag"));
   5.276  
   5.277 -	flag->load(flagsPath+"freemind/pencil.png");
   5.278 +	flag=new Flag(flagsPath+"freemind/pencil.png");
   5.279 +	flag->setVisible(false);
   5.280  	setupFlag (flag,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
   5.281  
   5.282 -	flag->load(flagsPath+"freemind/stop.png");
   5.283 +	flag=new Flag(flagsPath+"freemind/stop.png");
   5.284 +	flag->setVisible(false);
   5.285  	setupFlag (flag,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
   5.286  
   5.287 -	flag->load(flagsPath+"freemind/wizard.png");
   5.288 +	flag=new Flag(flagsPath+"freemind/wizard.png");
   5.289 +	flag->setVisible(false);
   5.290  	setupFlag (flag,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
   5.291  
   5.292 -	flag->load(flagsPath+"freemind/xmag.png");
   5.293 +	flag=new Flag(flagsPath+"freemind/xmag.png");
   5.294 +	flag->setVisible(false);
   5.295  	setupFlag (flag,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
   5.296  
   5.297 -	flag->load(flagsPath+"freemind/bell.png");
   5.298 +	flag=new Flag(flagsPath+"freemind/bell.png");
   5.299 +	flag->setVisible(false);
   5.300  	setupFlag (flag,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
   5.301  
   5.302 -	flag->load(flagsPath+"freemind/bookmark.png");
   5.303 +	flag=new Flag(flagsPath+"freemind/bookmark.png");
   5.304 +	flag->setVisible(false);
   5.305  	setupFlag (flag,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
   5.306  
   5.307 -	flag->load(flagsPath+"freemind/penguin.png");
   5.308 +	flag= new Flag(flagsPath+"freemind/penguin.png");
   5.309 +	flag->setVisible(false);
   5.310  	setupFlag (flag,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
   5.311  
   5.312 -	flag->load(flagsPath+"freemind/licq.png");
   5.313 +	flag=new Flag (flagsPath+"freemind/licq.png");
   5.314 +	flag->setVisible(false);
   5.315  	setupFlag (flag,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
   5.316  }
   5.317  
   5.318 @@ -1672,6 +1680,8 @@
   5.319  	settingsMenu->addAction (a);
   5.320  	actionSettingsUseHideExport=a;
   5.321  
   5.322 +	settingsMenu->addSeparator();
   5.323 +
   5.324  	a = new QAction( tr( "Animation","Settings action"), this);
   5.325  	a->setStatusTip( tr( "Animation"));
   5.326  	a->setToggleAction(true);
   5.327 @@ -1679,6 +1689,15 @@
   5.328  	connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
   5.329  	settingsMenu->addAction (a);
   5.330  	actionSettingsUseAnimation=a;
   5.331 +
   5.332 +	a = new QAction( tr( "Automatic layout","Settings action"), this);
   5.333 +	a->setStatusTip( tr( "Automatic layout"));
   5.334 +	a->setToggleAction(true);
   5.335 +	a->setChecked ( settings.value ("/mainwindow/autoLayout/use",true).toBool());
   5.336 +	connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutoLayoutToggle() ) );
   5.337 +	settingsMenu->addAction (a);
   5.338 +	actionSettingsAutoLayoutToggle=a;
   5.339 +
   5.340  }
   5.341  
   5.342  // Test Actions
   5.343 @@ -1740,8 +1759,6 @@
   5.344  // Context Menus
   5.345  void Main::setupContextMenus()
   5.346  {
   5.347 -	QAction*a;
   5.348 -
   5.349  	// Context Menu for branch or mapcenter
   5.350  	branchContextMenu =new QMenu (this);
   5.351  	branchContextMenu->addAction (actionViewTogglePropertyWindow);
   5.352 @@ -1810,7 +1827,7 @@
   5.353  
   5.354  	// Context menu for floatimage
   5.355  	floatimageContextMenu =new QMenu (this);
   5.356 -	a= new QAction (tr ("Save image","Context action"),this);
   5.357 +	QAction *a= new QAction (tr ("Save image","Context action"),this);
   5.358  	connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
   5.359  	floatimageContextMenu->addAction (a);
   5.360  
   5.361 @@ -3405,13 +3422,13 @@
   5.362  void Main::viewZoomIn()
   5.363  {
   5.364  	MapEditor *me=currentMapEditor();
   5.365 -	if (me) me->setZoomFactorTarget (me->getZoomFactorTarget()*1.25);
   5.366 +	if (me) me->setZoomFactorTarget (me->getZoomFactorTarget()*1.15);
   5.367  }
   5.368  
   5.369  void Main::viewZoomOut()
   5.370  {
   5.371  	MapEditor *me=currentMapEditor();
   5.372 -	if (me) me->setZoomFactorTarget (me->getZoomFactorTarget()*0.75);
   5.373 +	if (me) me->setZoomFactorTarget (me->getZoomFactorTarget()*0.85);
   5.374  }
   5.375  
   5.376  void Main::viewCenter()
   5.377 @@ -3503,6 +3520,11 @@
   5.378  		settings.setValue ("/mainwindow/autosave/ms",i * 1000);
   5.379  }
   5.380  
   5.381 +void Main::settingsAutoLayoutToggle()
   5.382 +{
   5.383 +	settings.setValue ("/mainwindow/autoLayout/use",actionSettingsAutosaveToggle->isOn() );
   5.384 +}
   5.385 +
   5.386  void Main::settingsWriteBackupFileToggle()
   5.387  {
   5.388  	settings.setValue ("/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
     6.1 --- a/mainwindow.h	Mon Mar 15 15:32:37 2010 +0000
     6.2 +++ b/mainwindow.h	Thu Mar 18 11:31:02 2010 +0000
     6.3 @@ -210,6 +210,7 @@
     6.4  	void settingsUndoLevels();
     6.5  	void settingsAutosaveToggle();
     6.6  	void settingsAutosaveTime();
     6.7 +	void settingsAutoLayoutToggle();
     6.8  	void settingsWriteBackupFileToggle();
     6.9  	void settingsToggleAnimation();
    6.10  
    6.11 @@ -378,6 +379,7 @@
    6.12  	QAction* actionSettingsUseHideExport;
    6.13  	QAction* actionSettingsAutosaveToggle;
    6.14  	QAction* actionSettingsAutosaveTime;
    6.15 +	QAction* actionSettingsAutoLayoutToggle;
    6.16  	QAction* actionSettingsWriteBackupFile;
    6.17  	QAction* actionSettingsUseAnimation;
    6.18  };
     7.1 --- a/mapeditor.cpp	Mon Mar 15 15:32:37 2010 +0000
     7.2 +++ b/mapeditor.cpp	Thu Mar 18 11:31:02 2010 +0000
     7.3 @@ -230,7 +230,7 @@
     7.4  
     7.5  	if (scrollBarPosTarget==getScrollBarPos()) return;
     7.6  
     7.7 -	if (scrollBarPosAnimation.state()==QtAbstractAnimation::Running)
     7.8 +	if (scrollBarPosAnimation.state()==QAbstractAnimation::Running)
     7.9  		scrollBarPosAnimation.stop();
    7.10  	
    7.11  	if (settings.value ("/animation/use/",true).toBool() )
    7.12 @@ -238,7 +238,7 @@
    7.13  		scrollBarPosAnimation.setTargetObject (this);
    7.14  		scrollBarPosAnimation.setPropertyName ("scrollBarPos");
    7.15  		scrollBarPosAnimation.setDuration(1000);
    7.16 -		scrollBarPosAnimation.setEasingCurve ( QtEasingCurve::OutQuint);
    7.17 +		scrollBarPosAnimation.setEasingCurve ( QEasingCurve::OutQuint);
    7.18  		scrollBarPosAnimation.setStartValue(
    7.19  			QPointF (horizontalScrollBar()->value() ,
    7.20  					 verticalScrollBar()->value() ) );
    7.21 @@ -270,7 +270,7 @@
    7.22  void MapEditor::setZoomFactorTarget (const qreal &zft)
    7.23  {
    7.24  	zoomFactorTarget=zft;
    7.25 -	if (zoomAnimation.state()==QtAbstractAnimation::Running)
    7.26 +	if (zoomAnimation.state()==QAbstractAnimation::Running)
    7.27  		zoomAnimation.stop();
    7.28  	if (settings.value ("/animation/use/",true).toBool() )
    7.29  	{
    7.30 @@ -278,7 +278,7 @@
    7.31  		zoomAnimation.setTargetObject (this);
    7.32  		zoomAnimation.setPropertyName ("zoomFactor");
    7.33  		zoomAnimation.setDuration(1000);
    7.34 -		zoomAnimation.setEasingCurve ( QtEasingCurve::OutQuint);
    7.35 +		zoomAnimation.setEasingCurve ( QEasingCurve::OutQuint);
    7.36  		zoomAnimation.setStartValue(zoomFactor);
    7.37  		zoomAnimation.setEndValue(zft);
    7.38  		zoomAnimation.start();
    7.39 @@ -565,18 +565,20 @@
    7.40  						// Move also away if centroids are identical
    7.41  						if (v.isNull()) 
    7.42  						{
    7.43 -							//qDebug() << "v==0="<<polys[i].centroid()<<polys[j].centroid()<<" "<<v;
    7.44  							v.setX (rand()%200 -100);
    7.45  							v.setY (rand()%200 -100);
    7.46 -							//qDebug() << v;
    7.47  						}
    7.48 +						// Add random direction
    7.49 +						Vector w (cos (rand()%1000),sin(rand()%1000));
    7.50 +						
    7.51 +						// Scale translation vector by area of polygons
    7.52  						v.normalize();
    7.53 -						//qDebug() <<  "  v="<<v;
    7.54  						vectors[j]=v*10000/polys.at(j).weight();		
    7.55  						vectors[i]=v*10000/polys.at(i).weight();		
    7.56  						vectors[i].invert();
    7.57  						//FIXME-3 outer loop, "i" get's changed several times...
    7.58 -						// Better not move away from centroid of 2 colliding polys, but from centroid of _all_
    7.59 +						// Better not move away from centroid of 2 colliding polys, 
    7.60 +						// but from centroid of _all_
    7.61  					}  
    7.62  				}
    7.63  			}
     8.1 --- a/mapeditor.h	Mon Mar 15 15:32:37 2010 +0000
     8.2 +++ b/mapeditor.h	Thu Mar 18 11:31:02 2010 +0000
     8.3 @@ -4,7 +4,7 @@
     8.4  #include <QGraphicsView>
     8.5  #include <QItemSelectionModel>
     8.6  
     8.7 -#include <QtPropertyAnimation>	
     8.8 +#include <QPropertyAnimation>	
     8.9  
    8.10  #include "attribute.h"
    8.11  #include "ornamentedobj.h"
    8.12 @@ -31,7 +31,7 @@
    8.13  protected:
    8.14  	QPointF scrollBarPos;
    8.15  	QPointF scrollBarPosTarget;
    8.16 -	QtPropertyAnimation scrollBarPosAnimation;
    8.17 +	QPropertyAnimation scrollBarPosAnimation;
    8.18  public:
    8.19  	void scrollTo (const QModelIndex &index);
    8.20  	void setScrollBarPosTarget (const QRectF &rect);	//!  ensureVisible of rect
    8.21 @@ -42,7 +42,7 @@
    8.22  protected:
    8.23  	qreal zoomFactor;
    8.24  	qreal zoomFactorTarget;
    8.25 -	QtPropertyAnimation zoomAnimation;
    8.26 +	QPropertyAnimation zoomAnimation;
    8.27  public:
    8.28  	void setZoomFactorTarget (const qreal &zf);
    8.29  	qreal getZoomFactorTarget();
    8.30 @@ -56,6 +56,7 @@
    8.31  	void setAntiAlias (bool);	//!< Set or unset antialiasing
    8.32  	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
    8.33  	void setHideTmp (bool);		//!< Hide parts temporary
    8.34 +public slots:	
    8.35  	void autoLayout();			//!< Auto layout of map by using collision detection
    8.36  public:
    8.37  	TreeItem *findMapItem (QPointF p,TreeItem *exclude);	//! find item in map at position p. Ignore item exclude 
     9.1 --- a/tex/vym.changelog	Mon Mar 15 15:32:37 2010 +0000
     9.2 +++ b/tex/vym.changelog	Thu Mar 18 11:31:02 2010 +0000
     9.3 @@ -1,3 +1,13 @@
     9.4 +-------------------------------------------------------------------
     9.5 +Wed Mar 17 22:24:51 CET 2010 - vym@insilmaril.de
     9.6 +
     9.7 +- Bugfix: Enabled Qt 4.6: Removed QtAnimation Framework and fixed flags
     9.8 +
     9.9 +-------------------------------------------------------------------
    9.10 +Tue Mar 16 16:45:23 CET 2010 - vym@insilmaril.de
    9.11 +
    9.12 +- Feature: zoomFactor is saved and restored on load
    9.13 +
    9.14  -------------------------------------------------------------------
    9.15  Mon Mar 15 12:48:45 CET 2010 - vym@insilmaril.de
    9.16  
    10.1 --- a/version.h	Mon Mar 15 15:32:37 2010 +0000
    10.2 +++ b/version.h	Thu Mar 18 11:31:02 2010 +0000
    10.3 @@ -7,7 +7,7 @@
    10.4  #define __VYM_VERSION "1.13.0"
    10.5  //#define __VYM_CODENAME "Codename: RC-1"
    10.6  #define __VYM_CODENAME "Codename: development version, not for production!"
    10.7 -#define __VYM_BUILD_DATE "2010-03-15"
    10.8 +#define __VYM_BUILD_DATE "2010-03-17"
    10.9  
   10.10  
   10.11  bool checkVersion(const QString &);
    11.1 --- a/vym.pro	Mon Mar 15 15:32:37 2010 +0000
    11.2 +++ b/vym.pro	Thu Mar 18 11:31:02 2010 +0000
    11.3 @@ -6,7 +6,7 @@
    11.4  CONFIG += qdbus
    11.5  
    11.6  # Only needed with Qt < 4.6
    11.7 -include (/data/qtanimationframework-2.3-opensource/src/qtanimationframework.pri)
    11.8 +# include (/data/qtanimationframework-2.3-opensource/src/qtanimationframework.pri)
    11.9  
   11.10  TRANSLATIONS += lang/vym_de.ts
   11.11  TRANSLATIONS += lang/vym_en.ts
    12.1 --- a/vymmodel.cpp	Mon Mar 15 15:32:37 2010 +0000
    12.2 +++ b/vymmodel.cpp	Thu Mar 18 11:31:02 2010 +0000
    12.3 @@ -139,6 +139,7 @@
    12.4  	linkstyle=LinkableMapObj::PolyParabel;
    12.5  	defXLinkWidth=1;
    12.6  	defXLinkColor=QColor (230,230,230);
    12.7 +	zoomFactor=1;
    12.8  
    12.9  	hidemode=TreeItem::HideNone;
   12.10  
   12.11 @@ -226,6 +227,7 @@
   12.12  		          xml.attribut("linkColor", defLinkColor.name() ) +
   12.13  		          xml.attribut("defXLinkColor", defXLinkColor.name() ) +
   12.14  		          xml.attribut("defXLinkWidth", QString().setNum(defXLinkWidth,10) ) +
   12.15 +		          xml.attribut("mapZoomFactor", QString().setNum(mapEditor->getZoomFactorTarget()) ) +
   12.16  		          colhint; 
   12.17  	s+=xml.beginElement("vymmap",mapAttr);
   12.18  	xml.incIndent();
   12.19 @@ -499,6 +501,8 @@
   12.20  	zipped=zipped_org;
   12.21  
   12.22  	updateActions();
   12.23 +
   12.24 +	if (mapEditor) mapEditor->setZoomFactorTarget (zoomFactor);
   12.25  	return err;
   12.26  }
   12.27  
   12.28 @@ -1646,7 +1650,6 @@
   12.29  void  VymModel::findAll (FindResultModel *rmodel, QString s, Qt::CaseSensitivity cs)   
   12.30  {
   12.31  	rmodel->clear();
   12.32 -	int i=0;
   12.33  	BranchItem *cur=NULL;
   12.34  	BranchItem *prev=NULL;
   12.35  	nextBranch(cur,prev);
   12.36 @@ -1656,12 +1659,15 @@
   12.37  		{
   12.38  			rmodel->addItem (cur);
   12.39  		}	
   12.40 -		//if (cur->getNote().contains (s,cs))	//FIXME-2 does not detect multiple occurences yet
   12.41 +		int i=0;
   12.42  		while (i>=0)
   12.43  		{
   12.44 -			i=cur->getNote().indexOf (s,i,cs);
   12.45 -			if (i>=0) i++;
   12.46 -			//qDebug()<<"i="<<i;
   12.47 +			i=cur->getNote().indexOf (s,i,cs); //FIXME-2 add subitems to rmodel
   12.48 +			if (i>=0) 
   12.49 +			{
   12.50 +				rmodel->addSubItem (cur,"Note",cur,i);
   12.51 +				i++;
   12.52 +			}
   12.53  		} 
   12.54  		nextBranch(cur,prev);
   12.55  	}
   12.56 @@ -2284,7 +2290,7 @@
   12.57  		QString ("addMapCenter (%1,%2)").arg (contextPos.x()).arg(contextPos.y()),
   12.58  		QString ("Adding MapCenter to (%1,%2)").arg (contextPos.x()).arg(contextPos.y())
   12.59  	);	
   12.60 -	mapEditor->autoLayout();	//FIXME-3 testing
   12.61 +	emitUpdateLayout();	
   12.62  	return bi;	
   12.63  }
   12.64  
   12.65 @@ -4413,6 +4419,11 @@
   12.66  	mapEditor=NULL;
   12.67  }
   12.68  
   12.69 +void VymModel::setMapZoomFactor (const double &d)
   12.70 +{
   12.71 +	zoomFactor=d;
   12.72 +}
   12.73 +
   12.74  void VymModel::setContextPos(QPointF p)
   12.75  {
   12.76  	contextPos=p;
   12.77 @@ -5097,6 +5108,11 @@
   12.78  	emit (dataChanged (ix,ix) );
   12.79  }
   12.80  
   12.81 +void VymModel::emitUpdateLayout()
   12.82 +{
   12.83 +	if (settings.value("/mainwindow/autoLayout/use","true")=="true")
   12.84 +		emit (updateLayout());
   12.85 +}
   12.86  
   12.87  bool VymModel::selectFirstBranch()
   12.88  {
    13.1 --- a/vymmodel.h	Mon Mar 15 15:32:37 2010 +0000
    13.2 +++ b/vymmodel.h	Thu Mar 18 11:31:02 2010 +0000
    13.3 @@ -464,7 +464,9 @@
    13.4  	void registerEditor (QWidget *);
    13.5  	void unregisterEditor (QWidget *);
    13.6  
    13.7 +	void setMapZoomFactor (const double &); 
    13.8  private: 
    13.9 +	double zoomFactor;
   13.10  	QPointF contextPos;					//!< local position during context menu
   13.11  public:
   13.12  	void setContextPos (QPointF);		//!< local position during context menu
   13.13 @@ -476,8 +478,10 @@
   13.14  
   13.15  	void emitNoteHasChanged (TreeItem *ti);
   13.16  	void emitDataHasChanged (TreeItem *ti);
   13.17 +	void emitUpdateLayout ();
   13.18  
   13.19  signals:
   13.20 +	void updateLayout();
   13.21  	void noteHasChanged (QModelIndex ix);
   13.22  	void newChildObject(QModelIndex ix);
   13.23  
    14.1 --- a/vymview.cpp	Mon Mar 15 15:32:37 2010 +0000
    14.2 +++ b/vymview.cpp	Thu Mar 18 11:31:02 2010 +0000
    14.3 @@ -85,6 +85,10 @@
    14.4  		model, SIGNAL (showSelection() ),
    14.5  		this, SLOT (showSelection() ) );
    14.6  		
    14.7 +	connect (
    14.8 +		model, SIGNAL (updateLayout() ),
    14.9 +		mapEditor, SLOT (autoLayout() ) );
   14.10 +		
   14.11  	mapEditor->setAntiAlias (mainWindow->isAliased());
   14.12  	mapEditor->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform());
   14.13  
    15.1 --- a/xml-vym.cpp	Mon Mar 15 15:32:37 2010 +0000
    15.2 +++ b/xml-vym.cpp	Thu Mar 18 11:31:02 2010 +0000
    15.3 @@ -102,6 +102,8 @@
    15.4  			}	
    15.5  			if (!atts.value( "defXLinkWidth").isEmpty() ) 
    15.6  				model->setMapDefXLinkWidth(atts.value("defXLinkWidth").toInt ());
    15.7 +			if (!atts.value( "mapZoomFactor").isEmpty() ) 
    15.8 +				model->setMapZoomFactor(atts.value("mapZoomFactor").toDouble());
    15.9  		}	
   15.10  		// Check version
   15.11  		if (!atts.value( "version").isEmpty() )