Showing the changes to interface/src/ui/ScriptEditorWindow.cpp (1 of 4 files). Show all
Unified · Split
| @@ -28,7 +28,6 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <QWidget> |
| 29 | 29 | |
| 30 | 30 | #include "Application.h" |
| 31 | −#include "JSConsole.h" | |
| 32 | 31 | #include "PathUtils.h" |
| 33 | 32 | |
| 34 | 33 | ScriptEditorWindow::ScriptEditorWindow(QWidget* parent) : |
| @@ -59,10 +58,6 @@ ScriptEditorWindow::ScriptEditorWindow(QWidget* parent) : · 24 unmodified lines | ||
| 59 | 58 | _ScriptEditorWindowUI->newButton->setIcon(QIcon(QPixmap(PathUtils::resourcesPath() + "icons/new-script.svg"))); |
| 60 | 59 | _ScriptEditorWindowUI->saveButton->setIcon(QIcon(QPixmap(PathUtils::resourcesPath() + "icons/save-script.svg"))); |
| 61 | 60 | _ScriptEditorWindowUI->toggleRunButton->setIcon(QIcon(QPixmap(PathUtils::resourcesPath() + "icons/start-script.svg"))); |
| 62 | − | |
| 63 | − QWidget* console = new JSConsole(this); | |
| 64 | − console->setFixedHeight(CONSOLE_HEIGHT); | |
| 65 | − this->layout()->addWidget(console); | |
| 66 | 61 | } |
| 67 | 62 | |
| 68 | 63 | ScriptEditorWindow::~ScriptEditorWindow() { |
| @@ -77,10 +72,11 @@ void ScriptEditorWindow::setRunningState(bool run) { · 8 unmodified lines | ||
| 77 | 72 | } |
| 78 | 73 | |
| 79 | 74 | void ScriptEditorWindow::updateButtons() { |
| 75 | + bool isRunning = _ScriptEditorWindowUI->tabWidget->currentIndex() != -1 && | |
| 76 | + static_cast<ScriptEditorWidget*>(_ScriptEditorWindowUI->tabWidget->currentWidget())->isRunning(); | |
| 80 | 77 | _ScriptEditorWindowUI->toggleRunButton->setEnabled(_ScriptEditorWindowUI->tabWidget->currentIndex() != -1); |
| 81 | − _ScriptEditorWindowUI->toggleRunButton->setIcon(_ScriptEditorWindowUI->tabWidget->currentIndex() != -1 && | |
| 82 | − static_cast<ScriptEditorWidget*>(_ScriptEditorWindowUI->tabWidget->currentWidget())->isRunning() ? | |
| 83 | − QIcon("../resources/icons/stop-script.svg") : QIcon("../resources/icons/start-script.svg")); | |
| 78 | + _ScriptEditorWindowUI->toggleRunButton->setIcon(QIcon(QPixmap(PathUtils::resourcesPath() + ((isRunning ? | |
| 79 | + "icons/stop-script.svg" : "icons/start-script.svg"))))); | |
| 84 | 80 | } |
| 85 | 81 | |
| 86 | 82 | void ScriptEditorWindow::loadScriptMenu(const QString& scriptName) { |