+void MainWindow::run_stop()
+{
+ switch(session_.get_capture_state()) {
+ case Session::Stopped:
+ session_.start_capture([&](QString message) {
+ session_error("Capture failed", message); });
+ break;
+
+ case Session::AwaitingTrigger:
+ case Session::Running:
+ session_.stop_capture();
+ break;
+ }
+}
+
+void MainWindow::select_device(shared_ptr<Device> device)
+{
+ try {
+ session_.set_device(device);
+ } catch(const QString &e) {
+ QMessageBox msg(this);
+ msg.setText(e);
+ msg.setInformativeText(tr("Failed to Select Device"));
+ msg.setStandardButtons(QMessageBox::Ok);
+ msg.setIcon(QMessageBox::Warning);
+ msg.exec();
+ }
+}
+