Commit cd65597
authored
Added support for multiple hotkeys per action (#490)
* Moved ActionsShortcutsManager into the nc::core namespace; DI'ing its Config depenency; Removed the 4 title placeholders in the main menu.
* NSEventModifierFlagsHolder can be used from a clean C++
* Started laying out unit tests for ActionsShortcutsManager
* Added a few more simple unit tests
* clang-tidy
* Allow constructing ActionShortcut out of EventData. Replaced IsKeyDown() with operator==().
* TagFromAction now returns std::optional, instead of relying on magic values to indicate errors
* Removed the IF_MENU_TAG macro
* ActionFromTag returns std::optional<std::string_view>, instead of encoding an error as an empty string
* clang-tidy
* ShortCutFromAction, ShortCutFromTag and DefaultShortCutFromTag return a std::optional instead of using the default state to convey errors
* Added ActionTagsFromShortCut() and FirstOfActionTagsFromShortCut() that provide action(s) for a given shortcut
* Removed ShortCutsUpdater, migrated client code to FirstOfActionTagsFromShortCut()
* clang-tidy
* Refactoring ActionShortcutsManager's API and internals to support multiple shortcuts per action
* ShortCut -> Shortcut
* ShortcutFromAction -> ShortcutsFromAction, ShortcutFromTag -> ShortcutsFromTag, DefaultShortcutFromTag -> DefaultShortcutsFromTag
* Support for writing and reading multiple shortcuts per action
* clang-tidy
* Adding support for multiple shortcuts per action in the Settings dialog
* Filtering out duplicate shortcuts per action
* clang-tidy
* Menu actions can be triggered via additional shortcuts as well
* Extracted SetMenuShortcuts() into an NSMenu category.
* Extracted part of ActionsShortcutsManager as a pure interface in nc::utility, DI'ed it into Viewer.
* Updated the localization1 parent 2d414fb commit cd65597
31 files changed
Lines changed: 1496 additions & 553 deletions
File tree
- Source
- NimbleCommander
- NimbleCommander.xcodeproj
- NimbleCommander
- Bootstrap
- Base.lproj
- ru.lproj
- Core
- Preferences
- Base.lproj
- ru.lproj
- States
- FilePanels
- Views
- InternalViewer
- Terminal
- Tests
- Utility
- Utility.xcodeproj
- include/Utility
- source
- tests
- Viewer
- include/Viewer
- source
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
951 | 952 | | |
952 | 953 | | |
953 | 954 | | |
| 955 | + | |
954 | 956 | | |
955 | 957 | | |
956 | 958 | | |
| |||
1698 | 1700 | | |
1699 | 1701 | | |
1700 | 1702 | | |
| 1703 | + | |
1701 | 1704 | | |
1702 | 1705 | | |
1703 | 1706 | | |
1704 | 1707 | | |
1705 | | - | |
1706 | 1708 | | |
| 1709 | + | |
1707 | 1710 | | |
1708 | 1711 | | |
1709 | 1712 | | |
| |||
3199 | 3202 | | |
3200 | 3203 | | |
3201 | 3204 | | |
| 3205 | + | |
3202 | 3206 | | |
3203 | 3207 | | |
3204 | 3208 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
| 25 | + | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
Lines changed: 13 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 141 | | |
159 | 142 | | |
160 | 143 | | |
| |||
299 | 282 | | |
300 | 283 | | |
301 | 284 | | |
302 | | - | |
303 | | - | |
| 285 | + | |
304 | 286 | | |
305 | 287 | | |
306 | 288 | | |
| |||
318 | 300 | | |
319 | 301 | | |
320 | 302 | | |
321 | | - | |
322 | | - | |
323 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
324 | 308 | | |
325 | 309 | | |
326 | 310 | | |
| |||
371 | 355 | | |
372 | 356 | | |
373 | 357 | | |
374 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
375 | 361 | | |
376 | 362 | | |
377 | 363 | | |
| |||
408 | 394 | | |
409 | 395 | | |
410 | 396 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | 397 | | |
419 | 398 | | |
420 | 399 | | |
| |||
649 | 628 | | |
650 | 629 | | |
651 | 630 | | |
652 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
653 | 634 | | |
654 | | - | |
655 | | - | |
| 635 | + | |
656 | 636 | | |
657 | 637 | | |
658 | 638 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| |||
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
| 358 | + | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
0 commit comments