toolbar: add tooltips to the Reset actions
[git-cola.git] / cola / widgets / toolbarcmds.py
blobfafa7c2958c32a1a0dfaa59bd990b9c717aa7ac1
1 from __future__ import absolute_import, division, unicode_literals
3 from .. import cmds
4 from .. import guicmds
5 from ..widgets import archive
6 from ..widgets import browse
7 from ..widgets import compare
8 from ..widgets import createbranch
9 from ..widgets import createtag
10 from ..widgets import dag
11 from ..widgets import editremotes
12 from ..widgets import finder
13 from ..widgets import grep
14 from ..widgets import merge
15 from ..widgets import patch
16 from ..widgets import recent
17 from ..widgets import remote
18 from ..widgets import search
19 from ..widgets import stash
21 COMMANDS = {
22 'Others::LaunchEditor': {
23 'title': 'Launch Editor',
24 'action': cmds.run(cmds.LaunchEditor),
25 'icon': 'edit',
27 'Others::RevertUnstagedEdits': {
28 'title': 'Revert Unstaged Edits...',
29 'action': cmds.run(cmds.RevertUnstagedEdits),
30 'icon': 'undo',
32 'File::NewRepo': {
33 'title': 'New Repository...',
34 'action': guicmds.open_new_repo,
35 'icon': 'new',
37 'File::OpenRepo': {
38 'title': 'Open...',
39 'action': guicmds.open_repo,
40 'icon': 'folder',
42 'File::OpenRepoNewWindow': {
43 'title': 'Open in New Window...',
44 'action': guicmds.open_repo_in_new_window,
45 'icon': 'folder',
47 # 'File::CloneRepo': {
48 # 'title': 'Clone...',
49 # 'action': guicmds.spawn_clone,
50 # 'icon': 'repo'
51 # },
52 'File::Refresh': {
53 'title': 'Refresh...',
54 'action': cmds.run(cmds.Refresh),
55 'icon': 'sync',
57 'File::FindFiles': {
58 'title': 'Find Files',
59 'action': finder.finder,
60 'icon': 'zoom_in',
62 'File::EditRemotes': {
63 'title': 'Edit Remotes...',
64 'action': editremotes.editor,
65 'icon': None,
67 'File::RecentModified': {
68 'title': 'Recently Modified Files...',
69 'action': recent.browse_recent_files,
70 'icon': None,
72 'File::ApplyPatches': {
73 'title': 'Apply Patches...',
74 'action': patch.apply_patches,
75 'icon': None,
77 'File::ExportPatches': {
78 'title': 'Export Patches...',
79 'action': guicmds.export_patches,
80 'icon': None,
82 'File::SaveAsTarZip': {
83 'title': 'Save As Tarball/Zip...',
84 'action': archive.save_archive,
85 'icon': 'file_zip',
87 # 'File::Preferences': {
88 # 'title': 'Preferences',
89 # 'action': prefs.preferences,
90 # 'icon': 'configure'
91 # },
92 'Actions::Fetch': {'title': 'Fetch...', 'action': remote.fetch, 'icon': None},
93 'Actions::Pull': {'title': 'Pull...', 'action': remote.pull, 'icon': 'pull'},
94 'Actions::Push': {'title': 'Push...', 'action': remote.push, 'icon': 'push'},
95 'Actions::Stash': {'title': 'Stash...', 'action': stash.view, 'icon': None},
96 'Actions::CreateTag': {
97 'title': 'Create Tag...',
98 'action': createtag.create_tag,
99 'icon': 'tag',
101 'Actions::CherryPick': {
102 'title': 'Cherry-Pick...',
103 'action': guicmds.cherry_pick,
104 'icon': None,
106 'Actions::Merge': {
107 'title': 'Merge...',
108 'action': merge.local_merge,
109 'icon': 'merge',
111 'Actions::AbortMerge': {
112 'title': 'Abort Merge...',
113 'action': cmds.run(cmds.AbortMerge),
114 'icon': None,
116 'Actions::UpdateSubmodules': {
117 'title': 'Update All Submodules...',
118 'action': cmds.run(cmds.SubmodulesUpdate),
119 'icon': None,
121 'Actions::ResetSoft': {
122 'title': 'Reset Branch (Soft)',
123 'action': guicmds.reset_soft,
124 'icon': 'style_dialog_reset',
125 'tooltip': cmds.ResetSoft.tooltip('<commit>'),
127 'Actions::ResetMixed': {
128 'title': 'Reset Branch and Stage (Mixed)',
129 'action': guicmds.reset_mixed,
130 'icon': 'style_dialog_reset',
131 'tooltip': cmds.ResetMixed.tooltip('<commit>'),
133 'Actions::ResetKeep': {
134 'title': 'Restore Worktree and Reset All (Keep Unstaged Changes)',
135 'action': guicmds.reset_keep,
136 'icon': 'style_dialog_reset',
137 'tooltip': cmds.ResetKeep.tooltip('<commit>'),
139 'Actions::ResetHard': {
140 'title': 'Restore Worktre and Reset All (Hard)',
141 'action': guicmds.reset_hard,
142 'icon': 'style_dialog_reset',
143 'tooltip': cmds.ResetHard.tooltip('<commit>'),
145 'Actions::Grep': {
146 'title': 'Grep',
147 'action': grep.grep,
148 'icon': 'search',
150 'Actions::Search': {
151 'title': 'Search...',
152 'action': search.search,
153 'icon': 'search',
155 'Commit::Stage': {
156 'title': 'Stage',
157 'action': cmds.run(cmds.StageOrUnstage),
158 'icon': 'add',
160 'Commit::AmendLast': {
161 'title': 'Amend Last Commit',
162 'action': cmds.run(cmds.AmendMode),
163 'icon': 'edit',
165 'Commit::UndoLastCommit': {
166 'title': 'Undo Last Commit',
167 'action': cmds.run(cmds.UndoLastCommit),
168 'icon': 'style_dialog_discard',
170 'Commit::StageAll': {
171 'title': 'Stage All Untracked',
172 'action': cmds.run(cmds.StageUntracked),
174 'Commit::UnstageAll': {
175 'title': 'Unstage All',
176 'action': cmds.run(cmds.UnstageAll),
177 'icon': 'remove',
179 'Commit::Unstage': {
180 'title': 'Unstage',
181 'action': cmds.run(cmds.UnstageSelected),
182 'icon': 'remove',
184 'Commit::LoadCommitMessage': {
185 'title': 'Load Commit Message...',
186 'action': guicmds.load_commitmsg,
188 'Commit::GetCommitMessageTemplate': {
189 'title': 'Get Commit Message Template',
190 'action': cmds.run(cmds.LoadCommitMessageFromTemplate),
192 'Diff::Difftool': {
193 'title': 'Launch Diff tool',
194 'action': cmds.run(cmds.LaunchDifftool),
195 'icon': 'diff',
197 'Diff::Expression': {
198 'title': 'Expression...',
199 'action': guicmds.diff_expression,
200 'icon': None,
202 'Diff::Branches': {
203 'title': 'Branches...',
204 'action': compare.compare_branches,
205 'icon': None,
207 'Diff::Diffstat': {
208 'title': 'Diffstat',
209 'action': cmds.run(cmds.Diffstat),
210 'icon': None,
212 'Branch::Review': {
213 'title': 'Review...',
214 'action': guicmds.review_branch,
215 'icon': None,
217 'Branch::Create': {
218 'title': 'Create...',
219 'action': createbranch.create_new_branch,
220 'icon': None,
222 'Branch::Checkout': {
223 'title': 'Checkout...',
224 'action': guicmds.checkout_branch,
225 'icon': None,
227 'Branch::Delete': {
228 'title': 'Delete...',
229 'action': guicmds.delete_branch,
230 'icon': None,
232 'Branch::DeleteRemote': {
233 'title': 'Delete Remote Branch...',
234 'action': guicmds.delete_remote_branch,
235 'icon': None,
237 'Branch::Rename': {
238 'title': 'Rename Branch...',
239 'action': guicmds.rename_branch,
240 'icon': None,
242 'Branch::BrowseCurrent': {
243 'title': 'Browse Current Branch...',
244 'action': guicmds.browse_current,
245 'icon': None,
247 'Branch::BrowseOther': {
248 'title': 'Browse Other Branch...',
249 'action': guicmds.browse_other,
250 'icon': None,
252 'Branch::VisualizeCurrent': {
253 'title': 'Visualize Current Branch...',
254 'action': cmds.run(cmds.VisualizeCurrent),
255 'icon': None,
257 'Branch::VisualizeAll': {
258 'title': 'Visualize All Branches...',
259 'action': cmds.run(cmds.VisualizeAll),
260 'icon': None,
262 'View::FileBrowser': {
263 'title': 'File Browser...',
264 'action': browse.worktree_browser,
265 'icon': 'cola',
267 'View::DAG': {'title': 'DAG...', 'action': dag.git_dag, 'icon': 'cola'},
269 # 'Rebase::StartInteractive': {
270 # 'title': 'Start Interactive Rebase...',
271 # 'action': lambda: app().activeWindow().rebase_start(),
272 # 'icon': None
273 # },
274 # 'Rebase::Edit': {
275 # 'title': 'Edit...',
276 # 'action': lambda: cmds.rebase_edit_todo(),
277 # 'icon': None
278 # },
279 # 'Rebase::Continue': {
280 # 'title': 'Continue',
281 # 'action': lambda: cmds.rebase_continue(),
282 # 'icon': None
283 # },
284 # 'Rebase::SkipCurrentPatch': {
285 # 'title': 'Skip Current Patch',
286 # 'action': lambda: cmds.rebase_skip(),
287 # 'icon': None
288 # },
289 # 'Rebase::Abort': {
290 # 'title': 'Abort',
291 # 'action': lambda: cmds.rebase_abort(),
292 # 'icon': None