mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-07 04:04:14 +02:00
Live mode: remember the start warning and "always" across restarts
Live mode asked at every start (the "Mode direct" warning) and forgot "always" for scripts when QElectroTech closed, so a user who works with an assistant every day re-enabled it every day. Both are now opt-in and remembered: the warning has a "Ne plus demander au démarrage" checkbox (scripting/live_skip_warning), and the ask-first choice is saved (scripting/live_ask_first; the Assistant panel's checkbox and "Toujours" in the script window). The status bar still shows live mode whenever it is open. Switching live mode off in the settings clears "don't ask again", so turning it back on warns again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -171,6 +171,44 @@ namespace QetSettings
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("scripting/live_assistant", enabled);
|
||||
//Turned off and on again: the start warning comes back, so
|
||||
//"don't ask again" never outlives the choice it was made for
|
||||
if (!enabled) settings.remove("scripting/live_skip_warning");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief liveSkipStartWarning
|
||||
* @return true when the user ticked "don't ask again" in live mode's
|
||||
* start warning: live mode then opens at every start without asking,
|
||||
* until it is switched off in the settings. False unless they did.
|
||||
*/
|
||||
bool liveSkipStartWarning()
|
||||
{
|
||||
QSettings settings;
|
||||
return settings.value("scripting/live_skip_warning", false).toBool();
|
||||
}
|
||||
|
||||
void setLiveSkipStartWarning(bool skip)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("scripting/live_skip_warning", skip);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief liveAskFirst
|
||||
* @return whether live mode shows each script the assistant wrote and
|
||||
* asks before running it. On unless the user chose "always".
|
||||
*/
|
||||
bool liveAskFirst()
|
||||
{
|
||||
QSettings settings;
|
||||
return settings.value("scripting/live_ask_first", true).toBool();
|
||||
}
|
||||
|
||||
void setLiveAskFirst(bool ask)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("scripting/live_ask_first", ask);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user