X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsubwindows%2Fdecoder_selector%2Fsubwindow.cpp;h=96da710fb052ca9228214eff5a36a3772efba75f;hp=19632ad17a05051b22f63e649923d98d0b34f484;hb=0e2ba0cc745e763279510d943593abce52a36040;hpb=b032da6260e46cd7f9ff998da21d687e7d54cf9d diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp index 19632ad1..96da710f 100644 --- a/pv/subwindows/decoder_selector/subwindow.cpp +++ b/pv/subwindows/decoder_selector/subwindow.cpp @@ -147,6 +147,9 @@ SubWindow::SubWindow(Session& session, QWidget* parent) : connect(this, SIGNAL(new_decoders_selected(vector)), &session, SLOT(on_new_decoders_selected(vector))); + + // Place the keyboard cursor in the filter QLineEdit initially + filter->setFocus(); } bool SubWindow::has_toolbar() const @@ -190,8 +193,10 @@ vector SubWindow::get_decoders_providing(const char* output) if (!d->outputs) continue; + const int maxlen = 1024; + // TODO For now we ignore that d->outputs is actually a list - if (strncmp((char*)(d->outputs->data), output, strlen(output)) == 0) + if (strncmp((char*)(d->outputs->data), output, maxlen) == 0) ret_val.push_back(d); } @@ -252,13 +257,13 @@ void SubWindow::on_item_activated(const QModelIndex& index) return; } - if (strncmp(inputs.at(0), "logic", 5) == 0) { + if (strcmp(inputs.at(0), "logic") == 0) { new_decoders_selected(decoders); return; } // Check if we can automatically fulfill the stacking requirements - while (strncmp(inputs.at(0), "logic", 5) != 0) { + while (strcmp(inputs.at(0), "logic") != 0) { vector prov_decoders = get_decoders_providing(inputs.at(0)); if (prov_decoders.size() == 0) { @@ -301,6 +306,9 @@ void SubWindow::on_item_activated(const QModelIndex& index) void SubWindow::on_filter_changed(const QString& text) { sort_filter_model_->setFilterFixedString(text); + + // Expand the "All Decoders" category/tag if the user filtered + tree_view_->setExpanded(tree_view_->model()->index(0, 0), !text.isEmpty()); } } // namespace decoder_selector