mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-06 11:14:14 +02:00
Assistant house style: rewrite qet-assistant.json when the style changes
qet.setHouseStyle() only saved the setting, so an assistant reading qet-assistant.json saw the old text until QElectroTech restarted. AssistantInfo::refresh() writes the file again, but only in a QElectroTech that writes it at all: a headless --run would otherwise replace the open QElectroTech's live channel with its own empty one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include "../conductorrouter.h"
|
||||
#include "../qetgraphicsitem/diagramimageitem.h"
|
||||
#include "../utils/qetsettings.h"
|
||||
#include "assistantinfo.h"
|
||||
|
||||
// See diagrameventaddpdf.h: a missing QtPdf module (or Qt < 6.4) is not
|
||||
// fatal at build time, so addPdfPage() is always declared -- a script
|
||||
@@ -4224,6 +4225,9 @@ QString QetScriptApi::houseStyle() const
|
||||
bool QetScriptApi::setHouseStyle(const QString &text)
|
||||
{
|
||||
QetSettings::setHouseStyle(text);
|
||||
//qet-assistant.json carries it: an assistant reading the file
|
||||
//now must see the new text, not the one from the last start
|
||||
AssistantInfo::refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user