Commit 492d05ac authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete support preparation for optional fields

Pending on support in / Python mappers
parent 2a890b0e
......@@ -410,6 +410,23 @@ class asn1Editor(QTreeView):
stateBefore = dest.GetState()
parseRow(root, i, dest, seqOf=seqOf)
# Check if field is optional and set the .exist.field
# accordingly
field_root = root.child(i)
field_name = \
root.child(i, 0).text().replace('-', '_')
field_optionality = root.child(i, 4)
if \
and field_optionality.isCheckable():
present = field_optionality.checkState() == Qt.Checked
print field_name, "SET" if present else "UNSET"
# Uncomment the following when supports it:
#ptr = getattr(dest, "exist")
#ptr = getattr(ptr, field_name)
#ptr.Set (1 if present else 0)
else: # single elements (all but SeqOf, Choice, Sequence)
row = root.row()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment