Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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