diff --git a/src/batch.cpp b/src/batch.cpp index 6fa5291..e0fe1f1 100644 --- a/src/batch.cpp +++ b/src/batch.cpp @@ -468,6 +468,7 @@ void Batch::startTracking() { ui->startButton->setDisabled(false); ui->removePath->setDisabled(false); ui->clearPath->setDisabled(false); + emit(status("Tracking finished")); } } diff --git a/src/batch.h b/src/batch.h index 07bc640..26f5ac2 100644 --- a/src/batch.h +++ b/src/batch.h @@ -106,8 +106,8 @@ class Batch : public QWidget { * @brief Emitted when a tracking analysis is finished. */ void next(); - void log(QMap log); + void status(QString messsage); }; #endif // BATCH_H diff --git a/src/interactive.cpp b/src/interactive.cpp index af248e4..41353ba 100644 --- a/src/interactive.cpp +++ b/src/interactive.cpp @@ -913,7 +913,8 @@ void Interactive::track() { replayAction->setChecked(true); logMap->insert("status", errorMessage); emit(log(*logMap)); - message(errorMessage); + emit(status("Tracking failed")); + emit(message(errorMessage)); }); connect(tracking, &Tracking::finished, thread, &QThread::quit); connect(tracking, &Tracking::finished, this, [this, logMap]() { @@ -924,6 +925,7 @@ void Interactive::track() { replayAction->setChecked(true); logMap->insert("status", "Done"); emit(log(*logMap)); + emit(status("Tracking succeeded")); }); connect(tracking, &Tracking::forceFinished, thread, &QThread::quit); connect(tracking, &Tracking::forceFinished, tracking, &Tracking::deleteLater); diff --git a/src/interactive.h b/src/interactive.h index 50cc682..fbad911 100644 --- a/src/interactive.h +++ b/src/interactive.h @@ -132,5 +132,6 @@ class Interactive : public QMainWindow { signals: void message(QString message); void log(QMap log); + void status(QString messsage); }; #endif // INTERACTIVE_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b62b8ef..b6d6cae 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -161,9 +161,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), interactive = new Interactive(this); ui->tabWidget->addTab(interactive, tr("Interactive tracking")); + connect(interactive, &Interactive::status, [this](QString message) { + trayIcon->showMessage("FastTrack", message, QSystemTrayIcon::Information, 3000); + }); batch = new Batch(this); ui->tabWidget->addTab(batch, tr("Batch tracking")); + connect(batch, &Batch::status, [this](QString message) { + trayIcon->showMessage("FastTrack", message, QSystemTrayIcon::Information, 3000); + }); replay = new Replay(this); ui->tabWidget->addTab(replay, tr("Tracking inspector"));