Commit c7b19fec authored by Hardik Beladiya's avatar Hardik Beladiya Committed by Andreas Cord-Landwehr

Stop recording when closing dialog.

REVIEW: 121739
parent afc214b7
......@@ -218,6 +218,7 @@ void MainWindow::showSettingsDialog()
connect(dialog, SIGNAL(accepted()), SLOT(updateTrainingPhraseFont()));
connect(dialog, SIGNAL(accepted()), SLOT(updateKcfgUseContributorResources()));
connect(dialog, SIGNAL(finished()), soundDialog, SLOT(stopPlaying()));
connect(dialog, SIGNAL(finished()), soundDialog, SLOT(stopRecord()));
dialog->exec();
}
......
......@@ -129,9 +129,7 @@ void SoundDeviceDialogPage::recordSound()
{
if (CaptureDeviceController::self().state() == CaptureDeviceController::RecordingState)
{
CaptureDeviceController::self().stopCapture();
ui->buttonRecordTestSound->setIcon(KIcon("media-record"));
ui->buttonPlayRecordedTestSound->setEnabled(true);
stopRecord();
return;
}
......@@ -140,6 +138,15 @@ void SoundDeviceDialogPage::recordSound()
CaptureDeviceController::self().startCapture(m_recordTestFile.fileName());
}
void SoundDeviceDialogPage::stopRecord()
{
if (CaptureDeviceController::self().state() == CaptureDeviceController::RecordingState) {
CaptureDeviceController::self().stopCapture();
ui->buttonRecordTestSound->setIcon(KIcon("media-record"));
ui->buttonPlayRecordedTestSound->setEnabled(true);
}
}
void SoundDeviceDialogPage::updatePlayButtonIcons()
{
// default sound output test
......
......@@ -44,6 +44,7 @@ public slots:
void recordSound();
void updatePlayButtonIcons();
void stopPlaying();
void stopRecord();
void setVolume(int volume);
private:
......
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