Skip to content

Commit 56b76ac

Browse files
committed
[rcs] Hid some more warnings on start/stop
1 parent e647f0d commit 56b76ac

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/mainwindow.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,23 +454,28 @@ 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+
} else {
461+
hideWarnings = false;
462+
}
460463
}
461464

462465
void MainWindow::stopRecording() {
463466

464-
if (!currentRecording)
465-
QMessageBox::information(
466-
this, "Not recording", "There is not ongoing recording", QMessageBox::Ok);
467-
else {
467+
if (currentRecording) {
468468
try {
469469
currentRecording = nullptr;
470470
} catch (std::exception &e) { qWarning() << "exception on stop: " << e.what(); }
471471
ui->startButton->setEnabled(true);
472472
ui->stopButton->setEnabled(false);
473473
statusBar()->showMessage("Stopped");
474+
} else if (!hideWarnings) {
475+
QMessageBox::information(
476+
this, "Not recording", "There is not ongoing recording", QMessageBox::Ok);
477+
} else {
478+
hideWarnings = false;
474479
}
475480
}
476481

@@ -617,7 +622,7 @@ void MainWindow::enableRcs(bool bEnable) {
617622
// TODO: Add some method to RemoteControlSocket to report if its server is listening (i.e. was successful).
618623
connect(rcs.get(), &RemoteControlSocket::refresh_streams, this, &MainWindow::refreshStreams);
619624
connect(rcs.get(), &RemoteControlSocket::start, this, &MainWindow::rcsStartRecording);
620-
connect(rcs.get(), &RemoteControlSocket::stop, this, &MainWindow::stopRecording);
625+
connect(rcs.get(), &RemoteControlSocket::stop, this, &MainWindow::rcsStopRecording);
621626
connect(rcs.get(), &RemoteControlSocket::filename, this, &MainWindow::rcsUpdateFilename);
622627
connect(rcs.get(), &RemoteControlSocket::select_all, this, &MainWindow::selectAllStreams);
623628
connect(rcs.get(), &RemoteControlSocket::select_none, this, &MainWindow::selectNoStreams);
@@ -642,6 +647,11 @@ void MainWindow::rcsStartRecording() {
642647
startRecording();
643648
}
644649

650+
void MainWindow::rcsStopRecording() {
651+
hideWarnings = true;
652+
stopRecording();
653+
}
654+
645655
void MainWindow::rcsUpdateFilename(QString s) {
646656
//
647657
// 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)