Пример #1
0
void MComponent::typeDesc( WString& n )
{
    if( _config->debug() ) {
        n.concatf( "(%s)->", (const char*)_mask );
    }
    for( int i=0; i<_config->targets().count(); i++ ) {
        MTarget* tar = (MTarget*)_config->targets()[i];
        if( tar->mask() == _mask ) {
            if( _config->debug() ) {
                n.concatf( "(%s) ", (const char*)tar->mask() );
            }
            WString name;
            tar->name( name );
            n.concat( name );
            return;
        }
    }
    n.concat( "Obsolete form: Rename target type" );
}
Пример #2
0
bool VCompDialog::legalExt()
{
    MTarget             *curtarg;
    int i = _imagelist->selected();
    if( i >= 0 ) {
        curtarg = (MTarget *)_tgList[i];
        WString ext1( curtarg->tgtMask().ext() );
        WString ext2( _fn->ext() );
        if( ext2.size() == 0 ) {
            _fn->setExt( ext1 );
            return TRUE;
        }
        if( ext1 == ext2 ) {
            return TRUE;
        }
        WString n; curtarg->name( n );
        WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "'%s' is not a legal file extension for '%s'", (const char*)ext2, (const char*)n );
    } else {
        WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "Select an image type." );
    }
    return FALSE;
}