Prompt user whether to reload.
Showing the changes to interface/src/ui/ScriptEditorWindow.cpp (1 of 4 files). Show all
Unified · Split
| @@ -36,6 +36,8 @@ ScriptEditorWindow::ScriptEditorWindow() : · 35 unmodified lines | ||
| 36 | 36 | _loadMenu(new QMenu), |
| 37 | 37 | _saveMenu(new QMenu) |
| 38 | 38 | { |
| 39 | + setAttribute(Qt::WA_DeleteOnClose); | |
| 40 | + | |
| 39 | 41 | _ScriptEditorWindowUI->setupUi(this); |
| 40 | 42 | this->setWindowFlags(Qt::Tool); |
| 41 | 43 | show(); |
| @@ -140,6 +142,7 @@ ScriptEditorWidget* ScriptEditorWindow::addScriptEditorWidget(QString title) { · 98 unmodified lines | ||
| 140 | 142 | connect(newScriptEditorWidget, &ScriptEditorWidget::scriptnameChanged, this, &ScriptEditorWindow::updateScriptNameOrStatus); |
| 141 | 143 | connect(newScriptEditorWidget, &ScriptEditorWidget::scriptModified, this, &ScriptEditorWindow::updateScriptNameOrStatus); |
| 142 | 144 | connect(newScriptEditorWidget, &ScriptEditorWidget::runningStateChanged, this, &ScriptEditorWindow::updateButtons); |
| 145 | + connect(this, &ScriptEditorWindow::windowActivated, newScriptEditorWidget, &ScriptEditorWidget::onWindowActivated); | |
| 143 | 146 | _ScriptEditorWindowUI->tabWidget->addTab(newScriptEditorWidget, title); |
| 144 | 147 | _ScriptEditorWindowUI->tabWidget->setCurrentWidget(newScriptEditorWidget); |
| 145 | 148 | newScriptEditorWidget->setUpdatesEnabled(true); |
| @@ -216,3 +219,11 @@ void ScriptEditorWindow::terminateCurrentTab() { · 70 unmodified lines | ||
| 216 | 219 | this->raise(); |
| 217 | 220 | } |
| 218 | 221 | } |
| 222 | + | |
| 223 | +bool ScriptEditorWindow::event(QEvent* event) { | |
| 224 | + if (event->type() == QEvent::WindowActivate) { | |
| 225 | + emit windowActivated(); | |
| 226 | + } | |
| 227 | + return QWidget::event(event); | |
| 228 | +} | |
| 229 | + | |