X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=2a4ebc251746e37c156e4ee028c7b640b1921b74;hb=d29059343817896931df3cfce2b34ec5fcc7818b;hp=6b3398f22d9a40c7bb8266b24a37e29972fe3bef;hpb=404aad0ed6bd90566739af6ecb57475bc02a7c8e;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6b3398f..2a4ebc2 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 @@ -208,7 +216,6 @@ void MainWindow::setup_ui() // Setup the context bar _context_bar = new toolbars::ContextBar(this); addToolBar(_context_bar); - insertToolBarBreak(_context_bar); // Set the title setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0, @@ -347,6 +354,7 @@ void MainWindow::run_stop() QString("Capture failed"), _1)); break; + case SigSession::AwaitingTrigger: case SigSession::Running: _session.stop_capture(); break; @@ -355,7 +363,16 @@ void MainWindow::run_stop() void MainWindow::capture_state_changed(int state) { - _sampling_bar->set_sampling(state != SigSession::Stopped); + _sampling_bar->set_capture_state((pv::SigSession::capture_state)state); +} + +void MainWindow::view_selection_changed() +{ + assert(_context_bar); + + const list > items( + _view->selected_items()); + _context_bar->set_selected_items(items); } } // namespace pv