break;
case SR_CONF_LIMIT_FRAMES:
- bind_int(name, "", "", pair<int64_t, int64_t>(0, 1000000), get, set);
+ // Value 0 means that there is no limit
+ bind_int(name, "", "", pair<int64_t, int64_t>(0, 1000000), get, set,
+ tr("No Limit"));
break;
case SR_CONF_PATTERN_MODE:
}
void Device::bind_int(const QString &name, const QString &desc, QString suffix,
- optional< pair<int64_t, int64_t> > range,
- Property::Getter getter, Property::Setter setter)
+ optional< pair<int64_t, int64_t> > range, Property::Getter getter,
+ Property::Setter setter, QString special_value_text)
{
assert(configurable_);
properties_.push_back(shared_ptr<Property>(new Int(name, desc, suffix,
- range, getter, setter)));
+ range, getter, setter, special_value_text)));
}
QString Device::print_timebase(Glib::VariantBase gvar)
function<QString (Glib::VariantBase)> printer = print_gvariant);
void bind_int(const QString &name, const QString &desc, QString suffix,
boost::optional< pair<int64_t, int64_t> > range,
- prop::Property::Getter getter, prop::Property::Setter setter);
+ prop::Property::Getter getter, prop::Property::Setter setter,
+ QString special_value_text = "");
static QString print_timebase(Glib::VariantBase gvar);
static QString print_vdiv(Glib::VariantBase gvar);
class Bool : public Property
{
- Q_OBJECT;
+ Q_OBJECT
public:
Bool(QString name, QString desc, Getter getter, Setter setter);
class Enum : public Property
{
- Q_OBJECT;
+ Q_OBJECT
public:
Enum(QString name, QString desc,
namespace pv {
namespace prop {
-Int::Int(QString name,
- QString desc,
- QString suffix,
- optional< pair<int64_t, int64_t> > range,
- Getter getter,
- Setter setter) :
+Int::Int(QString name, QString desc, QString suffix,
+ optional< pair<int64_t, int64_t> > range, Getter getter, Setter setter,
+ QString special_value_text) :
Property(name, desc, getter, setter),
suffix_(suffix),
+ special_value_text_(special_value_text),
range_(range),
spin_box_(nullptr)
{
spin_box_ = new QSpinBox(parent);
spin_box_->setSuffix(suffix_);
+ spin_box_->setSpecialValueText(special_value_text_);
const GVariantType *const type = g_variant_get_type(value);
assert(type);
class Int : public Property
{
- Q_OBJECT;
+ Q_OBJECT
public:
Int(QString name, QString desc, QString suffix,
boost::optional< pair<int64_t, int64_t> > range,
- Getter getter, Setter setter);
+ Getter getter, Setter setter, QString special_value_text = "");
virtual ~Int() = default;
void on_value_changed(int);
private:
- const QString suffix_;
+ const QString suffix_, special_value_text_;
const boost::optional< pair<int64_t, int64_t> > range_;
Glib::VariantBase value_;
class Property : public QObject
{
- Q_OBJECT;
+ Q_OBJECT
public:
typedef function<Glib::VariantBase ()> Getter;
class String : public Property
{
- Q_OBJECT;
+ Q_OBJECT
public:
String(QString name, QString desc, Getter getter, Setter setter);