diff --git a/src/recordpanel.cpp b/src/recordpanel.cpp --- a/src/recordpanel.cpp +++ b/src/recordpanel.cpp @@ -210,7 +210,9 @@ void RecordPanel::onRecord(bool start) else { overwriteSelected = false; - startRecording(fn); + // TODO: show more visible error message when recording fails + if (!startRecording(fn)) + recordAction.setChecked(false); } } @@ -289,7 +291,7 @@ bool RecordPanel::confirmOverwrite(QStri } } -void RecordPanel::startRecording(QString fileName) +bool RecordPanel::startRecording(QString fileName) { QStringList channelNames; if (ui->cbHeader->isChecked()) @@ -300,6 +302,11 @@ void RecordPanel::startRecording(QString channelNames, ui->cbTimestamp->isChecked())) { _stream->connectFollower(&recorder); + return true; + } + else + { + return false; } } diff --git a/src/recordpanel.h b/src/recordpanel.h --- a/src/recordpanel.h +++ b/src/recordpanel.h @@ -108,7 +108,7 @@ private: /// Formats timestamp in given text QString formatTimeStamp(QString t) const; - void startRecording(QString fileName); + bool startRecording(QString fileName); void stopRecording(void); /// Returns separator text from ui. "\t" is converted to TAB