12class ScriptManagerListModel;
67 void addAt(qsizetype index = -1);
77 void start(qsizetype index = -1);
82 void stop(qsizetype index = -1);
103 void backgroundRun();
108 [[nodiscard]] QStringList getFilenames()
const;
113 QSettings* _settings;
117 QList<ScriptEntry*> _list;
121 bool _modified{
false};
125 QString _subDirectory;
129 QTimer* _timer{
nullptr};
131 friend ScriptManagerListModel;
206 _interpreter = interpreter;
238 QSharedPointer<ScriptInterpreter> _interpreter;
242 ScriptManager* _manager{
nullptr};
246 QKeySequence _keySequence{};
250 GlobalShortcut* _globalShortcut{
nullptr};
Script entry for the list contained by the manager.
Definition ScriptManager.h:139
const QKeySequence & getKeySequence() const
QString getDisplayName() const
bool start()
Compiles and initializes the script.
bool isGlobal() const
Sets the global shortcut global flag.
void setKeySequence(const QKeySequence &ks)
void setGlobal(bool)
Sets the global shortcut global flag.
void setBackgroundMode(EBackgroundMode bm)
void setInterpreter(const QSharedPointer< ScriptInterpreter > &interpreter)
Definition ScriptManager.h:204
QString getScriptName() const
void setScriptName(const QString &name)
EBackgroundMode getBackgroundMode() const
Definition ScriptManager.h:197
QString getStateName() const
void setFilename(const QString &name)
EBackgroundMode
Available background modes.
Definition ScriptManager.h:147
@ bmOnce
Definition ScriptManager.h:151
@ bmContinuous
Definition ScriptManager.h:153
@ bmNo
Definition ScriptManager.h:149
void setDisplayName(const QString &name)
void stop()
Stops a script from running in the background.
const QString & getFilename() const
Definition ScriptManager.h:190
const QSharedPointer< ScriptInterpreter > & getInterpreter() const
Definition ScriptManager.h:209
Manages scripts for the application.
Definition ScriptManager.h:20
void storeSettings(bool save)
Saves and restores the entries from settings.
void addAt(qsizetype index=-1)
Adds and empty entry to the list.
const ScriptEntry * getEntryByFilepath(const QString &filepath)
Gets the entry pointer form the passed absolute file path.
void remove(qsizetype index)
Removes an entry in the list.
ScriptManager(QSettings *settings, QObject *parent)
Constructor.
ScriptEntry * getEntry(qsizetype index)
Gets the entry from the list by index.
~ScriptManager() override
Overridden destructor.
void start(qsizetype index=-1)
Compiles and initializes script at passed position or all scripts when passing -1.
QString getScriptFilePath(const QString &base_name=QString()) const
Gets the full file path of a script name passed.
void stop(qsizetype index=-1)
Stops script at passed position or all scripts when passing -1.
static QString getFileSuffix()
Gets the file extension used for scripts.
void setModified(QObject *caller)
Sets the modified flag and notifies ...
bool isModified() const
Gets status whether to save to settings is needed.
void shortcutActivated(ScriptEntry *entry)
Gets called from an entry when a shortcut is activated.
Definition Application.h:10