Changeset 2702

Show
Ignore:
Timestamp:
06/04/17 00:40:48 (3 years ago)
Author:
jwoithe
Message:

ffado_mixer: use graphical icon instead of name for mixer pane if available.

From Xavier Forestier's November 2016 patchset. In amongst the Qt5 changes
was this code to utilise a device-specific graphical image instead of the
textual device model name in the global mixer pane. The only change from
Xavier's patch is the omission of a statement to set the nickname
placeholder text to the name of the device. The nickname field is present
to support a particular feature of some interfaces, so it shouldn't really
be repurposed like this. Otherwise there is a high likelihood of it
introducing confusion when used with devices which support the nickname
feature.

FFADO does not currently ship with any device graphics. Contributions are
welcome but care will be needed to ensure that copyrighted images from
vendors are not used. The use of official images could give an incorrect
impression that ffado-mixer is officially sanctioned by the vendors which is
not generally the case.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/panelmanager.py

    r2701 r2702  
    3737from ffado.mixer.dummy import Dummy 
    3838 
     39import sys 
    3940import time 
    4041 
     
    340341            title = mixerapp 
    341342 
    342         globalmixer.setName(title) 
     343        mixer_icon = UIDIR + '/ffado/mixer/' + vendorName.replace(" ", "_").lower() + '.png' 
     344        if os.path.exists(mixer_icon) : 
     345            globalmixer.lblName.setPixmap(QPixmap(mixer_icon)) 
     346            globalmixer.lblName.setToolTip(title) 
     347            globalmixer.lblName.show() 
     348        else : 
     349            globalmixer.setName(title) 
     350 
    343351        self.tabs.addTab( w, title ) 
    344352        self.panels[guid] = w