From 62329baf59f8bb1c9ba87248dd8d593622cc283f Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 4 Apr 2023 16:19:33 +0800 Subject: [PATCH] Prohibited adding decoder during the collection process --- DSView/pv/dock/protocoldock.cpp | 8 ++++++++ DSView/pv/dock/protocoldock.h | 1 + DSView/pv/mainwindow.cpp | 2 ++ 3 files changed, 11 insertions(+) diff --git a/DSView/pv/dock/protocoldock.cpp b/DSView/pv/dock/protocoldock.cpp index a3106768..dd769065 100644 --- a/DSView/pv/dock/protocoldock.cpp +++ b/DSView/pv/dock/protocoldock.cpp @@ -1004,5 +1004,13 @@ bool ProtocolDock::protocol_sort_callback(const DecoderInfoItem *o1, const Decod decoded_progress(0); } + void ProtocolDock::update_view_status() + { + bool bEnable = _session->is_working() == false; + _pro_keyword_edit->setEnabled(bEnable); + _pro_add_button->setEnabled(bEnable); + _pro_search_button->setEnabled(bEnable); + } + } // namespace dock } // namespace pv diff --git a/DSView/pv/dock/protocoldock.h b/DSView/pv/dock/protocoldock.h index 2776eb4f..0da3f687 100644 --- a/DSView/pv/dock/protocoldock.h +++ b/DSView/pv/dock/protocoldock.h @@ -85,6 +85,7 @@ public: bool add_protocol_by_id(QString id, bool silent, std::list &sub_decoders); void reset_view(); + void update_view_status(); private: void changeEvent(QEvent *event); diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 17611108..eb7bd473 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -1659,12 +1659,14 @@ namespace pv case DSV_MSG_START_COLLECT_WORK: update_toolbar_view_status(); _view->on_state_changed(false); + _protocol_widget->update_view_status(); break; case DSV_MSG_COLLECT_END: prgRate(0); _view->repeat_unshow(); _view->on_state_changed(true); + _protocol_widget->update_view_status(); break; case DSV_MSG_END_COLLECT_WORK: