diff --git a/ToolsMgr.cpp b/ToolsMgr.cpp index b9c575c..9bae34d 100644 --- a/ToolsMgr.cpp +++ b/ToolsMgr.cpp @@ -932,7 +932,7 @@ ToolsMgr::ToBeImported( const string& sFile, STRVECTOR& vsToolsNames, INTVECTOR& while ( TheScanner.GetLine( sLine)) { if ( sLine.front() == '[' && sLine.back() == ']') { // se è intestazione // aggiungo tool precedente se ok - if ( bAdd && bToolType && bToolName){ + if ( bAdd && bToolType && bToolName && IsValidToolType( stoi( sType))) { vsToolsNames.push_back( sName) ; vToolsTypes.push_back( stoi( sType)) ; } @@ -1058,7 +1058,10 @@ ToolsMgr::Import( const string& sFile, const STRVECTOR& vsToolsToImport, const S tData.m_sDraw = ToString( tData.m_Uuid) + ".nge" ; } - // Aggiungo il tool + // Setto active = false come default per il tool importato + tData.SetParam( TPA_ACTIVE, false) ; + + // Aggiungo il tool bOk = m_utData.emplace( tData.m_Uuid, tData).second ; bOk = bOk && m_suData.emplace( tData.m_sName, tData.m_Uuid).second ; if ( ! bOk){ @@ -1068,7 +1071,7 @@ ToolsMgr::Import( const string& sFile, const STRVECTOR& vsToolsToImport, const S string sOutDraw = m_sToolsDir + "\\" + tData.m_sDraw ; // se fallisco nel copiare il draw elimino il tool dal DB - if ( ! CopyToolDraw( sDraw, sOutDraw, tData.m_sName)){ + if ( ! CopyToolDraw( sDraw, sOutDraw, tData.m_sName)) { m_utData.erase( tData.m_Uuid) ; m_suData.erase( tData.m_sName) ; }