Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move 'Stage/Unstage' menu item back to the top (where it should be!) #167

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions cola/widgets/status.py
Expand Up @@ -395,6 +395,13 @@ def _create_staged_context_menu(self, menu, s):
if s.staged[0] in self.m.submodules:
return self._create_staged_submodule_context_menu(menu, s)

if self.m.unstageable():
action = menu.addAction(qtutils.icon('remove.svg'),
N_('Unstage Selected'),
cmds.run(cmds.Unstage, self.staged()))
action.setShortcut(cmds.Unstage.SHORTCUT)
menu.addSeparator()

action = menu.addAction(qtutils.options_icon(),
cmds.LaunchEditor.name(),
cmds.run(cmds.LaunchEditor))
Expand All @@ -405,13 +412,6 @@ def _create_staged_context_menu(self, menu, s):
cmds.run(cmds.LaunchDifftool))
action.setShortcut(cmds.LaunchDifftool.SHORTCUT)

if self.m.unstageable():
menu.addSeparator()
action = menu.addAction(qtutils.icon('remove.svg'),
N_('Unstage Selected'),
cmds.run(cmds.Unstage, self.staged()))
action.setShortcut(cmds.Unstage.SHORTCUT)

if not utils.is_win32():
menu.addSeparator()
action = menu.addAction(qtutils.file_icon(),
Expand Down Expand Up @@ -491,6 +491,13 @@ def _create_unstaged_context_menu(self, menu, s):
if modified_submodule:
return self._create_modified_submodule_context_menu(menu, s)

if self.m.stageable():
action = menu.addAction(qtutils.icon('add.svg'),
N_('Stage Selected'),
cmds.run(cmds.Stage, self.unstaged()))
action.setShortcut(cmds.Stage.SHORTCUT)
menu.addSeparator()

if self.unstaged():
action = menu.addAction(qtutils.options_icon(),
cmds.LaunchEditor.name(),
Expand All @@ -503,13 +510,6 @@ def _create_unstaged_context_menu(self, menu, s):
cmds.run(cmds.LaunchDifftool))
action.setShortcut(cmds.LaunchDifftool.SHORTCUT)

if self.m.stageable():
menu.addSeparator()
action = menu.addAction(qtutils.icon('add.svg'),
N_('Stage Selected'),
cmds.run(cmds.Stage, self.unstaged()))
action.setShortcut(cmds.Stage.SHORTCUT)

if s.modified and self.m.stageable():
if self.m.undoable():
menu.addSeparator()
Expand Down