#ifdef ENABLE_SIGNALS
if (SignalHandler::prepare_signals()) {
SignalHandler *const handler = new SignalHandler(&w);
- QObject::connect(handler, SIGNAL(int_received()),
- &w, SLOT(close()));
- QObject::connect(handler, SIGNAL(term_received()),
- &w, SLOT(close()));
+ QObject::connect(handler, SIGNAL(int_received()), &w, SLOT(close()));
+ QObject::connect(handler, SIGNAL(term_received()), &w, SLOT(close()));
+ QObject::connect(handler, SIGNAL(usr1_received()), &w, SLOT(on_run_stop_clicked()));
} else
qWarning() << "Could not prepare signal handler.";
#endif
}
}
+void MainWindow::on_external_trigger()
+{
+ on_run_stop_clicked();
+}
+
void MainWindow::on_settings_clicked()
{
dialogs::Settings dlg(device_manager_);
void on_close_current_tab();
+public Q_SLOTS:
+ void on_external_trigger();
+
private:
DeviceManager &device_manager_;
sig_action.sa_flags = SA_RESTART;
if (sigaction(SIGINT, &sig_action, nullptr) != 0 ||
- sigaction(SIGTERM, &sig_action, nullptr) != 0) {
+ sigaction(SIGTERM, &sig_action, nullptr) != 0 ||
+ sigaction(SIGUSR1, &sig_action, nullptr) != 0) {
close(sockets_[0]);
close(sockets_[1]);
return false;
case SIGTERM:
Q_EMIT term_received();
break;
+ case SIGUSR1:
+ Q_EMIT usr1_received();
+ break;
}
socket_notifier_->setEnabled(true);
Q_SIGNALS:
void int_received();
void term_received();
+ void usr1_received();
private Q_SLOTS:
void on_socket_notifier_activated();