Skip to content

Commit 92b6037

Browse files
committed
Update visualeditor plugin
1 parent c75bca4 commit 92b6037

File tree

15 files changed

+126
-87
lines changed

15 files changed

+126
-87
lines changed

src/plugins/coreplugin/internal/CorePlugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ namespace Core::Internal {
339339
addIcon("org.diffscope.core.panel.properties", "TextBulletListSquareEdit20Filled");
340340
addIcon("org.diffscope.core.panel.metadata", "TextBulletListSquareEdit20Filled");
341341
addIcon("org.diffscope.core.panel.plugins", "PuzzlePiece16Filled");
342-
addIcon("org.diffscope.core.panel.arrangement", "GanttChart16Filled");
343-
addIcon("org.diffscope.core.panel.mixer", "OptionsVertical16Filled");
344-
addIcon("org.diffscope.core.panel.pianoRoll", "Midi20Filled");
342+
// addIcon("org.diffscope.core.panel.arrangement", "GanttChart16Filled");
343+
// addIcon("org.diffscope.core.panel.mixer", "OptionsVertical16Filled");
344+
// addIcon("org.diffscope.core.panel.pianoRoll", "Midi20Filled");
345345
addIcon("org.diffscope.core.panel.notifications", "Alert16Filled");
346346
addIcon("org.diffscope.core.panel.tips", "ChatSparkle16Filled");
347347
addIcon("org.diffscope.core.timeline.goToStart", "Previous16Filled");

src/plugins/coreplugin/internal/addon/WorkspaceAddOn.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ namespace Core::Internal {
5252
windowInterface->actionContext()->addAction("org.diffscope.core.panel.properties", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "PropertiesPanel", this));
5353
windowInterface->actionContext()->addAction("org.diffscope.core.panel.plugins", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "PluginsPanel", this));
5454
windowInterface->actionContext()->addAction("org.diffscope.core.panel.tips", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "TipsPanel", this));
55-
windowInterface->actionContext()->addAction("org.diffscope.core.panel.arrangement", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "ArrangementPanel", this));
56-
windowInterface->actionContext()->addAction("org.diffscope.core.panel.mixer", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "MixerPanel", this));
57-
windowInterface->actionContext()->addAction("org.diffscope.core.panel.pianoRoll", new QQmlComponent(RuntimeInterface::qmlEngine(), "DiffScope.Core", "PianoRollPanel", this));
5855
}
5956
}
6057
void WorkspaceAddOn::extensionsInitialized() {

src/plugins/coreplugin/internal/workspace/ProjectWindowWorkspaceManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace Core::Internal {
6767
);
6868
layout.setViewSpec(
6969
ProjectWindowWorkspaceLayout::TopLeft,
70-
{{{"org.diffscope.core.panel.arrangement", true}
70+
{{{"org.diffscope.visualeditor.panel.arrangement", true}
7171
},
7272
400,
7373
360,
@@ -81,8 +81,8 @@ namespace Core::Internal {
8181
);
8282
layout.setViewSpec(
8383
ProjectWindowWorkspaceLayout::BottomLeft,
84-
{{{"org.diffscope.core.panel.pianoRoll", true},
85-
{"org.diffscope.core.panel.mixer", true}
84+
{{{"org.diffscope.visualeditor.panel.pianoRoll", true},
85+
{"org.diffscope.visualeditor.panel.mixer", true}
8686
},
8787
400,
8888
640,

src/plugins/coreplugin/qml/panels/ArrangementPanel.qml

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/plugins/coreplugin/res/org.diffscope.core_actions.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@
156156
<action id="org.diffscope.core.statusText" diffscope:excludeFromCommands="true"/>
157157
<action id="org.diffscope.core.panel.properties" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:uniquePanel="true" diffscope:excludeFromCommands="true"/>
158158
<action id="org.diffscope.core.panel.plugins" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
159-
<action id="org.diffscope.core.panel.arrangement" text="Arrangement" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
160-
<action id="org.diffscope.core.panel.mixer" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
161-
<action id="org.diffscope.core.panel.pianoRoll" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
162159
<action id="org.diffscope.core.panel.notifications" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
163160
<action id="org.diffscope.core.panel.tips" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>
164161
<action id="org.diffscope.core.panel.metadata" catalog="org.diffscope.core.workspacePanelWidgets" diffscope:excludeFromCommands="true"/>

src/plugins/importexportmanager/res/org.diffscope.importexportmanager_actions.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
</configuration>
1616

1717
<items>
18-
<action id="importexportmanager.welcomeWizard" />
18+
1919
</items>
2020

2121
<insertions>
22-
<insertion target="org.diffscope.core.help" anchor="last">
23-
<action id="org.diffscope.welcomewizard.welcomeWizard" />
24-
</insertion>
22+
2523
</insertions>
2624

2725
</actionExtension>

src/plugins/visualeditor/internal/VisualEditorPlugin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include <coreplugin/HomeWindowInterface.h>
1414
#include <coreplugin/ProjectWindowInterface.h>
1515

16+
#include <visualeditor/internal/ProjectAddOn.h>
17+
#include <visualeditor/internal/ArrangementAddOn.h>
18+
1619
static auto getVisualEditorActionExtension() {
1720
return QAK_STATIC_ACTION_EXTENSION(visualeditor);
1821
}
@@ -27,6 +30,10 @@ namespace VisualEditor {
2730
bool VisualEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) {
2831
Core::RuntimeInterface::translationManager()->addTranslationPath(pluginSpec()->location() + QStringLiteral("/translations"));
2932
Core::CoreInterface::actionRegistry()->addExtension(::getVisualEditorActionExtension());
33+
34+
Core::ProjectWindowInterfaceRegistry::instance()->attach<ProjectAddOn>();
35+
Core::ProjectWindowInterfaceRegistry::instance()->attach<ArrangementAddOn>();
36+
3037
return true;
3138
}
3239
void VisualEditorPlugin::extensionsInitialized() {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "ArrangementAddOn.h"
2+
3+
#include <QQmlComponent>
4+
5+
#include <CoreApi/runtimeinterface.h>
6+
7+
#include <QAKQuick/quickactioncontext.h>
8+
9+
#include <coreplugin/ProjectWindowInterface.h>
10+
11+
namespace VisualEditor {
12+
ArrangementAddOn::ArrangementAddOn(QObject *parent) : WindowInterfaceAddOn(parent) {}
13+
14+
ArrangementAddOn::~ArrangementAddOn() {}
15+
16+
void ArrangementAddOn::initialize() {
17+
auto windowInterface = windowHandle()->cast<Core::ProjectWindowInterface>();
18+
windowInterface->actionContext()->addAction("org.diffscope.visualeditor.panel.arrangement", new QQmlComponent(Core::RuntimeInterface::qmlEngine(), "DiffScope.VisualEditor", "ArrangementPanel", this));
19+
20+
// TODO
21+
windowInterface->actionContext()->addAction("org.diffscope.visualeditor.panel.pianoRoll", new QQmlComponent(Core::RuntimeInterface::qmlEngine(), "DiffScope.VisualEditor", "PianoRollPanel", this));
22+
windowInterface->actionContext()->addAction("org.diffscope.visualeditor.panel.mixer", new QQmlComponent(Core::RuntimeInterface::qmlEngine(), "DiffScope.VisualEditor", "MixerPanel", this));
23+
}
24+
25+
void ArrangementAddOn::extensionsInitialized() {}
26+
27+
bool ArrangementAddOn::delayedInitialize() {
28+
return WindowInterfaceAddOn::delayedInitialize();
29+
}
30+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef DIFFSCOPE_VISUAL_EDITOR_ARRANGEMENTADDON_H
2+
#define DIFFSCOPE_VISUAL_EDITOR_ARRANGEMENTADDON_H
3+
4+
#include <CoreApi/windowinterface.h>
5+
6+
namespace VisualEditor {
7+
8+
class ArrangementAddOn : public Core::WindowInterfaceAddOn {
9+
Q_OBJECT
10+
public:
11+
explicit ArrangementAddOn(QObject *parent = nullptr);
12+
~ArrangementAddOn() override;
13+
14+
void initialize() override;
15+
void extensionsInitialized() override;
16+
bool delayedInitialize() override;
17+
};
18+
19+
}
20+
21+
#endif //DIFFSCOPE_VISUAL_EDITOR_ARRANGEMENTADDON_H
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "ProjectAddOn.h"
2+
3+
#include <coreplugin/ProjectWindowInterface.h>
4+
5+
#include <visualeditor/ProjectViewModelContext.h>
6+
7+
namespace VisualEditor {
8+
ProjectAddOn::ProjectAddOn(QObject *parent) : WindowInterfaceAddOn(parent) {
9+
}
10+
11+
ProjectAddOn::~ProjectAddOn() = default;
12+
13+
void ProjectAddOn::initialize() {
14+
new ProjectViewModelContext(windowHandle()->cast<Core::ProjectWindowInterface>());
15+
}
16+
17+
void ProjectAddOn::extensionsInitialized() {
18+
}
19+
20+
bool ProjectAddOn::delayedInitialize() {
21+
return WindowInterfaceAddOn::delayedInitialize();
22+
}
23+
}

0 commit comments

Comments
 (0)