X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=ea9f01af7fd13f6ca056ef7dfe37333b158cbb9d;hb=7697cd83435e88689936b14c952b8a34d5258b69;hp=7d350625a4ddd3e9528dac8403ed75385b881420;hpb=273798599b8be55a7ed9bbc99077b3478a094aec;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 7d350625..ea9f01af 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -52,7 +52,7 @@ #ifdef ENABLE_DECODE #include "subwindows/decoder_selector/subwindow.hpp" -#include "views/decoder_output/view.hpp" +#include "views/decoder_binary/view.hpp" #endif #include @@ -162,8 +162,8 @@ shared_ptr MainWindow::add_view(views::ViewType type, // This view will be the main view if there's no main bar yet v = make_shared(session, (main_bar ? false : true), dock_main); #ifdef ENABLE_DECODE - if (type == views::ViewTypeDecoderOutput) - v = make_shared(session, false, dock_main); + if (type == views::ViewTypeDecoderBinary) + v = make_shared(session, false, dock_main); #endif if (!v) @@ -569,10 +569,16 @@ void MainWindow::setup_ui() void MainWindow::update_acq_button(Session *session) { - int state = session->get_capture_state(); + int state; + QString run_caption; - const QString run_caption = - session->using_file_device() ? tr("Reload") : tr("Run"); + if (session) { + state = session->get_capture_state(); + run_caption = session->using_file_device() ? tr("Reload") : tr("Run"); + } else { + state = Session::Stopped; + run_caption = tr("Run"); + } const QIcon *icons[] = {&icon_grey_, &icon_red_, &icon_green_}; run_stop_button_->setIcon(*icons[state]); @@ -847,6 +853,9 @@ void MainWindow::on_tab_close_requested(int index) tr("This session contains unsaved data. Close it anyway?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)) remove_session(session); + + if (sessions_.empty()) + update_acq_button(nullptr); } void MainWindow::on_show_decoder_selector(Session *session)