remove_session(sessions_.front());
}
+void MainWindow::show_session_error(const QString text, const QString info_text)
+{
+ qDebug().noquote() << "Notifying user of session error:" << info_text;
+
+ QMessageBox msg;
+ msg.setText(text);
+ msg.setInformativeText(info_text);
+ msg.setStandardButtons(QMessageBox::Ok);
+ msg.setIcon(QMessageBox::Warning);
+ msg.exec();
+}
+
shared_ptr<views::ViewBase> MainWindow::get_active_view() const
{
// If there's only one view, use it...
return false;
}
-void MainWindow::session_error(const QString text, const QString info_text)
-{
- qDebug().noquote() << "Notifying user of session error:" << info_text;
-
- QMetaObject::invokeMethod(this, "show_session_error",
- Qt::QueuedConnection, Q_ARG(QString, text),
- Q_ARG(QString, info_text));
-}
-
-void MainWindow::show_session_error(const QString text, const QString info_text)
-{
- QMessageBox msg(this);
- msg.setText(text);
- msg.setInformativeText(info_text);
- msg.setStandardButtons(QMessageBox::Ok);
- msg.setIcon(QMessageBox::Warning);
- msg.exec();
-}
-
void MainWindow::on_add_view(const QString &title, views::ViewType type,
Session *session)
{
switch (session->get_capture_state()) {
case Session::Stopped:
session->start_capture([&](QString message) {
- session_error("Capture failed", message); });
+ show_session_error("Capture failed", message); });
break;
case Session::AwaitingTrigger:
case Session::Running:
~MainWindow();
+ static void show_session_error(const QString text, const QString info_text);
+
shared_ptr<views::ViewBase> get_active_view() const;
shared_ptr<views::ViewBase> add_view(const QString &title,
virtual bool restoreState(const QByteArray &state, int version = 0);
- void session_error(const QString text, const QString info_text);
-
private Q_SLOTS:
- void show_session_error(const QString text, const QString info_text);
-
void on_add_view(const QString &title, views::ViewType type,
Session *session);
#include <sys/stat.h>
#include "devicemanager.hpp"
+#include "mainwindow.hpp"
#include "session.hpp"
#include "data/analog.hpp"
else
set_default_device();
} catch (const QString &e) {
- main_bar_->session_error(tr("Failed to select device"), e);
+ MainWindow::show_session_error(tr("Failed to select device"), e);
}
}
device_->open();
} catch (const QString &e) {
device_.reset();
- main_bar_->session_error(tr("Failed to open device"), e);
+ MainWindow::show_session_error(tr("Failed to open device"), e);
}
if (device_) {
[&](const pair<string, shared_ptr<InputFormat> > f) {
return f.first == user_name; });
if (iter == formats.end()) {
- main_bar_->session_error(tr("Error"),
+ MainWindow::show_session_error(tr("Error"),
tr("Unexpected input format: %s").arg(QString::fromStdString(format)));
return;
}
device_manager_.context(),
file_name.toStdString())));
} catch (Error& e) {
- main_bar_->session_error(tr("Failed to load ") + file_name, e.what());
+ MainWindow::show_session_error(tr("Failed to load ") + file_name, e.what());
set_default_device();
main_bar_->update_device_list();
return;
main_bar_->update_device_list();
start_capture([&, errorMessage](QString infoMessage) {
- main_bar_->session_error(errorMessage, infoMessage); });
+ MainWindow::show_session_error(errorMessage, infoMessage); });
set_name(QFileInfo(file_name).fileName());
}
update_sample_rate_selector();
}
-void MainBar::session_error(const QString text, const QString info_text)
-{
- QMetaObject::invokeMethod(this, "show_session_error",
- Qt::QueuedConnection, Q_ARG(QString, text),
- Q_ARG(QString, info_text));
-}
-
void MainBar::show_session_error(const QString text, const QString info_text)
{
QMessageBox msg(this);
QAction* action_save_selection_as() const;
QAction* action_connect() const;
- void session_error(const QString text, const QString info_text);
-
private:
void run_stop();
set(pulseview_TEST_SOURCES
${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp
${PROJECT_SOURCE_DIR}/pv/globalsettings.cpp
+ ${PROJECT_SOURCE_DIR}/pv/logging.cpp
+ ${PROJECT_SOURCE_DIR}/pv/mainwindow.cpp
${PROJECT_SOURCE_DIR}/pv/session.cpp
${PROJECT_SOURCE_DIR}/pv/storesession.cpp
${PROJECT_SOURCE_DIR}/pv/util.cpp
${PROJECT_SOURCE_DIR}/pv/devices/sessionfile.cpp
${PROJECT_SOURCE_DIR}/pv/dialogs/connect.cpp
${PROJECT_SOURCE_DIR}/pv/dialogs/inputoutputoptions.cpp
+ ${PROJECT_SOURCE_DIR}/pv/dialogs/settings.cpp
${PROJECT_SOURCE_DIR}/pv/dialogs/storeprogress.cpp
${PROJECT_SOURCE_DIR}/pv/prop/bool.cpp
${PROJECT_SOURCE_DIR}/pv/prop/double.cpp
# This list includes only QObject derived class headers.
set(pulseview_TEST_HEADERS
+ ${PROJECT_SOURCE_DIR}/pv/devicemanager.hpp
${PROJECT_SOURCE_DIR}/pv/globalsettings.hpp
+ ${PROJECT_SOURCE_DIR}/pv/logging.hpp
+ ${PROJECT_SOURCE_DIR}/pv/mainwindow.hpp
${PROJECT_SOURCE_DIR}/pv/session.hpp
${PROJECT_SOURCE_DIR}/pv/storesession.hpp
${PROJECT_SOURCE_DIR}/pv/binding/device.hpp
${PROJECT_SOURCE_DIR}/pv/devices/device.hpp
${PROJECT_SOURCE_DIR}/pv/dialogs/connect.hpp
${PROJECT_SOURCE_DIR}/pv/dialogs/inputoutputoptions.hpp
+ ${PROJECT_SOURCE_DIR}/pv/dialogs/settings.hpp
${PROJECT_SOURCE_DIR}/pv/dialogs/storeprogress.hpp
${PROJECT_SOURCE_DIR}/pv/popups/channels.hpp
${PROJECT_SOURCE_DIR}/pv/popups/deviceoptions.hpp