]> sigrok.org Git - pulseview.git/blobdiff - main.cpp
doc: update IRC reference to Libera.Chat
[pulseview.git] / main.cpp
index 1e4fe577dc11328b4b07167b3ce1c42d16fdd075..3a5ac29fc2bca41ae597f812ee90d88040b2a02f 100644 (file)
--- 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 <libsigrokandroidutils/libsigrokandroidutils.h>
@@ -274,13 +275,17 @@ int main(int argc, char *argv[])
        for (int i = 0; i < argc; i++)
                open_files.emplace_back(argv[i]);
 
-       qRegisterMetaType<pv::util::Timestamp>("util::Timestamp");
        qRegisterMetaType<uint64_t>("uint64_t");
+       qRegisterMetaType<pv::util::Timestamp>("util::Timestamp");
+       qRegisterMetaType<SharedPtrToSegment>("SharedPtrToSegment");
+       qRegisterMetaType<shared_ptr<pv::data::SignalBase>>("shared_ptr<SignalBase>");
 
        // 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();
@@ -340,16 +345,14 @@ int main(int argc, char *argv[])
                                w.add_default_session();
                        else
                                for (string& open_file : open_files)
-                                       w.add_session_with_file(open_file, open_file_format,
-                                               open_setup_file);
+                                       w.add_session_with_file(open_file, open_file_format, open_setup_file);
 
 #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