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:
ispyisail
2026-10-02 12:49:01 +13:00
parent e03e523069
commit 5473ed7cdb
7 changed files with 212 additions and 1 deletions
@@ -16,6 +16,7 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "generalconfigurationpage.h"
#include "../../scripting/assistantinfo.h"
#include "../../qetapp.h"
#include "../../qeticons.h"
@@ -307,6 +308,8 @@ void GeneralConfigurationPage::applyConf()
if (ui->m_enable_scripting->isEnabled()) {
QetSettings::setScriptingEnabled(ui->m_enable_scripting->isChecked());
}
//What an assistant reads about this QElectroTech follows the change
AssistantInfo::write();
//GENERIC PANEL
settings.setValue("genericpanel/folio",ui->m_use_folio_label->isChecked());