def _contextMenu(self) -> List[Any]: currentFlag = self.card and self.card.user_flag() opts = [ [ tr.studying_flag_card(), [[ flag.label, f"Ctrl+{flag.index}", self.set_flag_func(flag.index), dict(checked=currentFlag == flag.index), ] for flag in load_flags(self.mw.col)], ], [tr.studying_bury_card(), "-", self.bury_current_card], [tr.actions_set_due_date(), "Ctrl+Shift+D", self.on_set_due], [tr.actions_suspend_card(), "@", self.suspend_current_card], [tr.actions_options(), "O", self.onOptions], [tr.actions_card_info(), "I", self.on_card_info], None, [tr.studying_mark_note(), "*", self.toggle_mark_on_current_note], [tr.studying_bury_note(), "=", self.bury_current_note], [tr.studying_suspend_note(), "!", self.suspend_current_note], [ tr.studying_delete_note(), "Ctrl+Delete", self.delete_current_note ], None, [tr.actions_replay_audio(), "R", self.replayAudio], [tr.studying_pause_audio(), "5", self.on_pause_audio], [tr.studying_audio_5s(), "6", self.on_seek_backward], [tr.studying_audio_and5s(), "7", self.on_seek_forward], [tr.studying_record_own_voice(), "Shift+V", self.onRecordVoice], [tr.studying_replay_own_voice(), "V", self.onReplayRecorded], ] return opts
def set_due_date_dialog( *, parent: QWidget, card_ids: Sequence[CardId], config_key: Optional[Config.String.Key.V], ) -> Optional[CollectionOp[OpChanges]]: assert aqt.mw if not card_ids: return None default_text = (aqt.mw.col.get_config_string(config_key) if config_key is not None else "") prompt = "\n".join([ tr.scheduling_set_due_date_prompt(cards=len(card_ids)), tr.scheduling_set_due_date_prompt_hint(), ]) (days, success) = getText( prompt=prompt, parent=parent, default=default_text, title=tr.actions_set_due_date(), ) if not success or not days.strip(): return None else: return CollectionOp( parent, lambda col: col.sched.set_due_date( card_ids, days, config_key)).success(lambda _: tooltip( tr.scheduling_set_due_date_done(cards=len(card_ids)), parent=parent, ))
def _contextMenu(self) -> List[Any]: currentFlag = self.card and self.card.user_flag() opts = [ [ tr.studying_flag_card(), [ [ tr.actions_red_flag(), "Ctrl+1", lambda: self.set_flag_on_current_card(1), dict(checked=currentFlag == 1), ], [ tr.actions_orange_flag(), "Ctrl+2", lambda: self.set_flag_on_current_card(2), dict(checked=currentFlag == 2), ], [ tr.actions_green_flag(), "Ctrl+3", lambda: self.set_flag_on_current_card(3), dict(checked=currentFlag == 3), ], [ tr.actions_blue_flag(), "Ctrl+4", lambda: self.set_flag_on_current_card(4), dict(checked=currentFlag == 4), ], ], ], [tr.studying_mark_note(), "*", self.toggle_mark_on_current_note], [tr.studying_bury_card(), "-", self.bury_current_card], [tr.studying_bury_note(), "=", self.bury_current_note], [tr.actions_set_due_date(), "Ctrl+Shift+D", self.on_set_due], [tr.actions_suspend_card(), "@", self.suspend_current_card], [tr.studying_suspend_note(), "!", self.suspend_current_note], [ tr.studying_delete_note(), "Ctrl+Delete", self.delete_current_note ], [tr.actions_options(), "O", self.onOptions], None, [tr.actions_replay_audio(), "R", self.replayAudio], [tr.studying_pause_audio(), "5", self.on_pause_audio], [tr.studying_audio_5s(), "6", self.on_seek_backward], [tr.studying_audio_and5s(), "7", self.on_seek_forward], [tr.studying_record_own_voice(), "Shift+V", self.onRecordVoice], [tr.studying_replay_own_voice(), "V", self.onReplayRecorded], ] return opts