QString ExtArgBool::defaultValue() { if ( _argument != 0 && _argument->default_complex != NULL ) if ( extcap_complex_get_bool(_argument->default_complex) == (gboolean)TRUE ) return QString("true"); return QString("false"); }
gboolean extcap_compare_is_default(extcap_arg *element, extcap_complex *test) { gboolean result = FALSE; if (element->default_complex == NULL) return result; switch (element->arg_type) { case EXTCAP_ARG_INTEGER: if (extcap_complex_get_int(test) == extcap_complex_get_int(element->default_complex)) result = TRUE; break; case EXTCAP_ARG_UNSIGNED: if (extcap_complex_get_uint(test) == extcap_complex_get_uint(element->default_complex)) result = TRUE; break; case EXTCAP_ARG_LONG: if (extcap_complex_get_long(test) == extcap_complex_get_long(element->default_complex)) result = TRUE; break; case EXTCAP_ARG_DOUBLE: if (extcap_complex_get_double(test) == extcap_complex_get_double(element->default_complex)) result = TRUE; break; case EXTCAP_ARG_BOOLEAN: case EXTCAP_ARG_BOOLFLAG: if (extcap_complex_get_bool(test) == extcap_complex_get_bool(element->default_complex)) result = TRUE; break; case EXTCAP_ARG_STRING: if (strcmp(extcap_complex_get_string(test), extcap_complex_get_string(element->default_complex)) == 0) result = TRUE; break; default: break; } return result; }
bool ExtArgBool::defaultBool() { bool result = false; if ( _argument ) { if ( extcap_complex_get_bool(_argument->default_complex) == (gboolean)TRUE ) result = true; } return result; }
virtual QWidget * createEditor(QWidget * parent) { boolBox = new QCheckBox(QString().fromUtf8(_argument->display), parent); if ( _argument->tooltip != NULL ) boolBox->setToolTip(QString().fromUtf8(_argument->tooltip)); if ( _argument->default_complex != NULL ) if ( extcap_complex_get_bool(_argument->default_complex) == (gboolean)TRUE ) boolBox->setCheckState(Qt::Checked); if ( _default != NULL ) { if ( _default->toString().compare("true") ) boolBox->setCheckState(Qt::Checked); } return boolBox; }
QWidget * ExtArgBool::createEditor(QWidget * parent) { boolBox = new QCheckBox(QString().fromUtf8(_argument->display), parent); if ( _argument->tooltip != NULL ) boolBox->setToolTip(QString().fromUtf8(_argument->tooltip)); if ( _argument->default_complex != NULL ) if ( extcap_complex_get_bool(_argument->default_complex) == (gboolean)TRUE ) boolBox->setCheckState(Qt::Checked); if ( _default != NULL ) { if ( _default->toString().compare("true") ) boolBox->setCheckState(Qt::Checked); } connect (boolBox, SIGNAL(stateChanged(int)), SLOT(onIntChanged(int))); return boolBox; }