|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
Lets the application ask its own user to trust a QML template. More...
#include <qmltemplatetrust.h>
Public Member Functions | |
| QmlTemplateTrust (QObject *parent=nullptr) | |
| Created by installQmlWindowTools(), as a child of the server. | |
| ~QmlTemplateTrust () override | |
| Destroys it. | |
| void | setTrustApproval (TrustApproval approval) |
Asks approval, on the server's thread, when a template needs the user's trust before it can open (design 0033 made this a handler: exactly one decides). | |
| bool | hasApproval () const |
| Whether an approval is set, so a request would reach the user. | |
Private Attributes | |
| TrustApproval | m_approval |
| Asked for each request; empty if none. | |
Friends | |
| class | TrustRequestPrivate |
Lets the application ask its own user to trust a QML template.
installQmlWindowTools() returns it. When ui_open is asked to open a template whose files aren't trusted, and an approval is set (setTrustApproval()), the call waits (up to two minutes) for the request to be answered. Without one, the call fails at once and tells the client to have the user run sonde trust.
How to ask is the application's choice: a dialog, a banner. Show the files' sources, or their paths, so the user can read what they trust. The agent can see and click such a dialog like any other window (design 0023 says why that is not guarded against). Debug builds only, like the rest of the QML window tools.
| void Sonde::QmlTemplateTrust::setTrustApproval | ( | TrustApproval | approval | ) |
Asks approval, on the server's thread, when a template needs the user's trust before it can open (design 0033 made this a handler: exactly one decides).
An empty one removes it.