52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#ifndef BATCHPROCESSING_H
|
|
#define BATCHPROCESSING_H
|
|
|
|
#include <QDialog>
|
|
#include <QFileSystemWatcher>
|
|
#include "scriptengine.h"
|
|
|
|
namespace Ui { class BatchProcessing; }
|
|
|
|
class Database;
|
|
|
|
class BatchProcessing : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
Ui::BatchProcessing *_ui;
|
|
QString _scriptBasePath;
|
|
QFileSystemWatcher _fileWatcher;
|
|
Script::ScriptEngineThread *_engineThread = nullptr;
|
|
QColor _textColor;
|
|
Database *_database;
|
|
private slots:
|
|
void scanScriptDir();
|
|
public:
|
|
explicit BatchProcessing(Database *database, QWidget *parent = nullptr);
|
|
~BatchProcessing();
|
|
protected:
|
|
void closeEvent(QCloseEvent *event);
|
|
public slots:
|
|
void addFiles();
|
|
void addDir();
|
|
void removePath();
|
|
void removeAllPaths();
|
|
void browse();
|
|
void openScriptDir();
|
|
void runScript();
|
|
void stopScript();
|
|
void scriptFinished();
|
|
void newMessage(const QString &message, bool error);
|
|
|
|
QJSValue getString(const QString &label, const QString &text);
|
|
QJSValue getInt(const QString &label, int value);
|
|
QJSValue getFloat(const QString &label, double value, int decimals);
|
|
QJSValue getItem(const QStringList &items, const QString &label, int current);
|
|
QJSValue question(const QString &question, const QStringList &buttons, const QString &title = "");
|
|
|
|
void plot(const QVariant &graph);
|
|
};
|
|
|
|
void openDir(const QString &path);
|
|
|
|
#endif // BATCHPROCESSING_H
|