mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +02:00
- Style
- Script Editor can run script file once at time, but you can still start multiple scripts through the original ways.
This commit is contained in:
parent
c1ed38f4de
commit
9faee0d82d
4 changed files with 7 additions and 7 deletions
|
@ -3377,8 +3377,8 @@ void Application::uploadSkeleton() {
|
|||
uploadFST(false);
|
||||
}
|
||||
|
||||
ScriptEngine* Application::loadScript(const QString& scriptName, bool focusMainWindow) {
|
||||
if(_scriptEnginesHash.contains(scriptName) && !_scriptEnginesHash[scriptName]->isFinished()){
|
||||
ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScriptFromEditor) {
|
||||
if(loadScriptFromEditor && _scriptEnginesHash.contains(scriptName) && !_scriptEnginesHash[scriptName]->isFinished()){
|
||||
return _scriptEnginesHash[scriptName];
|
||||
}
|
||||
|
||||
|
@ -3436,7 +3436,7 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool focusMainW
|
|||
workerThread->start();
|
||||
|
||||
// restore the main window's active state
|
||||
if (focusMainWindow) {
|
||||
if (!loadScriptFromEditor) {
|
||||
_window->activateWindow();
|
||||
}
|
||||
bumpSettings();
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
~Application();
|
||||
|
||||
void restoreSizeAndPosition();
|
||||
ScriptEngine* loadScript(const QString& fileNameString, bool focusMainWindow = true);
|
||||
ScriptEngine* loadScript(const QString& fileNameString, bool loadScriptFromEditor = false);
|
||||
void loadScripts();
|
||||
void storeSizeAndPosition();
|
||||
void clearScriptsBeforeRunning();
|
||||
|
|
|
@ -71,7 +71,7 @@ bool ScriptEditorWidget::setRunning(bool run) {
|
|||
disconnect(this, SLOT(onScriptPrint(const QString&)));
|
||||
|
||||
if (run) {
|
||||
_scriptEngine = Application::getInstance()->loadScript(_currentScript, false);
|
||||
_scriptEngine = Application::getInstance()->loadScript(_currentScript, true);
|
||||
connect(_scriptEngine, SIGNAL(runningStateChanged()), this, SIGNAL(runningStateChanged()));
|
||||
|
||||
// Make new connections.
|
||||
|
|
|
@ -180,11 +180,11 @@ void ScriptEditorWindow::closeEvent(QCloseEvent *event) {
|
|||
|
||||
void ScriptEditorWindow::updateScriptNameOrStatus() {
|
||||
ScriptEditorWidget* source = (ScriptEditorWidget*)QObject::sender();
|
||||
QString modifiedStar = (source->isModified()?"*":"");
|
||||
QString modifiedStar = (source->isModified()? "*" : "");
|
||||
if (source->getScriptName().length() > 0) {
|
||||
for (int i = 0; i < _ScriptEditorWindowUI->tabWidget->count(); i++){
|
||||
if (_ScriptEditorWindowUI->tabWidget->widget(i) == source) {
|
||||
_ScriptEditorWindowUI->tabWidget->setTabText(i,modifiedStar + QFileInfo(source->getScriptName()).fileName());
|
||||
_ScriptEditorWindowUI->tabWidget->setTabText(i, modifiedStar + QFileInfo(source->getScriptName()).fileName());
|
||||
_ScriptEditorWindowUI->tabWidget->setTabToolTip(i, source->getScriptName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue