From: Joel Holdsworth Date: Sat, 17 Jan 2015 15:09:57 +0000 (+0000) Subject: LogicSignal: Hide the trigger selector, when there is no trigger support X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=ffd905668e3268cc834a7b8ae48d778d2b5be365 LogicSignal: Hide the trigger selector, when there is no trigger support --- diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index c6b7cff..18ca520 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -384,21 +384,23 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form) { Signal::populate_popup_form(parent, form); - trigger_bar_ = new QToolBar(parent); - init_trigger_actions(trigger_bar_); - trigger_bar_->addAction(trigger_none_); - trigger_none_->setChecked(!trigger_match_); - const vector trig_types = get_trigger_types(); - for (auto type_id : trig_types) { - const TriggerMatchType *const type = - TriggerMatchType::get(type_id); - QAction *const action = action_from_trigger_type(type); - trigger_bar_->addAction(action); - action->setChecked(trigger_match_ == type); - } - form->addRow(tr("Trigger"), trigger_bar_); + if (!trig_types.empty()) { + trigger_bar_ = new QToolBar(parent); + init_trigger_actions(trigger_bar_); + trigger_bar_->addAction(trigger_none_); + trigger_none_->setChecked(!trigger_match_); + + for (auto type_id : trig_types) { + const TriggerMatchType *const type = + TriggerMatchType::get(type_id); + QAction *const action = action_from_trigger_type(type); + trigger_bar_->addAction(action); + action->setChecked(trigger_match_ == type); + } + form->addRow(tr("Trigger"), trigger_bar_); + } } void LogicSignal::modify_trigger()