Skip to content
Merged
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
6 changes: 0 additions & 6 deletions framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ if (MUSE_MODULE_RCONTROL)
add_subdirectory(rcontrol)
endif()

if (MUSE_MODULE_SHORTCUTS_V2)
file(CREATE_LINK ${CMAKE_CURRENT_LIST_DIR}/shortcuts_v2 ${PROJECT_BINARY_DIR}/shortcuts SYMBOLIC)
else()
file(REMOVE_RECURSE ${PROJECT_BINARY_DIR}/shortcuts)
endif()

if (MUSE_MODULE_SHORTCUTS)
if (MUSE_MODULE_SHORTCUTS_V2)
add_subdirectory(shortcuts_v2)
Expand Down
9 changes: 9 additions & 0 deletions framework/shortcuts/ishortcutsconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
* 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 "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/ishortcutsconfiguration.h"
#else

#pragma once

Expand All @@ -41,3 +48,5 @@ class IShortcutsConfiguration : MODULE_GLOBAL_INTERFACE
virtual io::path_t shortcutsAppDataPath() const = 0;
};
}

#endif // MUSE_MODULE_SHORTCUTS_V2
10 changes: 10 additions & 0 deletions framework/shortcuts/ishortcutscontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
* 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 "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/ishortcutscontroller.h"
#else

#ifndef MUSE_SHORTCUTS_ISHORTCUTSCONTROLLER_H
#define MUSE_SHORTCUTS_ISHORTCUTSCONTROLLER_H

Expand All @@ -41,3 +49,5 @@ class IShortcutsController : MODULE_CONTEXT_INTERFACE
}

#endif // MUSE_SHORTCUTS_ISHORTCUTSCONTROLLER_H

#endif // MUSE_MODULE_SHORTCUTS_V2
10 changes: 10 additions & 0 deletions framework/shortcuts/ishortcutsregister.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
*/
#pragma once

#include "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/ishortcutsregister.h"
#else

#pragma once

#include "modularity/imoduleinterface.h"
#include "shortcutstypes.h"
#include "async/notification.h"
Expand Down Expand Up @@ -58,3 +66,5 @@ class IShortcutsRegister : MODULE_CONTEXT_INTERFACE
virtual void reload(bool onlyDef = false) = 0;
};
}

#endif // MUSE_MODULE_SHORTCUTS_V2
10 changes: 10 additions & 0 deletions framework/shortcuts/shortcutcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
* 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 "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/shortcutcontext.h"
#else

#ifndef MUSE_SHORTCUTS_SHORTCUTCONTEXT_H
#define MUSE_SHORTCUTS_SHORTCUTCONTEXT_H

Expand Down Expand Up @@ -51,3 +59,5 @@ class IShortcutContextPriority : MODULE_CONTEXT_INTERFACE
}

#endif // MUSE_SHORTCUTS_SHORTCUTCONTEXT_H

#endif // MUSE_MODULE_SHORTCUTS_V2
9 changes: 9 additions & 0 deletions framework/shortcuts/shortcutsmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
* 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 "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/shortcutsmodule.h"
#else

#pragma once

Expand Down Expand Up @@ -60,3 +67,5 @@ class ShortcutsContext : public modularity::IContextSetup
std::shared_ptr<ShortcutsRegister> m_shortcutsRegister;
};
}

#endif // MUSE_MODULE_SHORTCUTS_V2
9 changes: 9 additions & 0 deletions framework/shortcuts/shortcutstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
* 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 "muse_framework_config.h"

#ifdef MUSE_MODULE_SHORTCUTS_V2
#include "../shortcuts_v2/shortcutstypes.h"
#else

#pragma once

Expand Down Expand Up @@ -137,3 +144,5 @@ inline bool areContextPrioritiesEqual(const std::string& shortcutCtx1, const std
return shortcutCtx1 == shortcutCtx2;
}
}

#endif // MUSE_MODULE_SHORTCUTS_V2
4 changes: 4 additions & 0 deletions framework/shortcuts_v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ target_link_libraries(muse_shortcuts PRIVATE Qt::Gui)
if (MUSE_MODULE_SHORTCUTS_QML)
add_subdirectory(qml/Muse/Shortcuts)
endif()

if (MUSE_MODULE_SHORTCUTS_TESTS)
add_subdirectory(tests)
endif()
14 changes: 14 additions & 0 deletions framework/shortcuts_v2/icommandshortcutsregister.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@

#pragma once

#include <string>
#include <vector>

#include "modularity/imoduleinterface.h"
#include "shortcutstypes.h"
#include "async/channel.h"
#include "async/notification.h"
#include "types/ret.h"
#include "io/path.h"
Expand All @@ -47,6 +51,16 @@ class ICommandShortcutsRegister : MODULE_GLOBAL_INTERFACE
virtual Ret importFromFile(const io::path_t& filePath) = 0;
virtual Ret exportToFile(const io::path_t& filePath) const = 0;

virtual std::vector<std::string> availablePresets() const = 0;

virtual std::string currentPresetName() const = 0;
virtual void setCurrentPresetName(const std::string& presetName) = 0;
virtual async::Channel<std::string> currentPresetNameChanged() const = 0;

virtual bool isPresetEdited(const std::string& presetName) const = 0;
virtual bool canDeletePreset(const std::string& presetName) const = 0;
virtual void deletePreset(const std::string& presetName) = 0;

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