Пример #1
0
    def insert_show_library_content_in_menu(self, menu, shortcuts_dict, accel_group):

        selection = gui_singletons.state_machine_manager_model.get_selected_state_machine_model().selection
        selected_state_m = selection.get_selected_state()
        if len(selection.states) == 1 and isinstance(selected_state_m, LibraryStateModel):
            menu.append(create_check_menu_item("Show library content", selected_state_m.meta['gui']['show_content'],
                                               partial(self.on_toggle_show_library_content, state_m=selected_state_m)))
Пример #2
0
    def insert_is_start_state_in_menu(self, menu, shortcuts_dict, accel_group):

        selection = gui_singletons.state_machine_manager_model.get_selected_state_machine_model().selection
        selected_state_m = selection.get_selected_state()
        has_no_start_state_state_types = (BarrierConcurrencyState, PreemptiveConcurrencyState)
        if len(selection.states) == 1 and \
                not selected_state_m.state.is_root_state and \
                not isinstance(selected_state_m.parent.state, has_no_start_state_state_types):
            menu.append(create_check_menu_item("Is start state", selected_state_m.is_start, self.on_toggle_is_start_state,
                                               accel_code=shortcuts_dict['is_start_state'][0], accel_group=accel_group))