]> sigrok.org Git - pulseview.git/blobdiff - pv/session.cpp
MainBar: Remove empty menu button
[pulseview.git] / pv / session.cpp
index b53360fcd9508bbbc559978181a33cfe88ecad71..f6fb7085582a7ce19a1941c71e5effa3a040c91c 100644 (file)
@@ -99,6 +99,7 @@ using Glib::Variant;
 namespace pv {
 Session::Session(DeviceManager &device_manager, QString name) :
        device_manager_(device_manager),
+       default_name_(name),
        name_(name),
        capture_state_(Stopped),
        cur_samplerate_(0)
@@ -148,6 +149,11 @@ void Session::set_name(QString name)
        name_changed();
 }
 
+const std::list< std::shared_ptr<pv::view::View> > Session::views() const
+{
+       return views_;
+}
+
 std::shared_ptr<pv::view::View> Session::main_view() const
 {
        return main_view_;
@@ -295,10 +301,11 @@ void Session::restore_settings(QSettings &settings)
                        device = std::make_shared<devices::SessionFile>(device_manager_.context(),
                                filename.toStdString());
                        set_device(device);
-                       set_name(filename);
 
                        // TODO Perform error handling
                        start_capture([](QString infoMessage) { (void)infoMessage; });
+
+                       set_name(QFileInfo(filename).fileName());
                }
        }
 
@@ -472,6 +479,8 @@ void Session::register_view(std::shared_ptr<pv::view::View> view)
        }
 
        views_.push_back(view);
+
+       update_signals();
 }
 
 void Session::deregister_view(std::shared_ptr<pv::view::View> view)
@@ -663,6 +672,7 @@ void Session::update_signals()
                        if (iter != prev_sigs.end()) {
                                // Copy the signal from the old set to the new
                                signal = *iter;
+                               view->add_signal(signal);
                        } else {
                                // Find the signalbase for this channel if possible
                                signalbase.reset();