+ // Load the protocol decoders
+ srd_decoder_load_all();
+#endif
+
+#ifndef ENABLE_STACKTRACE
+ try {
+#endif
+
+ // Create the device manager, initialise the drivers
+ pv::DeviceManager device_manager(context, driver, do_scan);
+
+ // Initialise the main window
+ pv::MainWindow w(device_manager);
+ w.show();
+
+ if (restore_sessions)
+ w.restore_sessions();
+
+ if (!open_file.empty())
+ w.add_session_with_file(open_file, open_file_format);
+ else
+ w.add_default_session();
+
+#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()));
+ } else
+ qWarning() << "Could not prepare signal handler.";
+#endif
+
+ // Run the application
+ ret = a.exec();
+
+#ifndef ENABLE_STACKTRACE
+ } catch (exception& e) {
+ qDebug() << "Exception:" << e.what();
+ }
+#endif