2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2016-09-15 17:55:28 +02:00
|
|
|
|
|
|
|
|
#include "scxmleditorfactory.h"
|
|
|
|
|
|
|
|
|
|
#include "scxmleditorconstants.h"
|
|
|
|
|
#include "scxmleditordata.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
|
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2022-05-31 11:16:44 +02:00
|
|
|
#include <utils/fsengine/fileiconprovider.h>
|
2016-09-15 17:55:28 +02:00
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
|
|
|
|
|
using namespace ScxmlEditor::Constants;
|
|
|
|
|
using namespace ScxmlEditor::Internal;
|
|
|
|
|
|
2020-02-06 08:38:54 +01:00
|
|
|
ScxmlEditorFactory::ScxmlEditorFactory()
|
2016-09-15 17:55:28 +02:00
|
|
|
{
|
|
|
|
|
setId(K_SCXML_EDITOR_ID);
|
|
|
|
|
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));
|
|
|
|
|
addMimeType(ProjectExplorer::Constants::SCXML_MIMETYPE);
|
|
|
|
|
|
2022-05-31 11:16:44 +02:00
|
|
|
Utils::FileIconProvider::registerIconOverlayForSuffix(":/projectexplorer/images/fileoverlay_scxml.png", "scxml");
|
2016-09-15 17:55:28 +02:00
|
|
|
|
2020-02-04 18:16:57 +01:00
|
|
|
setEditorCreator([this] {
|
|
|
|
|
if (!m_editorData) {
|
2020-02-11 17:55:15 +01:00
|
|
|
m_editorData = new ScxmlEditorData;
|
2020-02-04 18:16:57 +01:00
|
|
|
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
|
|
|
|
m_editorData->fullInit();
|
|
|
|
|
QGuiApplication::restoreOverrideCursor();
|
|
|
|
|
}
|
|
|
|
|
return m_editorData->createEditor();
|
|
|
|
|
});
|
2016-09-15 17:55:28 +02:00
|
|
|
}
|
2020-02-11 17:55:15 +01:00
|
|
|
|
|
|
|
|
ScxmlEditorFactory::~ScxmlEditorFactory()
|
|
|
|
|
{
|
|
|
|
|
delete m_editorData;
|
|
|
|
|
}
|