mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
//
|
|
// ScriptEditorWidget.h
|
|
// interface/src/ui
|
|
//
|
|
// Created by Thijs Wenker on 4/14/14.
|
|
// Copyright 2014 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#ifndef hifi_ScriptEditorWidget_h
|
|
#define hifi_ScriptEditorWidget_h
|
|
|
|
#include <QDockWidget>
|
|
#include "ScriptEngine.h"
|
|
|
|
namespace Ui {
|
|
class ScriptEditorWidget;
|
|
}
|
|
|
|
class ScriptEditorWidget : public QDockWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ScriptEditorWidget();
|
|
~ScriptEditorWidget();
|
|
|
|
bool isModified();
|
|
bool isRunning();
|
|
bool setRunning(bool run);
|
|
bool saveFile(const QString& scriptPath);
|
|
void loadFile(const QString& scriptPath);
|
|
void setScriptFile(const QString& scriptPath);
|
|
bool save();
|
|
bool saveAs();
|
|
bool questionSave();
|
|
const QString getScriptName() const { return _currentScript; };
|
|
|
|
signals:
|
|
void runningStateChanged();
|
|
void scriptnameChanged();
|
|
void scriptModified();
|
|
|
|
private slots:
|
|
void onScriptError(const QString& message);
|
|
void onScriptPrint(const QString& message);
|
|
void onScriptModified();
|
|
void onScriptEnding();
|
|
|
|
private:
|
|
Ui::ScriptEditorWidget* _scriptEditorWidgetUI;
|
|
ScriptEngine* _scriptEngine;
|
|
QString _currentScript;
|
|
};
|
|
|
|
#endif // hifi_ScriptEditorWidget_h
|