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
2 changes: 1 addition & 1 deletion src/appshell/qml/DevTools/Interactive/InteractiveTests.qml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Rectangle {
text: "[qml] Sample dialog sync"
onClicked: {
console.log("qml: before open")
api.launcher.open("muse://devtools/interactive/sample?sync=true&color=#EF8605")
api.launcher.openSync("muse://devtools/interactive/sample?color=#EF8605")
console.log("qml: after open")
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/framework/autobot/internal/autobotactionscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

using namespace muse::autobot;

static const muse::UriQuery SHOW_BATCHTESTS_URI("muse://diagnostics/autobot/batchtests?sync=false&modal=false&floating=true");
static const muse::UriQuery SHOW_SCRIPTS_URI("muse://diagnostics/autobot/scripts?sync=false&modal=false&floating=true");
static const muse::UriQuery SHOW_BATCHTESTS_URI("muse://diagnostics/autobot/batchtests?modal=false&floating=true");
static const muse::UriQuery SHOW_SCRIPTS_URI("muse://diagnostics/autobot/scripts?modal=false&floating=true");

void AutobotActionsController::init()
{
Expand Down
2 changes: 1 addition & 1 deletion src/framework/autobot/internal/autobotinteractive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ io::path_t AutobotInteractive::selectSavingFileSync(const std::string& title, co
}

LOGD() << title << " dir:" << dir << ", filter: " << filterList << ", confirmOverwrite: " << confirmOverwrite;
m_real->openSync("muse://autobot/selectfile?sync=true&filePath=" + dir.toStdString());
m_real->openSync("muse://autobot/selectfile?filePath=" + dir.toStdString());
m_selectedFilePath = dir;
return m_selectedFilePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ using namespace muse;
using namespace muse::accessibility;
using namespace muse::actions;

static const muse::UriQuery SYSTEM_PATHS_URI("muse://diagnostics/system/paths?sync=false&modal=false&floating=true");
static const muse::UriQuery GRAPHICSINFO_URI("muse://diagnostics/system/graphicsinfo?sync=false&modal=false&floating=true");
static const muse::UriQuery PROFILER_URI("muse://diagnostics/system/profiler?sync=false&modal=false&floating=true");
static const muse::UriQuery NAVIGATION_TREE_URI("muse://diagnostics/navigation/tree?sync=false&modal=false&floating=true");
static const muse::UriQuery ACCESSIBLE_TREE_URI("muse://diagnostics/accessible/tree?sync=false&modal=false&floating=true");
static const muse::UriQuery ENGRAVING_ELEMENTS_URI("musescore://diagnostics/engraving/elements?sync=false&modal=false&floating=true");
static const muse::UriQuery ACTIONS_LIST_URI("muse://diagnostics/actions/list?sync=false&modal=false&floating=true");
static const muse::UriQuery SYSTEM_PATHS_URI("muse://diagnostics/system/paths?modal=false&floating=true");
static const muse::UriQuery GRAPHICSINFO_URI("muse://diagnostics/system/graphicsinfo?modal=false&floating=true");
static const muse::UriQuery PROFILER_URI("muse://diagnostics/system/profiler?modal=false&floating=true");
static const muse::UriQuery NAVIGATION_TREE_URI("muse://diagnostics/navigation/tree?modal=false&floating=true");
static const muse::UriQuery ACCESSIBLE_TREE_URI("muse://diagnostics/accessible/tree?modal=false&floating=true");
static const muse::UriQuery ENGRAVING_ELEMENTS_URI("musescore://diagnostics/engraving/elements?modal=false&floating=true");
static const muse::UriQuery ACTIONS_LIST_URI("muse://diagnostics/actions/list?modal=false&floating=true");

void DiagnosticsActionsController::init()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

using namespace muse::extensions;

static const muse::UriQuery SHOW_APIDUMP_URI("muse://extensions/apidump?sync=false&modal=false&floating=true");
static const muse::UriQuery SHOW_APIDUMP_URI("muse://extensions/apidump?modal=false&floating=true");

void ExtensionsActionController::init()
{
Expand Down
7 changes: 1 addition & 6 deletions src/framework/global/internal/interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,7 @@ bool Interactive::isSelectColorOpened() const

RetVal<Val> Interactive::openSync(const UriQuery& uri)
{
UriQuery newQuery = uri;
if (!newQuery.contains("sync")) {
newQuery.addParam("sync", Val(true));
}

return provider()->openSync(newQuery);
return provider()->openSync(uri);
}

async::Promise<Val> Interactive::open(const UriQuery& uri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace muse::mi;
using namespace muse::ipc;
using namespace muse::actions;

static const muse::UriQuery DEV_SHOW_INFO_URI("muse://devtools/multiinstances/info?sync=false&modal=false");
static const muse::UriQuery DEV_SHOW_INFO_URI("muse://devtools/multiinstances/info?modal=false");
static const QString METHOD_PROJECT_IS_OPENED("PROJECT_IS_OPENED");
static const QString METHOD_ACTIVATE_WINDOW_WITH_PROJECT("ACTIVATE_WINDOW_WITH_PROJECT");
static const QString METHOD_IS_WITHOUT_PROJECT("IS_WITHOUT_PROJECT");
Expand Down
13 changes: 9 additions & 4 deletions src/framework/ui/dev/interactivetestsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void InteractiveTestsModel::openSampleDialogSync()
void InteractiveTestsModel::openSampleDialogAsync()
{
LOGI() << "cpp: before open ";
interactive()->open("muse://devtools/interactive/sample?sync=false&color=#D24373");
interactive()->open("muse://devtools/interactive/sample?color=#D24373");
LOGI() << "cpp: after open";
}

Expand All @@ -125,7 +125,7 @@ void InteractiveTestsModel::openSampleDialogAsyncWithPromise()
promise.onResolve(this, [](const Val& val) {
LOGI() << "success val: " << val.toString();
}).onReject(this, [](int code, const std::string& err) {
LOGE() << "faile or cancel code: " << code << ", err: " << err;
LOGE() << "error or cancel code: " << code << ", err: " << err;
});
}

Expand All @@ -139,8 +139,13 @@ void InteractiveTestsModel::openWidgetDialog()
void InteractiveTestsModel::openWidgetDialogAsync()
{
LOGI() << "cpp: before open ";
RetVal<Val> rv = interactive()->openSync("muse://devtools/interactive/testdialog?sync=false&title='And from its properties'");
LOGI() << "cpp: after open ret: " << rv.ret.toString() << ", val: " << rv.val.toString();
auto promise = interactive()->open("muse://devtools/interactive/testdialog?title='And from its properties'");
LOGI() << "cpp: after open";
promise.onResolve(this, [](const Val& val) {
LOGI() << "success val: " << val.toString();
}).onReject(this, [](int code, const std::string& err) {
LOGE() << "error or cancel code: " << code << ", err: " << err;
});
}

void InteractiveTestsModel::closeWidgetDialog()
Expand Down
2 changes: 1 addition & 1 deletion src/framework/ui/internal/navigationcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

using namespace muse::ui;

static const muse::UriQuery DEV_SHOW_CONTROLS_URI("muse://devtools/keynav/controls?sync=false&modal=false");
static const muse::UriQuery DEV_SHOW_CONTROLS_URI("muse://devtools/keynav/controls?modal=false");

using MoveDirection = NavigationController::MoveDirection;
using Event = INavigation::Event;
Expand Down
9 changes: 1 addition & 8 deletions src/framework/ui/view/interactiveprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bool InteractiveProvider::isSelectColorOpened() const
return m_isSelectColorOpened;
}

RetVal<Val> InteractiveProvider::openSync(const UriQuery& q_)
RetVal<Val> InteractiveProvider::openSync(const UriQuery& q)
{
#ifndef MUSE_MODULE_UI_SYNCINTERACTIVE_SUPPORTED
NOT_SUPPORTED;
Expand All @@ -141,11 +141,6 @@ RetVal<Val> InteractiveProvider::openSync(const UriQuery& q_)
}
#endif

UriQuery q = q_;

//! NOTE Disable Dialog.exec()
q.set("sync", false);

RetVal<Val> rv;
QEventLoop loop;
Promise<Val>::Resolve resolve;
Expand Down Expand Up @@ -375,7 +370,6 @@ void InteractiveProvider::fillExtData(QmlLaunchData* data, const UriQuery& q, co
}

data->setValue("uri", QString::fromStdString(VIEWER_URI.toString()));
data->setValue("sync", params.value("sync", false));
data->setValue("params", params);
}

Expand All @@ -386,7 +380,6 @@ void InteractiveProvider::fillData(QmlLaunchData* data, const Uri& uri, const QV
data->setValue("type", meta.type);
data->setValue("uri", QString::fromStdString(uri.toString()));
data->setValue("params", params);
data->setValue("sync", params.value("sync", false));
data->setValue("modal", params.value("modal", ""));
}

Expand Down
5 changes: 5 additions & 0 deletions src/framework/ui/view/qmllauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ bool QmlLauncher::open(const QString& uri)
return true;
}

bool QmlLauncher::openSync(const QString& uri)
{
return interactive()->openSync(UriQuery(uri.toStdString())).ret;
}

bool QmlLauncher::openApp(const QString& uri)
{
interactive()->openApp(UriQuery(uri.toStdString()));
Expand Down
1 change: 1 addition & 0 deletions src/framework/ui/view/qmllauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class QmlLauncher : public QObject, public Injectable
QmlLauncher(QObject* parent, const modularity::ContextPtr& iocCtx);

Q_INVOKABLE bool open(const QString& uri);
Q_INVOKABLE bool openSync(const QString& uri);
Q_INVOKABLE bool openApp(const QString& uri);
Q_INVOKABLE bool openUrl(const QString& url);
};
Expand Down
2 changes: 1 addition & 1 deletion src/framework/vst/internal/vstactionscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using namespace muse;
using namespace muse::vst;

static const char16_t* VST_EDITOR_URI = u"muse://vst/editor?instanceId=%1&sync=false&modal=false&floating=true";
static const char16_t* VST_EDITOR_URI = u"muse://vst/editor?instanceId=%1&modal=false&floating=true";

void VstActionsController::init()
{
Expand Down
2 changes: 1 addition & 1 deletion src/framework/workspace/internal/workspacemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void WorkspaceManager::openConfigureWorkspacesDialog()
{
prepareCurrentWorkspaceForChange();

RetVal<Val> result = interactive()->openSync("muse://workspace/select?sync=true");
RetVal<Val> result = interactive()->openSync("muse://workspace/select");
if (!result.ret) {
return;
}
Expand Down
10 changes: 5 additions & 5 deletions src/notation/internal/notationactioncontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2140,29 +2140,29 @@ bool NotationActionController::isNotNoteInputMode() const

void NotationActionController::openTupletOtherDialog()
{
interactive()->open("musescore://notation/othertupletdialog?sync=false");
interactive()->open("musescore://notation/othertupletdialog");
}

void NotationActionController::openStaffTextPropertiesDialog()
{
interactive()->open("musescore://notation/stafftextproperties?sync=false");
interactive()->open("musescore://notation/stafftextproperties");
}

void NotationActionController::openMeasurePropertiesDialog()
{
if (currentNotationInteraction()->selectedMeasure() != nullptr) {
interactive()->open("musescore://notation/measureproperties?sync=false");
interactive()->open("musescore://notation/measureproperties");
}
}

void NotationActionController::openEditGridSizeDialog()
{
interactive()->open("musescore://notation/editgridsize?sync=false");
interactive()->open("musescore://notation/editgridsize");
}

void NotationActionController::openRealizeChordSymbolsDialog()
{
interactive()->open("musescore://notation/realizechordsymbols?sync=false");
interactive()->open("musescore://notation/realizechordsymbols");
}

void NotationActionController::toggleScoreConfig(ScoreConfigType configType)
Expand Down
2 changes: 1 addition & 1 deletion src/notation/utilities/percussionutilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool PercussionUtilities::editPercussionShortcut(Drumset& drumset, int originPit

muse::RetVal<muse::Val> PercussionUtilities::openPercussionShortcutDialog(const Drumset& drumset, int originPitch)
{
muse::UriQuery query("musescore://notation/editpercussionshortcut?sync=true&modal=true");
muse::UriQuery query("musescore://notation/editpercussionshortcut?modal=true");

const mu::engraving::DrumInstrument& originDrum = drumset.drum(originPitch);
query.addParam("originDrum", muse::Val::fromQVariant(drumToQVariantMap(originPitch, originDrum)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ muse::RetVal<muse::Val> PercussionPanelPadListModel::openPadSwapDialog()
{
const bool moveMidiNotesAndShortcuts = configuration()->percussionPanelMoveMidiNotesAndShortcuts();

muse::UriQuery query("musescore://notation/percussionpanelpadswap?sync=true&modal=true");
muse::UriQuery query("musescore://notation/percussionpanelpadswap?modal=true");
query.addParam("moveMidiNotesAndShortcuts", muse::Val(moveMidiNotesAndShortcuts));
muse::RetVal<muse::Val> rv = interactive()->openSync(query);

Expand Down
2 changes: 1 addition & 1 deletion src/palette/internal/paletteactionscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using namespace muse::ui;
using namespace muse::actions;

static const muse::UriQuery MASTER_PALETTE_URI("musescore://palette/masterpalette?modal=false");
static const muse::UriQuery SPECIAL_CHARACTERS_URI("musescore://palette/specialcharacters?sync=false");
static const muse::UriQuery SPECIAL_CHARACTERS_URI("musescore://palette/specialcharacters?modal=false");
static const muse::UriQuery TIME_SIGNATURE_PROPERTIES_URI("musescore://palette/timesignatureproperties");
static const muse::UriQuery CUSTOMIZE_KIT_URI("musescore://palette/customizekit");

Expand Down
4 changes: 2 additions & 2 deletions src/palette/internal/paletteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void UserPaletteController::editPaletteProperties(const QModelIndex& index)
properties["showGrid"] = palette->drawGrid();

QJsonDocument document = QJsonDocument::fromVariant(properties);
QString uri = QString("musescore://palette/properties?sync=true&properties=%1")
QString uri = QString("musescore://palette/properties?properties=%1")
.arg(QString(document.toJson()));

interactive()->open(uri.toStdString());
Expand Down Expand Up @@ -569,7 +569,7 @@ void UserPaletteController::editCellProperties(const QModelIndex& index)
properties["drawStaff"] = cell->drawStaff;

QJsonDocument document = QJsonDocument::fromVariant(properties);
QString uri = QString("musescore://palette/cellproperties?sync=true&properties=%1")
QString uri = QString("musescore://palette/cellproperties?properties=%1")
.arg(QString(document.toJson()));

interactive()->open(uri.toStdString());
Expand Down
Loading