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
4 changes: 3 additions & 1 deletion SetupConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if(BUILD_CONFIGURATION STREQUAL "APP-WEB")
endif()

set(MUSE_MODULE_UI_SYSTEMDRAG_SUPPORTED OFF)
set(MUSE_MODULE_UI_SYNCINTERACTIVE_SUPPORTED OFF)
set(MUSE_MODULE_INTERACTIVE_SYNC_SUPPORTED OFF)

set(MUE_GENERAL_APP ON)
set(MUSE_MODULE_SHORTCUTS ON)
Expand Down Expand Up @@ -208,6 +208,7 @@ if(BUILD_CONFIGURATION STREQUAL "VTEST")
set(MUSE_MODULE_DIAGNOSTICS OFF)
set(MUSE_MODULE_DOCKWINDOW OFF)
set(MUSE_MODULE_EXTENSIONS OFF)
set(MUSE_MODULE_INTERACTIVE OFF)
set(MUSE_MODULE_LANGUAGES OFF)
set(MUSE_MODULE_LEARN OFF)
set(MUSE_MODULE_MIDI OFF)
Expand Down Expand Up @@ -274,6 +275,7 @@ if(BUILD_CONFIGURATION STREQUAL "UTEST")
message(STATUS "If you added tests to a module that didn't have them yet, make sure that this module is enabled, see SetupConfigure.cmake")
set(MUSE_MODULE_AUTOBOT OFF)
set(MUSE_MODULE_CLOUD OFF)
set(MUSE_MODULE_INTERACTIVE OFF)
set(MUSE_MODULE_LANGUAGES OFF)
set(MUSE_MODULE_LEARN OFF)
set(MUSE_MODULE_MIDI OFF)
Expand Down
2 changes: 1 addition & 1 deletion sandbox/web_sandbox/interactivetestmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QEventLoop>

#include "global/modularity/ioc.h"
#include "global/iinteractive.h"
#include "interactive/iinteractive.h"

class InteractiveTestModel : public QObject
{
Expand Down
4 changes: 2 additions & 2 deletions sandbox/web_sandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "global/modularity/ioc.h"
#include "ui/iuiengine.h"
#include "ui/iinteractiveuriregister.h"
#include "interactive/iinteractiveuriregister.h"

#include "interactivetestmodel.h"

Expand Down Expand Up @@ -62,7 +62,7 @@ int main(int argc, char* argv[])
m->onAllInited(mode);
}

auto ir = muse::modularity::globalIoc()->resolve<muse::ui::IInteractiveUriRegister>("app");
auto ir = muse::modularity::globalIoc()->resolve<muse::interactive::IInteractiveUriRegister>("app");
if (ir) {
ir->registerQmlUri(Uri("muse://interactive/sample"), "MuseScore.AppShell", "SampleDialog");
}
Expand Down
1 change: 1 addition & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ add_to_link_if_exists(muse::cloud)
add_to_link_if_exists(muse::diagnostics)
add_to_link_if_exists(muse::dockwindow)
add_to_link_if_exists(muse::extensions)
add_to_link_if_exists(muse::interactive)
add_to_link_if_exists(muse::languages)
add_to_link_if_exists(muse::learn)
add_to_link_if_exists(muse::midi)
Expand Down
7 changes: 7 additions & 0 deletions src/app/appfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
#include "framework/stubs/extensions/extensionsstubmodule.h"
#endif

#ifdef MUSE_MODULE_INTERACTIVE
#include "framework/interactive/interactivemodule.h"
#endif

// Modules
#include "appshell/appshellmodule.h"

Expand Down Expand Up @@ -287,6 +291,9 @@ std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& opti
app->addModule(new muse::audioplugins::AudioPluginsModule());
#endif
app->addModule(new muse::draw::DrawModule());
#ifdef MUSE_MODULE_INTERACTIVE
app->addModule(new muse::interactive::InteractiveModule());
#endif
app->addModule(new muse::midi::MidiModule());
app->addModule(new muse::mpe::MpeModule());

