mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 09:14:12 +02:00
Script buttons: qet-assistant.json, what an assistant needs to know in one file
QElectroTech now writes qet-assistant.json in the standard data folder when an editor opens, and again whenever the stored scripts or the scripting setting change: its version and program, every folder (data, settings, scripts, the element and title block collections), which features are on, every call a script can make (QetScriptApi::signatures(), apiSignatures() without a running script), and the stored scripts with their ids, files, icons and shortcuts, plus those refused and why. On quit it says nothing is running any more. The qet MCP server reads it rather than guessing each folder per platform, which is wrong as soon as QElectroTech runs with --data-dir: the file stays where the server can find it and names the folders actually in use. Readable by the user only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -132,9 +132,19 @@ int QetScriptApi::folioCount() const
|
||||
all of them.
|
||||
*/
|
||||
QStringList QetScriptApi::apiSignatures() const
|
||||
{
|
||||
return signatures();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QetScriptApi::signatures
|
||||
apiSignatures() without a script running: what qet-assistant.json lists
|
||||
for an assistant before it has run anything.
|
||||
*/
|
||||
QStringList QetScriptApi::signatures()
|
||||
{
|
||||
QStringList list;
|
||||
const QMetaObject *meta = metaObject();
|
||||
const QMetaObject *meta = &staticMetaObject;
|
||||
for (int i = meta->methodOffset(); i < meta->methodCount(); ++i) {
|
||||
const QMetaMethod method = meta->method(i);
|
||||
if (method.methodType() != QMetaMethod::Method
|
||||
|
||||
Reference in New Issue
Block a user