# HG changeset patch # User insilmaril # Date 1209995202 0 # Node ID c7b1178aec77437433d791ea6f8ff74f3e5a988e # Parent d0086df58648106f405c68a9db582f3437b7bb26 Some code cleanup and experimental stuff to support animations later diff -r d0086df58648 -r c7b1178aec77 mainwindow.cpp --- a/mainwindow.cpp Mon May 05 13:46:42 2008 +0000 +++ b/mainwindow.cpp Mon May 05 13:46:42 2008 +0000 @@ -310,6 +310,7 @@ a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) ); + actionFileNewCopy=a; a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this); a->setStatusTip (tr( "Open","Status tip File menu" ) ); @@ -1464,6 +1465,17 @@ a->setOn ( settings.value ("/export/useHideExport",true).toBool() ); settingsMenu->addAction (a); actionSettingsUseHideExport=a; + + a = new QAction( tr( "Animation","Settings action"), this); + a->setStatusTip( tr( "Animation")); + a->setToggleAction(true); + a->setOn (settings.value("/animation/use",false).toBool() ); + connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) ); + if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) + { + settingsMenu->addAction (a); + } + actionSettingsUseAnimation=a; } // Test Actions @@ -1545,6 +1557,7 @@ actionEditSaveBranch->addTo( branchContextMenu ); + actionFileNewCopy->addTo (branchContextMenu ); branchContextMenu->addSeparator(); branchContextMenu->addAction ( actionEditLoadImage); @@ -3295,6 +3308,11 @@ settings.setValue ("/mapeditor/writeBackupFile",actionSettingsWriteBackupFile->isOn() ); } +void Main::settingsToggleAnimation() +{ + settings.setValue ("/animation/use",actionSettingsUseAnimation->isOn() ); +} + void Main::settingsToggleDelKey() { if (actionSettingsUseDelKey->isOn()) @@ -3648,8 +3666,8 @@ void Main::testFunction1() { if (!currentMapEditor()) return; - //currentMapEditor()->testFunction1(); - editAttribute(); + currentMapEditor()->testFunction1(); + //editAttribute(); } void Main::testFunction2()