Skip to content

Commit dd155d9

Browse files
committed
Add Import/Export Manager plugin
1 parent 833eb13 commit dd155d9

10 files changed

+152
-1
lines changed

src/plugins/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ add_subdirectory(coreplugin)
9797
add_subdirectory(audio)
9898
add_subdirectory(welcomewizard)
9999
add_subdirectory(achievement)
100-
add_subdirectory(maintenance)
100+
add_subdirectory(maintenance)
101+
add_subdirectory(importexportmanager)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
project(importexportmanager
2+
VERSION ${APPLICATION_VERSION}
3+
DESCRIPTION ${CURRENT_PLUGIN_DESC}
4+
)
5+
6+
diffscope_add_builtin_plugin(${PROJECT_NAME}
7+
NAME org.diffscope.importexportmanager
8+
DISPLAY_NAME "Import/Export Manager"
9+
MACRO_PREFIX IMPORT_EXPORT_MANAGER
10+
QML_MODULE_NAME ImportExportManager
11+
QT_LINKS
12+
Core
13+
Gui
14+
Widgets
15+
Qml
16+
Quick
17+
LINKS
18+
ExtensionSystem::ExtensionSystem
19+
ChorusKit::AppCore
20+
uishell
21+
QAKCore
22+
QAKQuick
23+
coreplugin
24+
opendspx::model
25+
INCLUDE_PRIVATE
26+
internal/**
27+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include "ImportExportManagerPlugin.h"
2+
3+
#include <QSettings>
4+
5+
#include <CoreApi/runtimeinterface.h>
6+
#include <CoreApi/translationmanager.h>
7+
8+
#include <extensionsystem/pluginspec.h>
9+
10+
#include <QAKCore/actionregistry.h>
11+
12+
#include <coreplugin/CoreInterface.h>
13+
#include <coreplugin/HomeWindowInterface.h>
14+
#include <coreplugin/ProjectWindowInterface.h>
15+
16+
static auto getImportExportManagerActionExtension() {
17+
return QAK_STATIC_ACTION_EXTENSION(importexportmanager);
18+
}
19+
20+
namespace ImportExportManager {
21+
22+
ImportExportManagerPlugin::ImportExportManagerPlugin() {
23+
}
24+
25+
ImportExportManagerPlugin::~ImportExportManagerPlugin() = default;
26+
27+
bool ImportExportManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage) {
28+
Core::RuntimeInterface::translationManager()->addTranslationPath(pluginSpec()->location() + QStringLiteral("/translations"));
29+
Core::CoreInterface::actionRegistry()->addExtension(::getImportExportManagerActionExtension());
30+
return true;
31+
}
32+
void ImportExportManagerPlugin::extensionsInitialized() {
33+
}
34+
bool ImportExportManagerPlugin::delayedInitialize() {
35+
return IPlugin::delayedInitialize();
36+
}
37+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef DIFFSCOPE_IMPORT_EXPORT_MANAGER_IMPORTEXPORTMANAGERPLUGIN_H
2+
#define DIFFSCOPE_IMPORT_EXPORT_MANAGER_IMPORTEXPORTMANAGERPLUGIN_H
3+
4+
#include <extensionsystem/iplugin.h>
5+
6+
namespace ImportExportManager {
7+
8+
class ImportExportManagerPlugin : public ExtensionSystem::IPlugin {
9+
Q_OBJECT
10+
Q_PLUGIN_METADATA(IID "org.OpenVPI.DiffScope.Plugin" FILE "plugin.json")
11+
public:
12+
ImportExportManagerPlugin();
13+
~ImportExportManagerPlugin() override;
14+
15+
bool initialize(const QStringList &arguments, QString *errorMessage) override;
16+
void extensionsInitialized() override;
17+
bool delayedInitialize() override;
18+
};
19+
20+
}
21+
22+
#endif //DIFFSCOPE_IMPORT_EXPORT_MANAGER_IMPORTEXPORTMANAGERPLUGIN_H
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"Name": "@PLUGIN_METADATA_NAME@",
3+
"DisplayName": "@PLUGIN_METADATA_DISPLAY_NAME@",
4+
"Version": "@PLUGIN_METADATA_VERSION@",
5+
"CompatVersion": "@PLUGIN_METADATA_COMPAT_VERSION@",
6+
"DisabledByDefault": false,
7+
"HiddenByDefault": false,
8+
"Vendor": "@PLUGIN_METADATA_VENDOR@",
9+
"Copyright": "@PLUGIN_METADATA_COPYRIGHT@",
10+
"License": [
11+
"Apache-2.0"
12+
],
13+
"Arguments" : [
14+
],
15+
"Category": "Core",
16+
"Description": "Manage the formats used for importing and exporting",
17+
"Url": "@APPLICATION_URL@",
18+
"Dependencies" : [
19+
{ "Name" : "org.diffscope.core", "Version" : "@PLUGIN_METADATA_VERSION@" }
20+
]
21+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<actionExtension xmlns:diffscope="http://schemas.diffscope.org/diffscope/actions/diffscope">
3+
<version>1.0</version>
4+
<id>org.diffscope.importexportmanager</id>
5+
<configuration>
6+
<defaultCatalog>core.mainMenu</defaultCatalog>
7+
<translationContext
8+
text="Application::ActionText"
9+
class="Application::ActionClass"
10+
description="Application::ActionDescription"
11+
/>
12+
<vars>
13+
<var key="APP_NAME" value="DiffScope" />
14+
</vars>
15+
</configuration>
16+
17+
<items>
18+
<action id="importexportmanager.welcomeWizard" />
19+
</items>
20+
21+
<insertions>
22+
<insertion target="org.diffscope.core.help" anchor="last">
23+
<action id="org.diffscope.welcomewizard.welcomeWizard" />
24+
</insertion>
25+
</insertions>
26+
27+
</actionExtension>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="en_US" sourcelanguage="en-US">
4+
</TS>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="ja_JP" sourcelanguage="en-US">
4+
</TS>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="zh_CN" sourcelanguage="en-US">
4+
</TS>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="zh_TW" sourcelanguage="en-US">
4+
</TS>

0 commit comments

Comments
 (0)