X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=924e70581fa442d064413b2a9b6e5f862d8553aa;hp=cc0e0d25cdf550538df677ddf762aac93804cf1c;hb=7c65709437184b09753d1bcacc02467b8f6171f1;hpb=51cf49fe312f92cccde3e861d357e4b459976c0d diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index cc0e0d25..924e7058 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -46,7 +46,7 @@ #include "dialogs/about.hpp" #include "dialogs/connect.hpp" #include "dialogs/storeprogress.hpp" -#include "toolbars/samplingbar.hpp" +#include "toolbars/mainbar.hpp" #include "view/logicsignal.hpp" #include "view/view.hpp" #ifdef ENABLE_DECODE @@ -61,7 +61,6 @@ using std::list; using std::map; -using std::pair; using std::shared_ptr; using std::string; @@ -72,7 +71,7 @@ using sigrok::HardwareDevice; namespace pv { namespace view { -class SelectableItem; +class ViewItem; } const char *MainWindow::SettingOpenDirectory = "MainWindow/OpenDirectory"; @@ -284,12 +283,12 @@ void MainWindow::setup_ui() addToolBar(toolbar); // Setup the sampling bar - sampling_bar_ = new toolbars::SamplingBar(session_, *this); + main_bar_ = new toolbars::MainBar(session_, *this); // Populate the device list and select the initially selected device update_device_list(); - addToolBar(sampling_bar_); + addToolBar(main_bar_); // Set the title setWindowTitle(tr("PulseView")); @@ -395,7 +394,7 @@ void MainWindow::session_error( void MainWindow::update_device_list() { - assert(sampling_bar_); + assert(main_bar_); shared_ptr selected_device = session_.device(); list< shared_ptr > devices; @@ -411,13 +410,7 @@ void MainWindow::update_device_list() devices.push_back(selected_device); assert(selected_device); - list< pair< shared_ptr, string> > device_list; - - for (auto device : devices) - device_list.push_back(make_pair( - device, device_manager_.get_display_name(device))); - - sampling_bar_->set_device_list(device_list, selected_device); + main_bar_->set_device_list(devices, selected_device); } void MainWindow::closeEvent(QCloseEvent *event) @@ -570,7 +563,7 @@ void MainWindow::add_decoder(srd_decoder *decoder) void MainWindow::capture_state_changed(int state) { - sampling_bar_->set_capture_state((pv::Session::capture_state)state); + main_bar_->set_capture_state((pv::Session::capture_state)state); } void MainWindow::device_selected()