Ejemplo n.º 1
0
void VCompDialog::updateCurOs( void )
{
    MTarget     *curtarg;
    int         pos;
    WString     curname;
    int         i;

    WPickList&  targets = _config->targets();
    int icount = _imagelist->count();
    for( i=0; i < icount; i++ ) {
        _imagelist->deleteString( 0 );
    }
    pos = 0;
    icount = targets.count();
    _tgList.reset();
    for( i=0; i< icount; i++ ) {
        curtarg = (MTarget *)targets[i];
        if( _cur_os == curtarg->targetOS() ) {
            curname.printf( "%s [%s]", curtarg->imageName().gets(),
                                       curtarg->tgtMask().ext() );
            _imagelist->insertString( curname.gets(), pos );
            _tgList.insertAt( pos, curtarg );
            pos++;
        }
    }
}
Ejemplo n.º 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;
}