X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=e70ca9891c565ca81891ef30e2f1b2246aa661d8;hb=b08d7222556b0a56b4fc61782faa4664a0368d59;hp=6b3398f22d9a40c7bb8266b24a37e29972fe3bef;hpb=404aad0ed6bd90566739af6ecb57475bc02a7c8e;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6b3398f2..e70ca989 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -53,10 +53,15 @@ #include #include +using namespace boost; using namespace std; namespace pv { +namespace view { +class SelectableItem; +} + MainWindow::MainWindow(DeviceManager &device_manager, const char *open_file_name, QWidget *parent) : @@ -93,6 +98,9 @@ void MainWindow::setup_ui() setCentralWidget(_central_widget); _view = new pv::view::View(_session, this); + connect(_view, SIGNAL(selection_changed()), this, + SLOT(view_selection_changed())); + _vertical_layout->addWidget(_view); // Setup the menu bar @@ -358,4 +366,13 @@ void MainWindow::capture_state_changed(int state) _sampling_bar->set_sampling(state != SigSession::Stopped); } +void MainWindow::view_selection_changed() +{ + assert(_context_bar); + + const list > items( + _view->selected_items()); + _context_bar->set_selected_items(items); +} + } // namespace pv