Decoder::Decoder(const srd_decoder *const dec) :
srd_decoder_(dec),
- shown_(true),
+ visible_(true),
decoder_inst_(nullptr)
{
// Query the annotation output classes
return srd_decoder_->name;
}
-bool Decoder::shown() const
+bool Decoder::visible() const
{
- return shown_;
+ return visible_;
}
-void Decoder::show(bool show)
+void Decoder::set_visible(bool visible)
{
- shown_ = show;
+ visible_ = visible;
}
const vector<DecodeChannel*>& Decoder::channels() const
const char* name() const;
- bool shown() const;
- void show(bool show = true);
+ bool visible() const;
+ void set_visible(bool visible);
const vector<DecodeChannel*>& channels() const;
void set_channels(vector<DecodeChannel*> channels);
private:
const srd_decoder* const srd_decoder_;
- bool shown_;
+ bool visible_;
vector<DecodeChannel*> channels_;
vector<Row> rows_;
// Toggle decoder visibility
bool state = false;
if (dec) {
- state = !dec->shown();
- dec->show(state);
+ state = !dec->visible();
+ dec->set_visible(state);
}
return state;
for (const shared_ptr<Decoder>& dec : stack_) {
assert(dec);
- if (visible_only && !dec->shown())
+ if (visible_only && !dec->visible())
continue;
for (Row* row : dec->get_rows())
for (const shared_ptr<Decoder>& dec : stack_) {
assert(dec);
- if (visible_only && !dec->shown())
+ if (visible_only && !dec->visible())
continue;
for (const Row* row : dec->get_rows())
settings.beginGroup("decoder" + QString::number(decoder_idx++));
settings.setValue("id", decoder->get_srd_decoder()->id);
- settings.setValue("shown", decoder->shown());
+ settings.setValue("visible", decoder->visible());
// Save decoder options
const map<string, GVariant*>& options = decoder->options();
shared_ptr<Decoder> decoder = make_shared<Decoder>(dec);
stack_.push_back(decoder);
- decoder->show(settings.value("shown", true).toBool());
+ decoder->set_visible(settings.value("visible", true).toBool());
// Restore decoder options that differ from their default
int options = settings.value("options").toInt();
// If the row is hidden, we don't want to fetch annotations
assert(r.decode_row);
assert(r.decode_row->decoder());
- if ((!r.decode_row->decoder()->shown()) || (!r.decode_row->visible())) {
+ if ((!r.decode_row->decoder()->visible()) || (!r.decode_row->visible())) {
r.currently_visible = false;
continue;
}
tr("%1:\n%2").arg(QString::fromUtf8(decoder->longname),
QString::fromUtf8(decoder->desc)),
nullptr, decoder_deletable);
- group->set_decoder_visible(dec->shown());
+ group->set_decoder_visible(dec->visible());
if (decoder_deletable) {
delete_mapper_.setMapping(group, index);