def refresh_sensitivity(self): super(PropagationEditorPresenter, self).refresh_sensitivity() sensitive = True if utils.get_invalid_columns(self.model): sensitive = False model = None if self.model.prop_type == u'UnrootedCutting': model = self.model._cutting elif self.model.prop_type == u'Seed': model = self.model._seed if model: invalid = utils.get_invalid_columns(model, ['id', 'propagation_id']) # TODO: highlight the widget with are associated with the # columns that have bad values if invalid: sensitive = False elif self.model.notes: sensitive = True else: sensitive = False self.view.widgets.prop_ok_button.props.sensitive = sensitive
def refresh_sensitivity(self): super(PropagationEditorPresenter, self).refresh_sensitivity() sensitive = True if utils.get_invalid_columns(self.model): sensitive = False model = None if self.model.prop_type == u'UnrootedCutting': model = self.model._cutting elif self.model.prop_type == u'Seed': model = self.model._seed if model: invalid = utils.get_invalid_columns( model, ['id', 'propagation_id']) # TODO: highlight the widget with are associated with the # columns that have bad values if invalid: sensitive = False elif self.model.notes: sensitive = True else: sensitive = False self.view.widgets.prop_ok_button.props.sensitive = sensitive
def refresh_sensitivity(self): sensitive = False ignore = ('id') if self.is_dirty() and not \ utils.get_invalid_columns(self.model, ignore_columns=ignore): sensitive = True self.view.set_accept_buttons_sensitive(sensitive)
def refresh_sensitivity(self): sensitive = False ignore = ('id') if self.dirty() and not \ utils.get_invalid_columns(self.model, ignore_columns=ignore): sensitive = True self.view.set_accept_buttons_sensitive(sensitive)