Showing the changes to interface/src/Application.cpp (1 of 12 files). Show all
Unified · Split
| @@ -4554,22 +4554,8 @@ void Application::loadDialog() { · 4553 unmodified lines | ||
| 4554 | 4554 | } |
| 4555 | 4555 | |
| 4556 | 4556 | void Application::loadScriptURLDialog() { |
| 4557 | − // To be migratd to QML | |
| 4558 | − QInputDialog scriptURLDialog(getWindow()); | |
| 4559 | − scriptURLDialog.setWindowTitle("Open and Run Script URL"); | |
| 4560 | − scriptURLDialog.setLabelText("Script:"); | |
| 4561 | − scriptURLDialog.setWindowFlags(Qt::Sheet); | |
| 4562 | − const float DIALOG_RATIO_OF_WINDOW = 0.30f; | |
| 4563 | − scriptURLDialog.resize(scriptURLDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, | |
| 4564 | − scriptURLDialog.size().height()); | |
| 4565 | − | |
| 4566 | − int dialogReturn = scriptURLDialog.exec(); | |
| 4567 | − QString newScript; | |
| 4568 | − if (dialogReturn == QDialog::Accepted) { | |
| 4569 | − if (scriptURLDialog.textValue().size() > 0) { | |
| 4570 | − // the user input a new hostname, use that | |
| 4571 | − newScript = scriptURLDialog.textValue(); | |
| 4572 | − } | |
| 4557 | + auto newScript = OffscreenUi::getText(nullptr, "Open and Run Script", "Script URL"); | |
| 4558 | + if (!newScript.isEmpty()) { | |
| 4573 | 4559 | DependencyManager::get<ScriptEngines>()->loadScript(newScript); |
| 4574 | 4560 | } |
| 4575 | 4561 | } |