void cpPlugins::Interface::Parameters::
SetProcessObject( ProcessObject* v )
{
- this->m_Process = v;
+ if( this->m_Process != v )
+ {
+ this->m_Process = v;
+ this->Modified( );
+
+ } // fi
}
// -------------------------------------------------------------------------
{
if( i->second.first == Self::String || force )
{
- i->second.second = v;
- this->Modified( );
+ if( i->second.second != v )
+ {
+ i->second.second = v;
+ this->Modified( );
+
+ } // fi
} // fi
std::stringstream new_choices;
new_choices << choices << "@" << choice;
i->second.second = new_choices.str( );
+ this->Modified( );
return( true );
}
else
return( false );
}
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::Parameters::
+GetAcceptedFileExtensions( const std::string& name ) const
+{
+ auto i = this->m_AcceptedFileExtensions.find( name );
+ if( i != this->m_AcceptedFileExtensions.end( ) )
+ return( i->second );
+ else
+ return( "" );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Parameters::
+SetAcceptedFileExtensions(
+ const std::string& name, const std::string& extensions
+ )
+{
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ bool is_valid = ( i->second.first == Self::OpenFileName );
+ is_valid |= ( i->second.first == Self::SaveFileName );
+ is_valid |= ( i->second.first == Self::OpenFileNameList );
+ is_valid |= ( i->second.first == Self::SaveFileNameList );
+ if( is_valid )
+ this->m_AcceptedFileExtensions[ name ] = extensions;
+
+ } // fi
+}
+
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Parameters::
ToXML( TiXmlElement* parent_elem ) const
bool cpPlugins::Interface::Parameters::
FromXML( const TiXmlElement* filter_elem )
{
- this->m_Parameters.clear( );
-
const TiXmlElement* param = filter_elem->FirstChildElement( "parameter" );
bool ret = false;
while( param != NULL )
ret = true;
} // elihw
+ this->Modified( );
return( ret );
}