Changeset 166897a


Ignore:
Timestamp:
04/07/14 13:53:17 (4 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2
Children:
f918467
Parents:
1a1b2f1
Message:

Make sure that UMPlayer is listed as the recommended application when starting AV disks with the mounttray.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-mounttray/mountTray.cpp

    r64e9ae2 r166897a  
    477477        i--; 
    478478    }else{ 
    479       if( apps[i].Comment().isEmpty() ){ names << apps[i].Name(); } 
    480       else{ names << apps[i].Name() +" ("+apps[i].Comment()+")"; } 
     479      QString txt; 
     480      if( apps[i].Comment().isEmpty() ){ txt = apps[i].Name(); } 
     481      else{ txt = apps[i].Name() +" ("+apps[i].Comment()+")"; } 
     482      //Make sure that UMPlayer is listed first and recommended 
     483      if(apps[i].RawName().toLower()=="umplayer"){ 
     484         txt = apps[i].Name()+ "  **"+tr("Recommended")+"**";  
     485         names.prepend(txt); //put at the top 
     486         apps.move(i,0); //move the file to the front as well 
     487      }else{ 
     488         names << txt; 
     489      } 
    481490    } 
    482491  } 
    483492  //Prompt for the user to select an application 
    484493  bool ok = false; 
    485   QString appname = QInputDialog::getItem(0, tr("Audio/Video Disk"), tr("Open With:"), names,0, true, &ok); 
     494  QString appname = QInputDialog::getItem(0, tr("Audio/Video Disk"), tr("Open With:"), names,0, false, &ok); 
    486495  if(!ok || appname.isEmpty()){ return; } 
    487496  int index = names.indexOf(appname); 
     
    490499  qDebug() << "Open Audio/Video disk:" << dev; 
    491500  qDebug() << " -- With:"<<appname; 
     501  QString cmd = apps[index].Exec(); 
     502  if(apps[index].RawName().toLower()=="umplayer"){ 
     503    //try to distinguish between audio or video disk (not implemented yet) 
     504  } 
    492505  QProcess::startDetached( apps[index].Exec() ); 
    493506} 
Note: See TracChangeset for help on using the changeset viewer.