Skip to content
Snippets Groups Projects
Commit c61e941c authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

Fix bug in volume widget

parent 0c57c0f6
No related branches found
No related tags found
No related merge requests found
...@@ -82,7 +82,7 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) ...@@ -82,7 +82,7 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
connect(SFLPhone::model() , SIGNAL(incomingCall(Call*)) , this , SLOT(on1_incomingCall(Call*) )); 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(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(SFLPhone::model() , SIGNAL(callStateChanged(Call*)) , this , SLOT(updateWindowCallState() ));
connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateStatusMessage() )); connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateStatusMessage() ));
connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateWindowCallState() )); connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateWindowCallState() ));
...@@ -390,20 +390,20 @@ void SFLPhoneView::updateVolumeButton() ...@@ -390,20 +390,20 @@ void SFLPhoneView::updateVolumeButton()
} }
void SFLPhoneView::updateRecordBar() void SFLPhoneView::updateRecordBar(double _value)
{ {
qDebug() << "updateRecordBar";
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
double recVol = callManager.getVolume(RECORD_DEVICE); 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); slider_recVol->setValue(value);
} }
void SFLPhoneView::updateVolumeBar() void SFLPhoneView::updateVolumeBar(double _value)
{ {
qDebug() << "updateVolumeBar";
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
double sndVol = callManager.getVolume(SOUND_DEVICE); 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); slider_sndVol->setValue(value);
} }
...@@ -737,11 +737,12 @@ void SFLPhoneView::on1_voiceMailNotify(const QString &accountID, int count) ...@@ -737,11 +737,12 @@ void SFLPhoneView::on1_voiceMailNotify(const QString &accountID, int count)
void SFLPhoneView::on1_volumeChanged(const QString & /*device*/, double value) 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)) if(! (toolButton_recVol->isChecked() && value == 0.0))
updateRecordBar(); updateRecordBar(value);
if(! (toolButton_sndVol->isChecked() && value == 0.0)) if(! (toolButton_sndVol->isChecked() && value == 0.0))
updateVolumeBar(); updateVolumeBar(value);
} }
// void SFLPhoneView::on1_audioManagerChanged() // void SFLPhoneView::on1_audioManagerChanged()
......
...@@ -166,8 +166,8 @@ private slots: ...@@ -166,8 +166,8 @@ private slots:
*/ */
void updateRecordButton (); void updateRecordButton ();
void updateVolumeButton (); void updateVolumeButton ();
void updateRecordBar (); void updateRecordBar (double _value = -1);
void updateVolumeBar (); void updateVolumeBar (double _value = -1);
void updateVolumeControls (); void updateVolumeControls ();
void updateDialpad (); void updateDialpad ();
......
...@@ -86,6 +86,7 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent) ...@@ -86,6 +86,7 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent)
QStringList sortType; QStringList sortType;
sortType << "Name" << "Organisation" << "Phone number type" << "Rencently used" << "Group"; sortType << "Name" << "Organisation" << "Phone number type" << "Rencently used" << "Group";
m_pSortByCBB->addItems(sortType); m_pSortByCBB->addItems(sortType);
m_pSortByCBB->setDisabled(true);
QWidget* mainWidget = new QWidget(this); QWidget* mainWidget = new QWidget(this);
setWidget(mainWidget); setWidget(mainWidget);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment