View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017548 | Scribus | Scripter | public | 2025-05-31 15:30 | 2025-05-31 15:45 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.7.1.svn | ||||
Summary | 0017548: Allow a plugin to send arbitrary arguments to another plugin | ||||
Description | The Epub exporter is being implemented as a plugin (since it's an exporter...). For testing purposes I've already added a command to the scripter that generates an Epub from the current document. According to Jean's instructions (thanks for the help!), I need to one of the two run() commands defined in ScActionPlugin, which accepts a string argument that is mostly a file name (in my case the file name for the target Epub). That's ok for now. And I can currently generate a minimal Epub from the scripter. But in the long term, we need to expand the scripter command to have more parameters. The similar issue will also happen, with the "planned" scripter command for exporting to SVG. According to my research (and the discussion with Jean), the only plugin that has a scripter command is the export to pdf and, for that case, an ad hoc method in the main Scribus code, that acts as a bridge between the two plugins. So, in the worst case, we know how to solve the issue... but, maybe, we can find a better solution that does not rely on such a central node. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
currently i'm using:const auto& instance = PluginManager::instance(); ScPlugin* plugin = instance.getPlugin("epubexportplugin", false); if (plugin == nullptr) { Py_RETURN_NONE; } auto scActionPlugin = dynamic_cast<ScActionPlugin*>(plugin); scActionPlugin->run(ScCore->primaryMainWindow()->doc, QString::fromUtf8(filenaname.c_str())); which, as written above, works ok. if i try const auto& instance = PluginManager::instance(); ScPlugin* plugin = instance.getPlugin("epubexportplugin", false); if (plugin == nullptr) { Py_RETURN_NONE; } auto scActionPlugin = dynamic_cast<EpubExportPlugin*>(plugin); scActionPlugin->run(ScCore->primaryMainWindow()->doc, QString::fromUtf8(filenaname.c_str())); it compiles and links. and it seems also to work correctly, even if i get the runtime error: /home/ale/bin/scribus-gitlab/lib/scribus/plugins//libscriptplugin.so: undefined symbol: _ZTI16EpubExportPlugin it's a bit as if it would use some old code somewhere... needs more investigations... |