def show_all_shortcuts(force=False): mode = get_shortcut_mode() if not force and mode == "all": return set_shortcut_mode("all") add_entries(all_level_shortcuts) master_ui.helpWidget.show()
def show_confirm_shortcuts(): mode = get_shortcut_mode() if mode == "confirm": return set_shortcut_mode("confirm") add_entries(confirm_level_shortcuts) master_ui.helpWidget.show()
def show_info_shortcuts(): mode = get_shortcut_mode() if mode != "all": return set_shortcut_mode("info") add_entries(info_level_shortcuts) master_ui.helpWidget.show()
def show_new_note_shortcuts(): mode = get_shortcut_mode() if mode == "new_note" or mode == "all": return set_shortcut_mode("new_note") add_entries(new_note_level_shortcuts) master_ui.helpWidget.show()
def show_move_shortcuts(): mode = get_shortcut_mode() if mode == "move": return set_shortcut_mode("move") add_entries(move_level_shortcuts) master_ui.helpWidget.show()
def show_master_shortcuts(): mode = get_shortcut_mode() ui.setFocus() if mode != "top": return else: set_shortcut_mode("master") add_entries(master_level_shortcuts) master_ui.helpWidget.show()
def show_top_shortcuts(force=False): mode = get_shortcut_mode() ui.setFocus() if mode == "top": return elif mode == "new_note" and not force: add_entries(new_note_level_shortcuts) elif mode == "info" and not force: add_entries(info_level_shortcuts) elif mode == "all" and not force: add_entries(all_level_shortcuts) else: set_shortcut_mode("top") add_entries(top_level_shortcuts) master_ui.helpWidget.show()
def init_handler(ui_instance): global ui ui = ui_instance from src.reference.reference import set_shortcut_mode set_shortcut_mode("top")