-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathVisualEditorPlugin.cpp
More file actions
74 lines (55 loc) · 2.33 KB
/
VisualEditorPlugin.cpp
File metadata and controls
74 lines (55 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "VisualEditorPlugin.h"
#include <QSettings>
#include <CoreApi/runtimeinterface.h>
#include <CoreApi/settingcatalog.h>
#include <CoreApi/translationmanager.h>
#include <extensionsystem/pluginspec.h>
#include <QAKCore/actionregistry.h>
#include <coreplugin/CoreInterface.h>
#include <coreplugin/HomeWindowInterface.h>
#include <coreplugin/ProjectWindowInterface.h>
#include <visualeditor/internal/ArrangementAddOn.h>
#include <visualeditor/internal/EditorPreference.h>
#include <visualeditor/internal/ProjectAddOn.h>
#include <visualeditor/internal/LabelTrackAddOn.h>
#include <visualeditor/internal/TempoTrackAddOn.h>
#include <visualeditor/internal/EditorPage.h>
static auto getVisualEditorActionExtension() {
return QAK_STATIC_ACTION_EXTENSION(visualeditor);
}
namespace VisualEditor::Internal {
VisualEditorPlugin::VisualEditorPlugin() {
}
VisualEditorPlugin::~VisualEditorPlugin() = default;
bool VisualEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) {
Core::RuntimeInterface::translationManager()->addTranslationPath(pluginSpec()->location() + QStringLiteral("/translations"));
Core::CoreInterface::actionRegistry()->addExtension(::getVisualEditorActionExtension());
initializeSingletons();
initializeEditorPreference();
initializeSettings();
initializeWindows();
return true;
}
void VisualEditorPlugin::extensionsInitialized() {
}
bool VisualEditorPlugin::delayedInitialize() {
return IPlugin::delayedInitialize();
}
void VisualEditorPlugin::initializeSingletons() {
new EditorPreference(this);
}
void VisualEditorPlugin::initializeEditorPreference() {
auto editorPreference = EditorPreference::instance();
editorPreference->load();
}
void VisualEditorPlugin::initializeSettings() {
auto sc = Core::CoreInterface::settingCatalog();
sc->addPage(new EditorPage);
}
void VisualEditorPlugin::initializeWindows() {
Core::ProjectWindowInterfaceRegistry::instance()->attach<ProjectAddOn>();
Core::ProjectWindowInterfaceRegistry::instance()->attach<ArrangementAddOn>();
Core::ProjectWindowInterfaceRegistry::instance()->attach<LabelTrackAddOn>();
Core::ProjectWindowInterfaceRegistry::instance()->attach<TempoTrackAddOn>();
}
}