{
setup_ui();
restore_ui_settings();
+ connect(this, SIGNAL(session_error_raised(const QString, const QString)),
+ this, SLOT(on_session_error_raised(const QString, const QString)));
}
MainWindow::~MainWindow()
qobject_cast<views::ViewBase*>(v.get()),
SLOT(trigger_event(int, util::Timestamp)));
+ connect(&session, SIGNAL(session_error_raised(const QString, const QString)),
+ this, SLOT(on_session_error_raised(const QString, const QString)));
+
if (type == views::ViewTypeTrace) {
views::trace::View *tv =
qobject_cast<views::trace::View*>(v.get());
if (any_running)
s->stop_capture();
else
- s->start_capture([&](QString message) {
- show_session_error("Capture failed", message); });
+ s->start_capture([&](QString message) {Q_EMIT session_error_raised("Capture failed", message);});
} else {
shared_ptr<Session> session = last_focused_session_;
switch (session->get_capture_state()) {
case Session::Stopped:
- session->start_capture([&](QString message) {
- show_session_error("Capture failed", message); });
+ session->start_capture([&](QString message) {Q_EMIT session_error_raised("Capture failed", message);});
break;
case Session::AwaitingTrigger:
case Session::Running:
on_tab_close_requested(tab);
}
+void MainWindow::on_session_error_raised(const QString text, const QString info_text) {
+ MainWindow::show_session_error(text, info_text);
+}
+
} // namespace pv
virtual bool restoreState(const QByteArray &state, int version = 0);
+Q_SIGNALS:
+ void session_error_raised(const QString text, const QString info_text);
+
public Q_SLOTS:
void on_run_stop_clicked();
+ void on_session_error_raised(const QString text, const QString info_text);
private Q_SLOTS:
void on_add_view(ViewType type, Session *session);
main_bar_->update_device_list();
start_capture([&, errorMessage](QString infoMessage) {
- MainWindow::show_session_error(errorMessage, infoMessage); });
+ Q_EMIT session_error_raised(errorMessage, infoMessage); });
// Only set save path if we loaded an srzip file
if (dynamic_pointer_cast<devices::SessionFile>(device_))