Example #1
0
    /**
     * Updates link in given Panel according the src/dst names.
     */
    void updateLinks( Panel& p )
    {
        bool change;

        TemplateDict templates = p.templates();
        for( unsigned int i = 0; i < templates.count(); ++i ) {
            change=false;

            LTMap<PropertyDict> pg = templates[i]->propertyGroups();
            for( unsigned int j = 0; j < pg.count(); ++j ) {

                PropertyDict pd = pg[j];
                for( unsigned int k = 0; k < pd.count(); ++k ) {

                    if( pd[k]->type() == Property::LinkType ) {

                        if( pd[k]->encodeValue() == srcPanelName ) {
                            change=true;
                            pd[k]->decodeValue( dstPanelName );
                        }
                    }
                }
            }

            if( change ) {
                templates[i]->propertiesChanged();
            }
        }
    }
Example #2
0
void Template::setPropertyGroupEnabled( const QString & group, bool enabled )
{
    if( d->propertyGroups.contains( group ) ) {
        PropertyDict props = d->propertyGroups[ group ];
        for( unsigned i = 0; i < props.count(); i ++ ) {
            props[ i ]->setEnabled( enabled );
        }
    }
}