Expand Down
5 changes: 2 additions & 3 deletions src/appshell/appshellmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "modularity/ioc.h"

#include "ui/iuiactionsregister.h"
#include "ui/iinteractiveuriregister.h"
#include "interactive/iinteractiveuriregister.h"

#include "internal/applicationuiactions.h"
#include "internal/applicationactioncontroller.h"
Expand All @@ -46,7 +46,6 @@
using namespace mu::appshell;
using namespace muse;
using namespace muse::modularity;
using namespace muse::ui;
using namespace muse::dock;

static const std::string mname("appshell");
Expand Down Expand Up @@ -74,7 +73,7 @@ void AppShellModule::registerExports()

void AppShellModule::resolveImports()
{
auto ir = ioc()->resolve<IInteractiveUriRegister>(moduleName());
auto ir = ioc()->resolve<interactive::IInteractiveUriRegister>(moduleName());
if (ir) {
ir->registerPageUri(Uri("musescore://home"));
ir->registerPageUri(Uri("musescore://notation"));
Expand Down
2 changes: 1 addition & 1 deletion src/appshell/internal/applicationactioncontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "async/asyncable.h"
#include "ui/imainwindow.h"
#include "languages/ilanguagesservice.h"
#include "iinteractive.h"
#include "interactive/iinteractive.h"
#include "iappshellconfiguration.h"
#include "multiwindows/imultiwindowsprovider.h"
#include "project/iprojectfilescontroller.h"
Expand Down
2 changes: 1 addition & 1 deletion src/appshell/internal/startupscenario.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "async/asyncable.h"

#include "modularity/ioc.h"
#include "iinteractive.h"
#include "interactive/iinteractive.h"
#include "actions/iactionsdispatcher.h"
#include "multiwindows/imultiwindowsprovider.h"
#include "iappshellconfiguration.h"
Expand Down
1 change: 1 addition & 0 deletions src/appshell/qml/MuseScore/AppShell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ qt_add_qml_module(appshell_qml
TARGET muse_dockwindow_qml
TARGET muse_diagnostics_qml
TARGET muse_extensions_qml
TARGET muse_interactive_qml
TARGET muse_learn_qml
TARGET muse_mpe_qml
TARGET muse_shortcuts_qml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import QtQuick

import Muse.Ui
import Muse.UiComponents
import Muse.Interactive

Rectangle {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "modularity/ioc.h"
#include "iappshellconfiguration.h"
#include "iinteractive.h"
#include "interactive/iinteractive.h"

namespace mu::appshell {
class FirstLaunchSetupModel : public QObject, public muse::Contextable, public muse::async::Asyncable
Expand Down
3 changes: 2 additions & 1 deletion src/appshell/qml/MuseScore/AppShell/WindowContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ pragma ComponentBehavior: Bound

import QtQuick

import Muse.Dock
import Muse.Interactive
import Muse.Ui
import Muse.UiComponents
import Muse.Dock
import MuseScore.AppShell

import "./HomePage"
Expand Down
72 changes: 39 additions & 33 deletions src/context/internal/uicontextresolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,53 +81,59 @@ UiContext UiContextResolver::resolveCurrentUiContext() const
{
TRACEFUNC;

Uri currentUri = interactive()->currentUri().val;
#ifdef MUSE_MODULE_INTERACTIVE
if (interactive()) {
Uri currentUri = interactive()->currentUri().val;

#ifdef MUSE_MODULE_DIAGNOSTICS
currentUri = diagnostics::diagnosticCurrentUri(interactive()->stack());
currentUri = diagnostics::diagnosticCurrentUri(interactive()->stack());
#endif

if (currentUri == HOME_PAGE_URI) {
return context::UiCtxHomeOpened;
}

if (currentUri == NOTATION_PAGE_URI) {
auto notation = globalContext()->currentNotation();
if (!notation) {
//! NOTE The notation page is open, but the notation itself is not loaded - we consider that the notation is not open.
//! We need to think, maybe we need a separate value for this case.
return context::UiCtxUnknown;
if (currentUri == HOME_PAGE_URI) {
return context::UiCtxHomeOpened;
}

INavigationPanel* activePanel = navigationController()->activePanel();
if (activePanel) {
const QString panelName = activePanel->name();
if (panelName == NOTATION_NAVIGATION_PANEL) {
return context::UiCtxProjectFocused;
} else if (panelName == BRAILLE_NAVIGATION_PANEL) {
return context::UiCtxBrailleFocused;
if (currentUri == NOTATION_PAGE_URI) {
auto notation = globalContext()->currentNotation();
if (!notation) {
//! NOTE The notation page is open, but the notation itself is not loaded - we consider that the notation is not open.
//! We need to think, maybe we need a separate value for this case.
return context::UiCtxUnknown;
}
}

return context::UiCtxProjectOpened;
}
INavigationPanel* activePanel = navigationController()->activePanel();
if (activePanel) {
const QString panelName = activePanel->name();
if (panelName == NOTATION_NAVIGATION_PANEL) {
return context::UiCtxProjectFocused;
} else if (panelName == BRAILLE_NAVIGATION_PANEL) {
return context::UiCtxBrailleFocused;
}
}

if (currentUri == PUBLISH_PAGE_URI) {
return context::UiCtxPublishOpened;
}
return context::UiCtxProjectOpened;
}

if (currentUri == DEVTOOLS_PAGE_URI) {
return context::UiCtxDevToolsOpened;
}
if (currentUri == PUBLISH_PAGE_URI) {
return context::UiCtxPublishOpened;
}

if (currentUri == DEVTOOLS_PAGE_URI) {
return context::UiCtxDevToolsOpened;
}

if (interactive()->isCurrentUriDialog().val) {
bool isExtensionDialog = currentUri == EXTENSIONS_DIALOG_URI;
if (!isExtensionDialog) {
return context::UiCtxDialogOpened;
if (interactive()->isCurrentUriDialog().val) {
bool isExtensionDialog = currentUri == EXTENSIONS_DIALOG_URI;
if (!isExtensionDialog) {
return context::UiCtxDialogOpened;
}
}

return context::UiCtxUnknown;
}
#endif

return context::UiCtxUnknown;
return globalContext()->currentNotation() ? context::UiCtxProjectOpened : context::UiCtxUnknown;
}

bool UiContextResolver::match(const muse::ui::UiContext& currentCtx, const muse::ui::UiContext& actCtx) const
Expand Down
2 changes: 1 addition & 1 deletion src/context/internal/uicontextresolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "../iuicontextresolver.h"
#include "async/asyncable.h"
#include "modularity/ioc.h"
#include "iinteractive.h"
#include "interactive/iinteractive.h"
#include "../iglobalcontext.h"
#include "ui/inavigationcontroller.h"

Expand Down
2 changes: 1 addition & 1 deletion src/converter/api/converterapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "global/async/asyncable.h"

#include "modularity/ioc.h"
#include "global/iinteractive.h"
#include "global/io/ifilesystem.h"
#include "interactive/iinteractive.h"
#include "../iconvertercontroller.h"

namespace mu::converter::api {
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/engravingmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#endif

#ifdef MUE_BUILD_ENGRAVING_DEVTOOLS
#include "ui/iinteractiveuriregister.h"
#include "interactive/iinteractiveuriregister.h"
#include "devtools/engravingelementsprovider.h"
#include "devtools/drawdata/diagnosticdrawprovider.h"
#endif
Expand Down Expand Up @@ -127,7 +127,7 @@ void EngravingModule::registerExports()
void EngravingModule::resolveImports()
{
#ifdef MUE_BUILD_ENGRAVING_DEVTOOLS
auto ir = ioc()->resolve<muse::ui::IInteractiveUriRegister>(moduleName());
auto ir = ioc()->resolve<muse::interactive::IInteractiveUriRegister>(moduleName());
if (ir) {
ir->registerQmlUri(Uri("musescore://diagnostics/engraving/elements"), "MuseScore.Engraving", "EngravingElementsDialog");
ir->registerQmlUri(Uri("musescore://diagnostics/engraving/undostack"), "MuseScore.Engraving", "EngravingUndoStackDialog");
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/infrastructure/messagebox.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "modularity/ioc.h"

#ifndef ENGRAVING_NO_INTERACTIVE
#include "iinteractive.h"
#include "interactive/iinteractive.h"
#endif

namespace mu::engraving {
Expand Down
8 changes: 3 additions & 5 deletions src/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ endif()
if (MUSE_MODULE_UI)
add_subdirectory(ui)
add_subdirectory(uicomponents)
endif()

if (MUSE_MODULE_UI_QML)
# This sub-part of the UI module depends on the `uicomponents` module,
# so needs to be declared after it.
add_subdirectory(ui/qml/Muse/Ui/Dialogs)
endif()
if (MUSE_MODULE_INTERACTIVE)
add_subdirectory(interactive)
endif()

if (MUSE_MODULE_DOCKWINDOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ QAccessibleInterface* AccessibilityController::parentIface(const IAccessible* it

if (it.item->accessibleRole() == IAccessible::Role::Application) {
if (!qApp->isQuitLockEnabled()) {
return QAccessible::queryAccessibleInterface(interactiveProvider()->topWindow());
return QAccessible::queryAccessibleInterface(interactive()->topWindow());
} else {
return QAccessible::queryAccessibleInterface(qApp->focusWindow());
}
Expand Down
18 changes: 8 additions & 10 deletions src/framework/accessibility/internal/accessibilitycontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MUSE_ACCESSIBILITY_ACCESSIBILITYCONTROLLER_H
#define MUSE_ACCESSIBILITY_ACCESSIBILITYCONTROLLER_H

#pragma once

#include <memory>
#include <QObject>
Expand All @@ -32,14 +32,14 @@
#include "global/async/channel.h"
#include "global/iapplication.h"

#include "framework/actions/iactionsdispatcher.h"
#include "modularity/ioc.h"
#include "ui/imainwindow.h"
#include "ui/iinteractiveprovider.h"
#include "ui/iuiactionsregister.h"
#include "../iaccessibilityconfiguration.h"
#include "../iaccessibilitycontroller.h"
#include "accessibleobject.h"
#include "actions/iactionsdispatcher.h"
#include "interactive/iinteractive.h"
#include "ui/imainwindow.h"
#include "ui/iuiactionsregister.h"

class QAccessibleInterface;
class QAccessibleEvent;
Expand All @@ -55,10 +55,10 @@ class AccessibilityController : public IAccessibilityController, public IAccessi
public:
GlobalInject<IAccessibilityConfiguration> configuration;
ContextInject<IApplication> application = { this };
ContextInject<actions::IActionsDispatcher> actionsDispatcher = { this };
ContextInject<IInteractive> interactive = { this };
ContextInject<ui::IMainWindow> mainWindow = { this };
ContextInject<ui::IInteractiveProvider> interactiveProvider = { this };
ContextInject<ui::IUiActionsRegister> actionsRegister = { this };
ContextInject<actions::IActionsDispatcher> actionsDispatcher = { this };

public:
AccessibilityController(const muse::modularity::ContextPtr& iocCtx);
Expand Down Expand Up @@ -190,5 +190,3 @@ class AccessibilityController : public IAccessibilityController, public IAccessi
bool m_needToVoicePanelInfo = false;
};
}

#endif // MUSE_ACCESSIBILITY_ACCESSIBILITYCONTROLLER_H
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ QWindow* AccessibleItemInterface::window() const
return window;
}

return interactiveProvider()->topWindow();
return interactive()->topWindow();
}

QRect AccessibleItemInterface::rect() const
Expand Down
Loading
Loading