+shared_ptr<Property> DecoderOptions::bind_enum(
+ const QString &name, const srd_decoder_option *option,
+ Property::Getter getter, Property::Setter setter)
+{
+ vector< pair<Glib::VariantBase, QString> > values;
+ for (GSList *l = option->values; l; l = l->next) {
+ Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data, true);
+ values.push_back(make_pair(var, print_gvariant(var)));
+ }
+
+ return shared_ptr<Property>(new Enum(name, values, getter, setter));
+}
+
+Glib::VariantBase DecoderOptions::getter(const char *id)