Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #include "appshellcommandsregister.h"
24 :
25 : #include "../appshellcommands.h"
26 : #include "rcommand/commandtypes.h"
27 :
28 : using namespace muse;
29 : using namespace muse::rcommand;
30 : using namespace muse::ui;
31 : using namespace mu::appshell;
32 :
33 : static const std::vector<CommandInfo> s_commandInfos = {
34 : CommandInfo(
35 : APP_QUIT_COMMAND,
36 : TranslatableString("action", "Quit"),
37 : TranslatableString("action", "Quit"),
38 : InputSchema({
39 : { "all_instances", Arg(DataType::Bool, u"All instances (optional)") },
40 : { "installer_path", Arg(DataType::String, u"Installer path (optional)") } }),
41 : Decoration(),
42 : Availability::All
43 : ),
44 : CommandInfo(
45 : APP_RESTART_COMMAND,
46 : TranslatableString("action", "Restart"),
47 : TranslatableString("action", "Restart"),
48 : InputSchema(),
49 : Decoration(),
50 : Availability::All
51 : ),
52 : CommandInfo(
53 : APP_FULLSCREEN_COMMAND,
54 : TranslatableString("action", "&Full screen"),
55 : TranslatableString("action", "Full screen"),
56 : InputSchema(),
57 : Decoration(rcommand::Checkable::Yes),
58 : Availability::All
59 : ),
60 :
61 : CommandInfo(
62 : APP_ABOUT_MUSESCORE_COMMAND,
63 : TranslatableString("action", "&About MuseScore Studio…"),
64 : TranslatableString("action", "About MuseScore Studio"),
65 : InputSchema(),
66 : Decoration(),
67 : Availability::Dispatch
68 : ),
69 : CommandInfo(
70 : APP_ABOUT_QT_COMMAND,
71 : TranslatableString("action", "About &Qt…"),
72 : TranslatableString("action", "About Qt"),
73 : InputSchema(),
74 : Decoration(),
75 : Availability::Dispatch
76 : ),
77 : CommandInfo(
78 : APP_ABOUT_MUSICXML_COMMAND,
79 : TranslatableString("action", "About &MusicXML…"),
80 : TranslatableString("action", "About MusicXML"),
81 : InputSchema(),
82 : Decoration(),
83 : Availability::Dispatch
84 : ),
85 : CommandInfo(
86 : APP_ONLINE_HANDBOOK_COMMAND,
87 : TranslatableString("action", "Online &handbook"),
88 : TranslatableString("action", "Open online handbook"),
89 : InputSchema(),
90 : Decoration(),
91 : Availability::Dispatch
92 : ),
93 : CommandInfo(
94 : APP_ASK_HELP_COMMAND,
95 : TranslatableString("action", "As&k for help"),
96 : TranslatableString("action", "Ask for help"),
97 : InputSchema(),
98 : Decoration(),
99 : Availability::Dispatch
100 : ),
101 : CommandInfo(
102 : APP_ACCESSIBILITY_STATEMENT_COMMAND,
103 : TranslatableString("action", "Accessibility &statement"),
104 : TranslatableString("action", "Accessibility statement"),
105 : InputSchema(),
106 : Decoration(),
107 : Availability::Dispatch
108 : ),
109 : CommandInfo(
110 : APP_PREFERENCES_COMMAND,
111 : TranslatableString("action", "&Preferences…"),
112 : TranslatableString("action", "Preferences"),
113 : InputSchema(),
114 : Decoration(),
115 : Availability::All
116 : ),
117 : CommandInfo(
118 : APP_REVERT_TO_FACTORY_COMMAND,
119 : TranslatableString("action", "Revert to factory settings"),
120 : TranslatableString("action", "Revert to factory settings"),
121 : InputSchema(),
122 : Decoration(),
123 : Availability::Dispatch
124 : ),
125 : CommandInfo(
126 : APP_EXTENSIONS_COMMAND,
127 : TranslatableString("action", "Manage &extensions"),
128 : TranslatableString("action", "Manage extensions"),
129 : InputSchema(),
130 : Decoration(),
131 : Availability::All
132 : ),
133 :
134 : // docks commands
135 : CommandInfo(
136 : DOCK_TOGGLE_PLAYBACK_COMMAND,
137 : TranslatableString("action", "&Playback controls"),
138 : TranslatableString("action", "Show/hide playback controls"),
139 : InputSchema(),
140 : Decoration(rcommand::Checkable::Yes),
141 : Availability::All
142 : ),
143 : CommandInfo(
144 : DOCK_TOGGLE_NOTEINPUT_COMMAND,
145 : TranslatableString("action", "&Note input"),
146 : TranslatableString("action", "Show/hide note input toolbar"),
147 : InputSchema(),
148 : Decoration(rcommand::Checkable::Yes),
149 : Availability::All
150 : ),
151 : CommandInfo(
152 : DOCK_TOGGLE_PALETTES_COMMAND,
153 : TranslatableString("action", "&Palettes"),
154 : TranslatableString("action", "Show/hide palettes"),
155 : InputSchema(),
156 : Decoration(rcommand::Checkable::Yes),
157 : Availability::All
158 : ),
159 : CommandInfo(
160 : DOCK_TOGGLE_INSTRUMENTS_COMMAND,
161 : TranslatableString("action", "&Layout"),
162 : TranslatableString("action", "Show/hide layout panel"),
163 : InputSchema(),
164 : Decoration(rcommand::Checkable::Yes),
165 : Availability::All
166 : ),
167 : CommandInfo(
168 : DOCK_TOGGLE_PROPERTIES_COMMAND,
169 : TranslatableString("action", "Propert&ies"),
170 : TranslatableString("action", "Show/hide properties"),
171 : InputSchema(),
172 : Decoration(rcommand::Checkable::Yes),
173 : Availability::All
174 : ),
175 : CommandInfo(
176 : DOCK_TOGGLE_SELECTION_FILTER_COMMAND,
177 : TranslatableString("action", "S&election filter"),
178 : TranslatableString("action", "Show/hide selection filter"),
179 : InputSchema(),
180 : Decoration(rcommand::Checkable::Yes),
181 : Availability::All
182 : ),
183 : CommandInfo(
184 : DOCK_TOGGLE_UNDO_HISTORY_COMMAND,
185 : TranslatableString("action", "&History"),
186 : TranslatableString("action", "Show/hide undo history"),
187 : InputSchema(),
188 : Decoration(rcommand::Checkable::Yes),
189 : Availability::All
190 : ),
191 : CommandInfo(
192 : DOCK_TOGGLE_NAVIGATOR_COMMAND,
193 : TranslatableString("action", "&Navigator"),
194 : TranslatableString("action", "Show/hide navigator"),
195 : InputSchema(),
196 : Decoration(rcommand::Checkable::Yes),
197 : Availability::All
198 : ),
199 : CommandInfo(
200 : DOCK_TOGGLE_BRAILLE_COMMAND,
201 : TranslatableString("action", "&Braille"),
202 : TranslatableString("action", "Show/hide braille panel"),
203 : InputSchema(),
204 : Decoration(rcommand::Checkable::Yes),
205 : Availability::All
206 : ),
207 : CommandInfo(
208 : DOCK_TOGGLE_TIMELINE_COMMAND,
209 : TranslatableString("action", "Tim&eline"),
210 : TranslatableString("action", "Show/hide timeline"),
211 : InputSchema(),
212 : Decoration(rcommand::Checkable::Yes),
213 : Availability::All
214 : ),
215 : CommandInfo(
216 : DOCK_TOGGLE_MIXER_COMMAND,
217 : TranslatableString("action", "Mixer"),
218 : TranslatableString("action", "Show/hide mixer"),
219 : InputSchema(),
220 : Decoration(IconCode::Code::MIXER, rcommand::Checkable::Yes),
221 : Availability::All
222 : ),
223 : CommandInfo(
224 : DOCK_TOGGLE_PIANO_KEYBOARD_COMMAND,
225 : TranslatableString("action", "Piano &keyboard"),
226 : TranslatableString("action", "Show/hide piano keyboard"),
227 : InputSchema(),
228 : Decoration(rcommand::Checkable::Yes),
229 : Availability::All
230 : ),
231 : CommandInfo(
232 : DOCK_TOGGLE_PERCUSSION_COMMAND,
233 : TranslatableString("action", "Percussion"),
234 : TranslatableString("action", "Show/hide percussion panel"),
235 : InputSchema(),
236 : Decoration(rcommand::Checkable::Yes),
237 : Availability::All
238 : ),
239 : CommandInfo(
240 : DOCK_TOGGLE_STATUSBAR_COMMAND,
241 : TranslatableString("action", "&Status bar"),
242 : TranslatableString("action", "Show/hide status bar"),
243 : InputSchema(),
244 : Decoration(rcommand::Checkable::Yes),
245 : Availability::All
246 : ),
247 : };
248 :
249 0 : std::string AppshellCommandsRegister::moduleName() const
250 : {
251 0 : return "appshell";
252 : }
253 :
254 0 : const std::vector<muse::rcommand::Command>& AppshellCommandsRegister::commandList() const
255 : {
256 0 : static std::vector<muse::rcommand::Command> commands;
257 0 : if (commands.empty()) {
258 0 : commands.reserve(s_commandInfos.size());
259 0 : for (const auto& info : s_commandInfos) {
260 0 : commands.push_back(info.command);
261 : }
262 : }
263 0 : return commands;
264 : }
265 :
266 0 : const std::vector<CommandInfo>& AppshellCommandsRegister::commandInfoList() const
267 : {
268 0 : return s_commandInfos;
269 : }
|