~vov4uk21/silicon/silicon-git

« back to all changes in this revision

Viewing changes to src/SApplications/AudioDisc/audiodisc.cpp

  • Committer: Bardia Daneshvar
  • Date: 2012-03-26 21:09:42 UTC
  • Revision ID: git-v1:c421d12a531520bad0a1ad5625e0f862526b3698
AudioDisc commands support ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        progressItem()->hide();
166
166
}
167
167
 
 
168
void AudioDisc::showStopDialog()
 
169
{
 
170
    SDialogTools::message( 0 , tr("Cancel Process") , tr("Do you realy want to cancel this process?") , QMessageBox::Warning ,
 
171
                           this,SLOT(stopDialogButtonClicked(int)),
 
172
                           QMessageBox::No|QMessageBox::Yes ,QMessageBox::No );
 
173
}
 
174
 
 
175
void AudioDisc::stopDialogButtonClicked( int ret )
 
176
{
 
177
    switch( ret )
 
178
    {
 
179
    case QMessageBox::Yes:
 
180
        stop();
 
181
        break;
 
182
 
 
183
    case QMessageBox::No:
 
184
        break;
 
185
    }
 
186
}
 
187
 
168
188
void AudioDisc::finished()
169
189
{
170
190
    if( p->page->eject() )
306
326
    return p->progress_item;
307
327
}
308
328
 
 
329
void AudioDisc::runtimeArgsEvent( const QVariantList & args )
 
330
{
 
331
    for( int i=0 ; i<args.count() ; i++ )
 
332
    {
 
333
        QVariant var = args.at(i);
 
334
        if( var.type() != QVariant::String )
 
335
            return;
 
336
 
 
337
        QString str = var.toString();
 
338
        if( str.isEmpty() )
 
339
            return;
 
340
 
 
341
        if(      str.left(4) == "dev=" )
 
342
            p->page->setDevice( str.mid(4) );
 
343
 
 
344
        else if( str.left(6) == "speed=" )
 
345
            p->page->setSpeed( str.mid(6).toInt() );
 
346
 
 
347
        else if( str.left(6) == "count=" )
 
348
            p->page->setCopiesNumber( str.mid(6).toInt() );
 
349
 
 
350
        else if( str.left(5) == "scan=" )
 
351
            p->page->setScan( str.mid(5) );
 
352
 
 
353
        else if( str.left(5) == "wait=" )
 
354
            setWait( str.mid(5).toLower() == "true" );
 
355
 
 
356
        else if( str.left(7) == "volume=" )
 
357
            p->page->setVolumeLabel( str.mid(7) );
 
358
 
 
359
        else if( str.left(7) == "app_id=" )
 
360
            p->page->setApplicationId( str.mid(7) );
 
361
 
 
362
        else if( str.left(7) == "biblio=" )
 
363
            p->page->setBiblio( str.mid(7) );
 
364
 
 
365
        else if( str.left(9) == "abstract=" )
 
366
            p->page->setAbstract( str.mid(9) );
 
367
 
 
368
        else if( str.left(10) == "copyright=" )
 
369
            p->page->setCopyRight( str.mid(10) );
 
370
 
 
371
        else if( str.left(10) == "system_id=" )
 
372
            p->page->setSystemId( str.mid(10) );
 
373
 
 
374
        else if( str.left(10) == "publisher=" )
 
375
            p->page->setPublisher( str.mid(10) );
 
376
 
 
377
        else if( str.left(14) == "little-endian=" )
 
378
            p->page->setSwab( str.mid(14) == "true" );
 
379
 
 
380
        else if( str == "-eject" )
 
381
            p->page->setEject( true );
 
382
 
 
383
        else if( str == "-tao" )
 
384
            p->page->setTrackAtOnce( true );
 
385
 
 
386
        else if( str == "-dao" )
 
387
            p->page->setDiscAtOnce( true );
 
388
 
 
389
        else if( str == "-dummy" )
 
390
            p->page->setDummy( true );
 
391
 
 
392
        else if( str[0] != '-' )
 
393
            p->page->addFiles( QStringList() << str );
 
394
 
 
395
        else
 
396
            return;
 
397
    }
 
398
}
 
399
 
 
400
void AudioDisc::closeEvent( QCloseEvent *event )
 
401
{
 
402
    if( p->burner && p->burner->isStarted() )
 
403
    {
 
404
        showStopDialog();
 
405
        event->ignore();
 
406
    }
 
407
    else
 
408
    {
 
409
        event->accept();
 
410
    }
 
411
}
 
412
 
309
413
AudioDisc::~AudioDisc()
310
414
{
311
415
    delete p;