Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/rcommand/icommandsregister.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ICommandsRegister : MODULE_GLOBAL_INTERFACE
virtual void unreg(const IModuleCommandsRegisterPtr& module) = 0;
virtual IModuleCommandsRegisterPtr moduleRegister(const std::string& moduleName) const = 0;

virtual std::vector<CommandInfo> commandList() const = 0;
virtual std::vector<CommandInfo> commandInfoList() const = 0;

virtual const std::string& commandModuleName(const Command& command) const = 0;
};
Expand Down
1 change: 1 addition & 0 deletions framework/rcommand/internal/commanddispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ async::Promise<Response> CommandDispatcher::dispatch(const Request& request)
return async::make_promise<Response>([this, request](auto resolve) {
auto it = m_clients.find(Command(request.query.uri()));
if (it != m_clients.end()) {
LOGI() << "try call command query: " << request.query.toString();
Response response = it->second.callback(request);
return resolve(response);
} else {
Expand Down
2 changes: 1 addition & 1 deletion framework/rcommand/internal/commandsregister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ IModuleCommandsRegisterPtr CommandsRegister::moduleRegister(const std::string& m
return nullptr;
}

std::vector<CommandInfo> CommandsRegister::commandList() const
std::vector<CommandInfo> CommandsRegister::commandInfoList() const
{
std::vector<CommandInfo> commands;
for (const auto& module : m_modules) {
Expand Down
2 changes: 1 addition & 1 deletion framework/rcommand/internal/commandsregister.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CommandsRegister : public ICommandsRegister
void unreg(const IModuleCommandsRegisterPtr& module) override;
IModuleCommandsRegisterPtr moduleRegister(const std::string& moduleName) const override;

std::vector<CommandInfo> commandList() const override;
std::vector<CommandInfo> commandInfoList() const override;

const std::string& commandModuleName(const Command& command) const override;

Expand Down
2 changes: 1 addition & 1 deletion framework/rcommand/qml/Muse/RCommand/commandlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CommandListModel::CommandListModel(QObject* parent)

void CommandListModel::classBegin()
{
const std::vector<CommandInfo>& infos = commandsRegister()->commandList();
const std::vector<CommandInfo>& infos = commandsRegister()->commandInfoList();

beginResetModel();

Expand Down
2 changes: 1 addition & 1 deletion framework/rcontrol/mcp/mcpcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void McpController::deinit()
std::vector<Tool> McpController::makeToolsList() const
{
std::vector<Tool> tools;
auto commandList = commandsRegister()->commandList();
auto commandList = commandsRegister()->commandInfoList();
tools.reserve(commandList.size());
for (const auto& info : commandList) {
Tool tool;
Expand Down
3 changes: 3 additions & 0 deletions framework/shortcuts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ target_sources(muse_shortcuts PRIVATE
shortcutstypes.h
shortcutcontext.h
ishortcutsregister.h
icommandshortcutsregister.h
ishortcutscontroller.h
ishortcutsconfiguration.h

Expand All @@ -36,6 +37,8 @@ target_sources(muse_shortcuts PRIVATE

internal/shortcutsregister.cpp
internal/shortcutsregister.h
internal/commandshortcutsregister.cpp
internal/commandshortcutsregister.h
internal/shortcutscontroller.cpp
internal/shortcutscontroller.h
internal/shortcutsconfiguration.cpp
Expand Down
53 changes: 53 additions & 0 deletions framework/shortcuts/icommandshortcutsregister.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-CLA-applies
*
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2026 MuseScore Limited and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#pragma once

#include "modularity/imoduleinterface.h"
#include "shortcutstypes.h"
#include "async/notification.h"
#include "types/ret.h"
#include "io/path.h"

namespace muse::shortcuts {
class ICommandShortcutsRegister : MODULE_GLOBAL_INTERFACE
{
INTERFACE_ID(ICommandShortcutsRegister)
public:
virtual ~ICommandShortcutsRegister() = default;

virtual const ShortcutList& shortcuts() const = 0;
virtual Ret setShortcuts(const ShortcutList& shortcuts) = 0;
virtual void resetShortcuts() = 0;
virtual async::Notification shortcutsChanged() const = 0;

virtual Ret setAdditionalShortcuts(const std::string& context, const ShortcutList& shortcuts) = 0;

virtual ShortcutList shortcutsForSequence(const std::string& sequence) const = 0;

virtual Ret importFromFile(const io::path_t& filePath) = 0;
virtual Ret exportToFile(const io::path_t& filePath) const = 0;

// for testflow tests
virtual void reload(bool onlyDef = false) = 0;
};
}
Loading