Commit c61e941c authored by Emmanuel Lepage's avatar Emmanuel Lepage

Fix bug in volume widget

parent 0c57c0f6
......@@ -82,7 +82,7 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
connect(SFLPhone::model() , SIGNAL(incomingCall(Call*)) , this , SLOT(on1_incomingCall(Call*) ));
connect(SFLPhone::model() , SIGNAL(voiceMailNotify(const QString &, int)) , this , SLOT(on1_voiceMailNotify(const QString &, int) ));
connect(SFLPhone::model() , SIGNAL(volumeChanged(const QString &, double)), this , SLOT(on1_volumeChanged(const QString &, double) ));
//connect(SFLPhone::model() , SIGNAL(volumeChanged(const QString &, double)), this , SLOT(on1_volumeChanged(const QString &, double) ));
connect(SFLPhone::model() , SIGNAL(callStateChanged(Call*)) , this , SLOT(updateWindowCallState() ));
connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateStatusMessage() ));
connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateWindowCallState() ));
......@@ -390,20 +390,20 @@ void SFLPhoneView::updateVolumeButton()
}
void SFLPhoneView::updateRecordBar()
void SFLPhoneView::updateRecordBar(double _value)
{
qDebug() << "updateRecordBar";
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
double recVol = callManager.getVolume(RECORD_DEVICE);
int value = (int)(recVol * 100);
qDebug() << "updateRecordBar" << recVol;
int value = (_value > 0)?_value:(int)(recVol * 100);
slider_recVol->setValue(value);
}
void SFLPhoneView::updateVolumeBar()
void SFLPhoneView::updateVolumeBar(double _value)
{
qDebug() << "updateVolumeBar";
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
double sndVol = callManager.getVolume(SOUND_DEVICE);
int value = (int)(sndVol * 100);
qDebug() << "updateVolumeBar" << sndVol;
int value = (_value > 0)?_value:(int)(sndVol * 100);
slider_sndVol->setValue(value);
}
......@@ -737,11 +737,12 @@ void SFLPhoneView::on1_voiceMailNotify(const QString &accountID, int count)
void SFLPhoneView::on1_volumeChanged(const QString & /*device*/, double value)
{
qDebug() << "Signal : Volume Changed !";
//TODO uncomment after fixing infinite loop
qDebug() << "Signal : Volume Changed !" << value;
if(! (toolButton_recVol->isChecked() && value == 0.0))
updateRecordBar();
updateRecordBar(value);
if(! (toolButton_sndVol->isChecked() && value == 0.0))
updateVolumeBar();
updateVolumeBar(value);
}
// void SFLPhoneView::on1_audioManagerChanged()
......
......@@ -166,8 +166,8 @@ private slots:
*/
void updateRecordButton ();
void updateVolumeButton ();
void updateRecordBar ();
void updateVolumeBar ();
void updateRecordBar (double _value = -1);
void updateVolumeBar (double _value = -1);
void updateVolumeControls ();
void updateDialpad ();
......
......@@ -86,6 +86,7 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent)
QStringList sortType;
sortType << "Name" << "Organisation" << "Phone number type" << "Rencently used" << "Group";
m_pSortByCBB->addItems(sortType);
m_pSortByCBB->setDisabled(true);
QWidget* mainWidget = new QWidget(this);
setWidget(mainWidget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment