Ryan Barry has uploaded a new change for review. Change subject: Add trigger_valid to plugins ......................................................................
Add trigger_valid to plugins Re-add the ability to trigger the validity of fields. Add a convenience function to drop invalid changes from a field, and one which triggers invalidity on fields which have not yet had entry. Change-Id: I9f82eb54564e8037b74b82817b0e864655400d02 Signed-off-by: Ryan Barry <[email protected]> --- M src/ovirt/node/plugins.py 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/14/27314/1 diff --git a/src/ovirt/node/plugins.py b/src/ovirt/node/plugins.py index cb8ae6f..fea02e2 100644 --- a/src/ovirt/node/plugins.py +++ b/src/ovirt/node/plugins.py @@ -211,6 +211,17 @@ self.__changes = Changeset() return is_valid + def trigger_valid(self, path, valid=True): + if path in self.__changes: + self.__changes.drop([path]) + else: + self.__invalid_changes.drop([path]) + self._on_ui_change({}) + + def trigger_invalid(self): + if not path in self.__changes or path in self.__invalid_changes: + self._on_ui_change({path: None}) + def __validate(self, changes): """Test changes against the validators -- To view, visit http://gerrit.ovirt.org/27314 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f82eb54564e8037b74b82817b0e864655400d02 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Ryan Barry <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
