File dialogs and modal message boxes in QML
Showing the changes to interface/src/Application.cpp (1 of 59 files). Show all
Unified · Split
| @@ -80,7 +80,6 @@ · 79 unmodified lines | |||
| 80 | #include <controllers/StateController.h> | 80 | #include <controllers/StateController.h> |
| 81 | #include <LogHandler.h> | 81 | #include <LogHandler.h> |
| 82 | #include <MainWindow.h> | 82 | #include <MainWindow.h> |
| 83 | #include <MessageDialog.h> | ||
| 84 | #include <MessagesClient.h> | 83 | #include <MessagesClient.h> |
| 85 | #include <ModelEntityItem.h> | 84 | #include <ModelEntityItem.h> |
| 86 | #include <NetworkAccessManager.h> | 85 | #include <NetworkAccessManager.h> |
| @@ -149,7 +148,6 @@ · 62 unmodified lines | |||
| 149 | #endif | 148 | #endif |
| 150 | #include "Stars.h" | 149 | #include "Stars.h" |
| 151 | #include "ui/AddressBarDialog.h" | 150 | #include "ui/AddressBarDialog.h" |
| 152 | #include "ui/RecorderDialog.h" | ||
| 153 | #include "ui/AvatarInputs.h" | 151 | #include "ui/AvatarInputs.h" |
| 154 | #include "ui/AssetUploadDialogFactory.h" | 152 | #include "ui/AssetUploadDialogFactory.h" |
| 155 | #include "ui/DataWebDialog.h" | 153 | #include "ui/DataWebDialog.h" |
| @@ -1176,10 +1174,8 @@ void Application::initializeGL() { · 1020 unmodified lines | |||
| 1176 | 1174 | ||
| 1177 | void Application::initializeUi() { | 1175 | void Application::initializeUi() { |
| 1178 | AddressBarDialog::registerType(); | 1176 | AddressBarDialog::registerType(); |
| 1179 | RecorderDialog::registerType(); | ||
| 1180 | ErrorDialog::registerType(); | 1177 | ErrorDialog::registerType(); |
| 1181 | LoginDialog::registerType(); | 1178 | LoginDialog::registerType(); |
| 1182 | MessageDialog::registerType(); | ||
| 1183 | VrMenu::registerType(); | 1179 | VrMenu::registerType(); |
| 1184 | Tooltip::registerType(); | 1180 | Tooltip::registerType(); |
| 1185 | UpdateDialog::registerType(); | 1181 | UpdateDialog::registerType(); |
| @@ -1843,14 +1839,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 657 unmodified lines | |||
| 1843 | } | 1839 | } |
| 1844 | break; | 1840 | break; |
| 1845 | 1841 | ||
| 1846 | case Qt::Key_X: | ||
| 1847 | if (isMeta && isShifted) { | ||
| 1848 | // auto offscreenUi = DependencyManager::get<OffscreenUi>(); | ||
| 1849 | // offscreenUi->load("TestControllers.qml"); | ||
| 1850 | RecorderDialog::toggle(); | ||
| 1851 | } | ||
| 1852 | break; | ||
| 1853 | |||
| 1854 | case Qt::Key_L: | 1842 | case Qt::Key_L: |
| 1855 | if (isShifted && isMeta) { | 1843 | if (isShifted && isMeta) { |
| 1856 | Menu::getInstance()->triggerOption(MenuOption::Log); | 1844 | Menu::getInstance()->triggerOption(MenuOption::Log); |
| @@ -2203,6 +2191,11 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 346 unmodified lines | |||
| 2203 | _altPressed = false; | 2191 | _altPressed = false; |
| 2204 | 2192 | ||
| 2205 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | 2193 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 2194 | // If we get a mouse press event it means it wasn't consumed by the offscreen UI, | ||
| 2195 | // hence, we should defocus all of the offscreen UI windows, in order to allow | ||
| 2196 | // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews | ||
| 2197 | // will consume all keyboard events. | ||
| 2198 | offscreenUi->unfocusWindows(); | ||
| 2206 | QPointF transformedPos = offscreenUi->mapToVirtualScreen(event->localPos(), _glWidget); | 2199 | QPointF transformedPos = offscreenUi->mapToVirtualScreen(event->localPos(), _glWidget); |
| 2207 | QMouseEvent mappedEvent(event->type(), | 2200 | QMouseEvent mappedEvent(event->type(), |
| 2208 | transformedPos, | 2201 | transformedPos, |
| @@ -4536,7 +4529,7 @@ bool Application::displayAvatarAttachmentConfirmationDialog(const QString& name) · 2327 unmodified lines | |||
| 4536 | 4529 | ||
| 4537 | void Application::toggleRunningScriptsWidget() { | 4530 | void Application::toggleRunningScriptsWidget() { |
| 4538 | static const QUrl url("dialogs/RunningScripts.qml"); | 4531 | static const QUrl url("dialogs/RunningScripts.qml"); |
| 4539 | DependencyManager::get<OffscreenUi>()->toggle(url, "RunningScripts"); | 4532 | DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts"); |
| 4540 | //if (_runningScriptsWidget->isVisible()) { | 4533 | //if (_runningScriptsWidget->isVisible()) { |
| 4541 | // if (_runningScriptsWidget->hasFocus()) { | 4534 | // if (_runningScriptsWidget->hasFocus()) { |
| 4542 | // _runningScriptsWidget->hide(); | 4535 | // _runningScriptsWidget->hide(); |