Skip to content

Commit 8fdaa95

Browse files
authored
Merge pull request #76 from brifsttar/master
[rcs] Hid some more warnings on start/stop
2 parents e647f0d + cbffd5a commit 8fdaa95

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/mainwindow.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,23 +454,24 @@ void MainWindow::startRecording() {
454454
ui->startButton->setEnabled(false);
455455
startTime = (int)lsl::local_clock();
456456

457-
} else
457+
} else if (!hideWarnings) {
458458
QMessageBox::information(
459459
this, "Already recording", "The recording is already running", QMessageBox::Ok);
460+
}
460461
}
461462

462463
void MainWindow::stopRecording() {
463464

464-
if (!currentRecording)
465-
QMessageBox::information(
466-
this, "Not recording", "There is not ongoing recording", QMessageBox::Ok);
467-
else {
465+
if (currentRecording) {
468466
try {
469467
currentRecording = nullptr;
470468
} catch (std::exception &e) { qWarning() << "exception on stop: " << e.what(); }
471469
ui->startButton->setEnabled(true);
472470
ui->stopButton->setEnabled(false);
473471
statusBar()->showMessage("Stopped");
472+
} else if (!hideWarnings) {
473+
QMessageBox::information(
474+
this, "Not recording", "There is not ongoing recording", QMessageBox::Ok);
474475
}
475476
}
476477

@@ -617,7 +618,7 @@ void MainWindow::enableRcs(bool bEnable) {
617618
// TODO: Add some method to RemoteControlSocket to report if its server is listening (i.e. was successful).
618619
connect(rcs.get(), &RemoteControlSocket::refresh_streams, this, &MainWindow::refreshStreams);
619620
connect(rcs.get(), &RemoteControlSocket::start, this, &MainWindow::rcsStartRecording);
620-
connect(rcs.get(), &RemoteControlSocket::stop, this, &MainWindow::stopRecording);
621+
connect(rcs.get(), &RemoteControlSocket::stop, this, &MainWindow::rcsStopRecording);
621622
connect(rcs.get(), &RemoteControlSocket::filename, this, &MainWindow::rcsUpdateFilename);
622623
connect(rcs.get(), &RemoteControlSocket::select_all, this, &MainWindow::selectAllStreams);
623624
connect(rcs.get(), &RemoteControlSocket::select_none, this, &MainWindow::selectNoStreams);
@@ -642,6 +643,11 @@ void MainWindow::rcsStartRecording() {
642643
startRecording();
643644
}
644645

646+
void MainWindow::rcsStopRecording() {
647+
hideWarnings = true;
648+
stopRecording();
649+
}
650+
645651
void MainWindow::rcsUpdateFilename(QString s) {
646652
//
647653
// format: "filename {option:value}{option:value}

src/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ private slots:
5757
void rcsCheckBoxChanged(bool checked);
5858
void rcsUpdateFilename(QString s);
5959
void rcsStartRecording();
60+
void rcsStopRecording();
6061
void rcsportValueChangedInt(int value);
6162

6263
private:

0 commit comments

Comments
 (0)