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(); }
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(); }
void VolumePopup::handleDeviceMuteChanged(bool mute) { m_muteToggleButton->setChecked(mute); updateStockIcon(); }