示例#1
0
void VolumePopup::handleDeviceVolumeChanged(int volume)
{
    // qDebug() << "handleDeviceVolumeChanged" << "volume" << volume << "max" << max;
    // calling m_volumeSlider->setValue will trigger
    // handleSliderValueChanged(), which set the device volume
    // again, so we have to block the signals to avoid recursive
    // signal emission.
    m_volumeSlider->blockSignals(true);
    m_volumeSlider->setValue(volume);
    m_volumeSlider->blockSignals(false);

    // emit volumeChanged(percent);
    updateStockIcon();
}
示例#2
0
void VolumePopup::handleDeviceVolumeChanged(int volume)
{
    // qDebug() << "handleDeviceVolumeChanged" << "volume" << volume << "max" << max;
    // calling m_volumeSlider->setValue will trigger
    // handleSliderValueChanged(), which set the device volume
    // again, so we have to block the signals to avoid recursive
    // signal emission.
    m_volumeSlider->blockSignals(true);
    m_volumeSlider->setValue(volume);
    m_volumeSlider->setToolTip(QString("%1%").arg(volume));
    dynamic_cast<QWidget&>(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel
    m_volumeSlider->blockSignals(false);

    // emit volumeChanged(percent);
    updateStockIcon();
}
示例#3
0
void VolumePopup::handleDeviceMuteChanged(bool mute)
{
    m_muteToggleButton->setChecked(mute);
    updateStockIcon();
}