def set_tab_label_texts(label, state_m, unsaved_changes=False): state_machine_id = state_m.state.get_state_machine().state_machine_id state_name = state_m.state.name state_name_trimmed = text_formatting.limit_string(state_name, STATE_NAME_MAX_CHARS) label_text = "{0} • {1}".format(state_machine_id, state_name_trimmed) tooltip_text = state_name if unsaved_changes: label_text += ' *' label.set_markup(label_text) label.set_tooltip_text(tooltip_text)
def set_tab_label_texts(label, state_machine_m, unsaved_changes=False): state_machine_id = state_machine_m.state_machine.state_machine_id root_state_name = state_machine_m.root_state.state.name root_state_name_trimmed = text_formatting.limit_string(root_state_name, ROOT_STATE_NAME_MAX_CHARS) state_machine_path = state_machine_m.state_machine.file_system_path or "[not yet saved]" label_text = "{0} • {1}".format(state_machine_id, root_state_name_trimmed) tooltip_text = root_state_name + "\n\nPath: " + state_machine_path if unsaved_changes: label_text += ' *' label.set_markup(label_text) label.set_tooltip_text(tooltip_text)