def before_notification_state_machine_observation_control( self, model, prop_name, info): """Check for multi-actions and set respective no update flags. """ overview = NotificationOverview(info) if not overview.caused_modification(): return # do not update while multi-actions self.check_info_on_no_update_flags(info)
def states_update_before(self, model, prop_name, info): overview = NotificationOverview(info) if not overview.caused_modification(): return if overview.get_affected_property() == 'state' and \ overview.get_cause() in ["change_state_type"]: changed_model = self._selected_sm_model.get_state_model_by_path( overview.get_method_args()[1].get_path()) self.observe_model(changed_model)
def check_no_update_flags_and_return_combined_flag(self, prop_name, info): # avoid updates because of execution status updates overview = NotificationOverview(info) if not overview.caused_modification(): return self.check_info_on_no_update_flags(info) # avoid updates while remove or multi-actions if self.no_update or self.no_update_state_destruction or self.no_update_self_or_parent_state_destruction: return True
def notify_state_name_change(self, model, prop_name, info): """Checks whether the name of a state was changed and change the tab label accordingly """ overview = NotificationOverview(info) # avoid updates or checks because of execution status updates if not overview.caused_modification(): return changed_model = overview.get_affected_model() method_name = overview.get_cause() if isinstance(changed_model, AbstractStateModel) and method_name in ['name', 'script_text']: self.update_tab_label(changed_model)
def states_update(self, model, prop_name, info): overview = NotificationOverview(info) if not overview.caused_modification(): return if overview.get_affected_property() == 'state' and \ overview.get_cause() in ["name"]: # , "add_state", "remove_state"]: self.update_tree_store_row(overview.get_affected_model()) # TODO check the work around for get_library_root_state -> maybe the notifications can be avoided if upper lib elif overview.get_affected_property() == 'state' and not overview.get_affected_model().state.get_next_upper_library_root_state() and \ overview.get_cause() in ["add_state", "remove_state"]: self.update(overview.get_affected_model())
def state_machine_model_after_change(self, model, prop_name, info): overview = NotificationOverview(info) if overview.caused_modification(): if not self.state_machine.marked_dirty: self.state_machine.marked_dirty = True