Showing the changes to interface/src/ui/ScriptEditorWindow.cpp (1 of 20 files). Show all
Unified · Split
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | #include "ScriptEditorWidget.h" |
| 17 | 17 | |
| 18 | 18 | #include <QGridLayout> |
| 19 | +#include <QtCore/QSignalMapper> | |
| 19 | 20 | #include <QFrame> |
| 20 | 21 | #include <QLayoutItem> |
| 21 | 22 | #include <QMainWindow> |
| @@ -27,6 +28,7 @@ · 5 unmodified lines | ||
| 27 | 28 | #include <QTimer> |
| 28 | 29 | #include <QWidget> |
| 29 | 30 | |
| 31 | +#include <ScriptEngines.h> | |
| 30 | 32 | #include "Application.h" |
| 31 | 33 | #include "PathUtils.h" |
| 32 | 34 | |
| @@ -85,11 +87,12 @@ void ScriptEditorWindow::loadScriptMenu(const QString& scriptName) { · 52 unmodified lines | ||
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | void ScriptEditorWindow::loadScriptClicked() { |
| 90 | + auto scriptEngines = DependencyManager::get<ScriptEngines>(); | |
| 88 | 91 | QString scriptName = QFileDialog::getOpenFileName(this, tr("Interface"), |
| 89 | − qApp->getPreviousScriptLocation(), | |
| 92 | + scriptEngines->getPreviousScriptLocation(), | |
| 90 | 93 | tr("JavaScript Files (*.js)")); |
| 91 | 94 | if (!scriptName.isEmpty()) { |
| 92 | − qApp->setPreviousScriptLocation(scriptName); | |
| 95 | + scriptEngines->setPreviousScriptLocation(scriptName); | |
| 93 | 96 | addScriptEditorWidget("loading...")->loadFile(scriptName); |
| 94 | 97 | updateButtons(); |
| 95 | 98 | } |
| @@ -97,7 +100,7 @@ void ScriptEditorWindow::loadScriptClicked() { · 1 unmodified line | ||
| 97 | 100 | |
| 98 | 101 | void ScriptEditorWindow::loadMenuAboutToShow() { |
| 99 | 102 | _loadMenu->clear(); |
| 100 | − QStringList runningScripts = qApp->getRunningScripts(); | |
| 103 | + QStringList runningScripts = DependencyManager::get<ScriptEngines>()->getRunningScripts();; | |
| 101 | 104 | if (runningScripts.count() > 0) { |
| 102 | 105 | QSignalMapper* signalMapper = new QSignalMapper(this); |
| 103 | 106 | foreach (const QString& runningScript, runningScripts) { |