Some code cleanup and experimental stuff to support animations later
authorinsilmaril
Mon, 05 May 2008 13:46:42 +0000
changeset 689c7b1178aec77
parent 688 d0086df58648
child 690 3bb6b1548c53
Some code cleanup and experimental stuff to support animations later
mainwindow.cpp
     1.1 --- a/mainwindow.cpp	Mon May 05 13:46:42 2008 +0000
     1.2 +++ b/mainwindow.cpp	Mon May 05 13:46:42 2008 +0000
     1.3 @@ -310,6 +310,7 @@
     1.4  	a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N );		//New map
     1.5  	fileMenu->addAction (a);
     1.6      connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) );
     1.7 +	actionFileNewCopy=a;
     1.8  	
     1.9      a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
    1.10  	a->setStatusTip (tr( "Open","Status tip File menu" ) );
    1.11 @@ -1464,6 +1465,17 @@
    1.12  	a->setOn ( settings.value ("/export/useHideExport",true).toBool() );
    1.13  	settingsMenu->addAction (a);
    1.14  	actionSettingsUseHideExport=a;
    1.15 +
    1.16 +    a = new QAction( tr( "Animation","Settings action"), this);
    1.17 +    a->setStatusTip( tr( "Animation"));
    1.18 +	a->setToggleAction(true);
    1.19 +	a->setOn (settings.value("/animation/use",false).toBool() );
    1.20 +    connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
    1.21 +	if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
    1.22 +	{
    1.23 +		settingsMenu->addAction (a);
    1.24 +	}	
    1.25 +	actionSettingsUseAnimation=a;
    1.26  }
    1.27  
    1.28  // Test Actions
    1.29 @@ -1545,6 +1557,7 @@
    1.30  		
    1.31  
    1.32  	actionEditSaveBranch->addTo( branchContextMenu );
    1.33 +	actionFileNewCopy->addTo (branchContextMenu );
    1.34  
    1.35  	branchContextMenu->addSeparator();	
    1.36  	branchContextMenu->addAction ( actionEditLoadImage);
    1.37 @@ -3295,6 +3308,11 @@
    1.38  	settings.setValue ("/mapeditor/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
    1.39  }
    1.40  
    1.41 +void Main::settingsToggleAnimation()
    1.42 +{
    1.43 +	settings.setValue ("/animation/use",actionSettingsUseAnimation->isOn() );
    1.44 +}
    1.45 +
    1.46  void Main::settingsToggleDelKey()
    1.47  {
    1.48  	if (actionSettingsUseDelKey->isOn())
    1.49 @@ -3648,8 +3666,8 @@
    1.50  void Main::testFunction1()
    1.51  {
    1.52  	if (!currentMapEditor()) return;
    1.53 -	//currentMapEditor()->testFunction1();
    1.54 -	editAttribute();
    1.55 +	currentMapEditor()->testFunction1();
    1.56 +	//editAttribute();
    1.57  }
    1.58  
    1.59  void Main::testFunction2()