History

Merge pull request #6840 from jherico/qml_cleanup

File dialogs and modal message boxes in QML

Howard Stearns committed 10 years ago

Commit 6f84a672 parents 7b63e5b 5aa839859 files · +3244 −2870Browse files

Showing the changes to interface/src/Application.cpp (1 of 59 files). Show all

Unified · Split

interface/src/Application.cpp+6−13
@@ -80,7 +80,6 @@ · 79 unmodified lines
8080 #include <controllers/StateController.h>
8181 #include <LogHandler.h>
8282 #include <MainWindow.h>
83−#include <MessageDialog.h>
8483 #include <MessagesClient.h>
8584 #include <ModelEntityItem.h>
8685 #include <NetworkAccessManager.h>
@@ -149,7 +148,6 @@ · 62 unmodified lines
149148 #endif
150149 #include "Stars.h"
151150 #include "ui/AddressBarDialog.h"
152−#include "ui/RecorderDialog.h"
153151 #include "ui/AvatarInputs.h"
154152 #include "ui/AssetUploadDialogFactory.h"
155153 #include "ui/DataWebDialog.h"
@@ -1176,10 +1174,8 @@ void Application::initializeGL() { · 1020 unmodified lines
11761174
11771175 void Application::initializeUi() {
11781176 AddressBarDialog::registerType();
1179− RecorderDialog::registerType();
11801177 ErrorDialog::registerType();
11811178 LoginDialog::registerType();
1182− MessageDialog::registerType();
11831179 VrMenu::registerType();
11841180 Tooltip::registerType();
11851181 UpdateDialog::registerType();
@@ -1843,14 +1839,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 657 unmodified lines
18431839 }
18441840 break;
18451841
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−
18541842 case Qt::Key_L:
18551843 if (isShifted && isMeta) {
18561844 Menu::getInstance()->triggerOption(MenuOption::Log);
@@ -2203,6 +2191,11 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 346 unmodified lines
22032191 _altPressed = false;
22042192
22052193 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();
22062199 QPointF transformedPos = offscreenUi->mapToVirtualScreen(event->localPos(), _glWidget);
22072200 QMouseEvent mappedEvent(event->type(),
22082201 transformedPos,
@@ -4536,7 +4529,7 @@ bool Application::displayAvatarAttachmentConfirmationDialog(const QString& name) · 2327 unmodified lines
45364529
45374530 void Application::toggleRunningScriptsWidget() {
45384531 static const QUrl url("dialogs/RunningScripts.qml");
4539− DependencyManager::get<OffscreenUi>()->toggle(url, "RunningScripts");
4532+ DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts");
45404533 //if (_runningScriptsWidget->isVisible()) {
45414534 // if (_runningScriptsWidget->hasFocus()) {
45424535 // _runningScriptsWidget->hide();