X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=main.cpp;h=0867187c57b23815dc6bb0de32efbe16001233cf;hb=refs%2Fheads%2Fmaster;hp=4bbddcc644bdf4c5bbb7ebf6398ed8e58da75b16;hpb=96dbf014dad1309d4ade9c14a8b46733e2f531c8;p=pulseview.git diff --git a/main.cpp b/main.cpp index 4bbddcc6..0867187c 100644 --- a/main.cpp +++ b/main.cpp @@ -60,6 +60,7 @@ #include "pv/mainwindow.hpp" #include "pv/session.hpp" #include "pv/util.hpp" +#include "pv/data/segment.hpp" #ifdef ANDROID #include @@ -69,9 +70,11 @@ #ifdef _WIN32 #include +#ifdef QT_STATIC Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) Q_IMPORT_PLUGIN(QSvgPlugin) #endif +#endif using std::exception; using std::ifstream; @@ -274,13 +277,17 @@ int main(int argc, char *argv[]) for (int i = 0; i < argc; i++) open_files.emplace_back(argv[i]); - qRegisterMetaType("util::Timestamp"); qRegisterMetaType("uint64_t"); + qRegisterMetaType("util::Timestamp"); + qRegisterMetaType("SharedPtrToSegment"); + qRegisterMetaType>("shared_ptr"); // Prepare the global settings since logging needs them early on pv::GlobalSettings settings; + settings.add_change_handler(&a); // Only the application object can't register itself settings.save_internal_defaults(); settings.set_defaults_where_needed(); + settings.apply_language(); settings.apply_theme(); pv::logging.init(); @@ -325,7 +332,7 @@ int main(int argc, char *argv[]) // Create the device manager, initialise the drivers pv::DeviceManager device_manager(context, driver, do_scan); - a.collect_version_info(context); + a.collect_version_info(device_manager); if (show_version) { a.print_version_info(); } else { @@ -345,10 +352,9 @@ int main(int argc, char *argv[]) #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