Changeset 1285cdd


Ignore:
Timestamp:
04/17/15 04:39:10 (6 weeks ago)
Author:
yurkis <yurkis@…>
Branches:
master, enter/10, releng/10.1.2
Children:
a7ffa7c
Parents:
b82b01e
Message:

Mixer: Continue output selection from tray icon. Should work now. Need test

Location:
src-qt5/pc-mixer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/pc-mixer/MixerTray.cpp

    rb82b01e r1285cdd  
    6666          action->setChecked(outdevs[i].contains(" default")); 
    6767          action->setText(/*outdevs[i].section(" default",0,0),*/ outdevs[i].section(":",1,1).replace(" default","")); 
     68          action->setData(QVariant(outdevs[i].section(":",0,0))); 
     69          connect(action, SIGNAL(triggered()), this, SLOT(slotOutputSelected())); 
    6870          menu->addAction(action); 
    69           /*ui->combo_outdevice->addItem(outdevs[i].section(" default",0,0), outdevs[i].section(":",0,0) ); 
    70           if(outdevs[i].contains(" default")){ ui->combo_outdevice->setCurrentIndex( ui->combo_outdevice->count()-1); }*/ 
    7171        } 
    7272      } 
     
    9494  //Now just run the changeVol function to update everything (better than duplication) 
    9595  changeVol(R, false); 
     96} 
     97 
     98void MixerTray::slotOutputSelected() 
     99{ 
     100    QAction* act = dynamic_cast<QAction*> (QObject::sender()); 
     101    QString dev_name = act->data().toString(); 
     102    qDebug()<<dev_name; 
     103 
     104    if(dev_name.isEmpty()){ return; } 
     105    QProcess::execute("pc-sysconfig \"setdefaultaudiodevice "+dev+"\""); 
     106 
     107    if(GUI->isVisible()){ 
     108      //also update the main mixer GUI if it is visible 
     109      GUI->updateGUI(); 
     110    } 
    96111} 
    97112 
  • src-qt5/pc-mixer/MixerTray.h

    rb82b01e r1285cdd  
    8282          if(!starting){ openMixerGUI(); } 
    8383        } 
     84 
     85    void slotOutputSelected(); 
     86 
    8487protected: 
    8588        //look for wheel events here 
Note: See TracChangeset for help on using the changeset viewer.