1 from __future__
import absolute_import
10 def cmd_action(widget
, cmd
, icon
, *shortcuts
):
11 action
= qtutils
.add_action(widget
, cmd
.name(), cmds
.run(cmd
), *shortcuts
)
16 def launch_editor(widget
, *shortcuts
):
17 icon
= icons
.configure()
18 return cmd_action(widget
, cmds
.LaunchEditor
, icon
, hotkeys
.EDIT
, *shortcuts
)
21 def launch_difftool(widget
):
23 return cmd_action(widget
, cmds
.LaunchDifftool
, icon
, hotkeys
.DIFF
)
26 def stage_or_unstage(widget
):
28 return cmd_action(widget
, cmds
.StageOrUnstage
, icon
,
29 hotkeys
.STAGE_SELECTION
)
32 def move_down(widget
):
33 return qtutils
.add_action(
34 widget
, N_('Next File'), widget
.down
.emit
,
35 hotkeys
.MOVE_DOWN_SECONDARY
)
39 return qtutils
.add_action(
40 widget
, N_('Previous File'), widget
.up
.emit
,
41 hotkeys
.MOVE_UP_SECONDARY
)