CompilerExplorer: Implement saving documents

Change-Id: Iccfd300a9f0fc25bafae9892c14f172874a99ce1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2023-08-17 08:50:33 +02:00
parent 9664f47cd6
commit a331f0a8c8
7 changed files with 782 additions and 209 deletions

View File

@@ -34,11 +34,10 @@ public:
auto action = new QAction(Tr::tr("Open Compiler Explorer"), this);
connect(action, &QAction::triggered, this, [] {
CompilerExplorer::Settings settings;
const QString src = settings.source();
QString name("Compiler Explorer");
EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8());
Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID,
&name,
settings().defaultDocument().toUtf8());
});
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
@@ -47,11 +46,12 @@ public:
menu->setTitle(Tr::tr("Compiler Explorer"));
mtools->addMenu(mCompilerExplorer);
Command *cmd = ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction");
Command *cmd = ActionManager::registerAction(action,
"CompilerExplorer.CompilerExplorerAction");
mCompilerExplorer->addAction(cmd);
}
};
} // CompilerExplorer::Internl
} // namespace CompilerExplorer::Internal
#include "compilerexplorerplugin.moc"