]> Creatis software - clitk.git/commitdiff
Call InitializeNewTool after tool constructor to allow reading in state file
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 30 Mar 2012 11:43:20 +0000 (13:43 +0200)
committerDavid Sarrut <david.sarrut@gmail.com>
Fri, 30 Mar 2012 11:43:20 +0000 (13:43 +0200)
vv/vvToolCreatorBase.txx

index fbe8d6fd6ee88e029fc4fb1655306eaa6d1428bc..5aa64835f8f53501e43f713f0cb5cc7dfdd6688b 100644 (file)
@@ -16,6 +16,7 @@
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ===========================================================================**/
 
+//------------------------------------------------------------------------------
 template<class ToolType>
 void vvToolCreatorBase::CreateTool()
 {
@@ -23,11 +24,17 @@ void vvToolCreatorBase::CreateTool()
   mMainWindow->UpdateCurrentSlicer();
   // Create the tool
   ToolType * tool = new ToolType(mMainWindow, Qt::Dialog);
-  tool->setSender(mSender);
   // Put it in the list of open tools
   mListOfTool.push_back(tool);
+
+  // Set some parameters
+  tool->SetCreator(this);
+  tool->setSender(mSender);
+  if (mReadStateFlag) tool->SetXmlReader(m_XmlReader.get(), mImageIndex);
+  tool->InitializeNewTool(mReadStateFlag);
+
   // Go !
-  tool->show();
+  if (tool) tool->show();
 }
 //------------------------------------------------------------------------------