Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -52,6 +52,9 @@ static const QVariantMap DOCK_AREA { · 51 unmodified lines | |||
| 52 | { "RIGHT", DockArea::RIGHT } | 52 | { "RIGHT", DockArea::RIGHT } |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | DesktopScriptingInterface::DesktopScriptingInterface(QObject* parent, bool restricted) | ||
| 56 | : QObject(parent), _restricted(restricted) { } | ||
| 57 | |||
| 55 | int DesktopScriptingInterface::getWidth() { | 58 | int DesktopScriptingInterface::getWidth() { |
| 56 | QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize(); | 59 | QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize(); |
| 57 | return size.width(); | 60 | return size.width(); |
| @@ -128,7 +131,7 @@ InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& · 70 unmodified lines | |||
| 128 | return nullptr; | 131 | return nullptr; |
| 129 | } | 132 | } |
| 130 | 133 | ||
| 131 | return new InteractiveWindow(sourceUrl, properties); | 134 | return new InteractiveWindow(sourceUrl, properties, _restricted); |
| 132 | } | 135 | } |
| 133 | 136 | ||
| 134 | InteractiveWindowPointer DesktopScriptingInterface::createWindowOnThread(const QString& sourceUrl, const QVariantMap& properties, QThread* targetThread) { | 137 | InteractiveWindowPointer DesktopScriptingInterface::createWindowOnThread(const QString& sourceUrl, const QVariantMap& properties, QThread* targetThread) { |
| @@ -139,7 +142,7 @@ InteractiveWindowPointer DesktopScriptingInterface::createWindowOnThread(const Q · 4 unmodified lines | |||
| 139 | if (!urlValidator(sourceUrl)) { | 142 | if (!urlValidator(sourceUrl)) { |
| 140 | return nullptr; | 143 | return nullptr; |
| 141 | } | 144 | } |
| 142 | InteractiveWindowPointer window = new InteractiveWindow(sourceUrl, properties); | 145 | InteractiveWindowPointer window = new InteractiveWindow(sourceUrl, properties, _restricted); |
| 143 | window->moveToThread(targetThread); | 146 | window->moveToThread(targetThread); |
| 144 | return window; | 147 | return window; |
| 145 | } | 148 | } |