1 from PyQt4
.QtCore
import SIGNAL
4 from cola
import hotkeys
6 from cola
import qtutils
7 from cola
.i18n
import N_
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(widget
,
34 N_('Next File'), lambda: widget
.emit(SIGNAL('move_down()')),
35 hotkeys
.MOVE_DOWN_SECONDARY
)
39 return qtutils
.add_action(widget
,
40 N_('Previous File'), lambda: widget
.emit(SIGNAL('move_up()')),
41 hotkeys
.MOVE_UP_SECONDARY
)