From b63e4b9d1fe66157d51993c01be04fd3ebe87a6b Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 23 Feb 2016 18:15:29 -0800 Subject: [PATCH 1/3] Address shutdown crash --- libraries/ui/src/VrMenu.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/ui/src/VrMenu.cpp b/libraries/ui/src/VrMenu.cpp index d1ef660532..6609b376b1 100644 --- a/libraries/ui/src/VrMenu.cpp +++ b/libraries/ui/src/VrMenu.cpp @@ -124,18 +124,25 @@ void VrMenu::addMenu(QMenu* menu) { new MenuUserData(menu, result); auto menuAction = menu->menuAction(); updateQmlItemFromAction(result, menuAction); - QObject::connect(menuAction, &QAction::changed, [=] { + auto connection = QObject::connect(menuAction, &QAction::changed, [=] { updateQmlItemFromAction(result, menuAction); }); + QObject::connect(qApp, &QCoreApplication::aboutToQuit, [=] { + QObject::disconnect(connection); + }); } void bindActionToQmlAction(QObject* qmlAction, QAction* action) { new MenuUserData(action, qmlAction); updateQmlItemFromAction(qmlAction, action); - QObject::connect(action, &QAction::changed, [=] { + auto connection = QObject::connect(action, &QAction::changed, [=] { updateQmlItemFromAction(qmlAction, action); }); + QObject::connect(qApp, &QCoreApplication::aboutToQuit, [=] { + QObject::disconnect(connection); + }); + QObject::connect(action, &QAction::toggled, [=](bool checked) { qmlAction->setProperty("checked", checked); }); From 4074ba172d8b3aeaaa418757c3ea610597c220da Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 23 Feb 2016 20:37:25 -0800 Subject: [PATCH 2/3] Fix window confirmation dialog --- libraries/ui/src/OffscreenUi.cpp | 6 +++--- libraries/ui/src/OffscreenUi.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 7e84836c86..1c41827795 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -254,15 +254,15 @@ QMessageBox::StandardButton OffscreenUi::critical(const QString& title, const QS } QMessageBox::StandardButton OffscreenUi::information(const QString& title, const QString& text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) { - return DependencyManager::get()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton); + return DependencyManager::get()->messageBox(QMessageBox::Icon::Information, title, text, buttons, defaultButton); } QMessageBox::StandardButton OffscreenUi::question(const QString& title, const QString& text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) { - return DependencyManager::get()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton); + return DependencyManager::get()->messageBox(QMessageBox::Icon::Question, title, text, buttons, defaultButton); } QMessageBox::StandardButton OffscreenUi::warning(const QString& title, const QString& text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) { - return DependencyManager::get()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton); + return DependencyManager::get()->messageBox(QMessageBox::Icon::Warning, title, text, buttons, defaultButton); } diff --git a/libraries/ui/src/OffscreenUi.h b/libraries/ui/src/OffscreenUi.h index 8b00180d43..32f7a31d17 100644 --- a/libraries/ui/src/OffscreenUi.h +++ b/libraries/ui/src/OffscreenUi.h @@ -63,7 +63,7 @@ public: } /// Same design as QMessageBox::question(), will block, returns result static QMessageBox::StandardButton question(void* ignored, const QString& title, const QString& text, - QMessageBox::StandardButtons buttons = QMessageBox::Ok, + QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) { return question(title, text, buttons, defaultButton); } From fa23e2023efdfb29cccbb3933c1bdaf78a03862d Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 23 Feb 2016 20:37:46 -0800 Subject: [PATCH 3/3] Fix bad tool window placement --- interface/resources/qml/ToolWindow.qml | 6 ++++-- interface/resources/qml/desktop/Desktop.qml | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/ToolWindow.qml b/interface/resources/qml/ToolWindow.qml index a7d45b9984..404d1c1e78 100644 --- a/interface/resources/qml/ToolWindow.qml +++ b/interface/resources/qml/ToolWindow.qml @@ -20,8 +20,10 @@ Windows.Window { property string newTabSource property alias tabView: tabView onParentChanged: { - x = 120; - y = 120; + if (parent) { + x = 120; + y = 120; + } } Settings { diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index 604d57d3da..fcc0f9967b 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -11,10 +11,7 @@ import "../js/Utils.js" as Utils FocusScope { id: desktop objectName: "desktop" - - // Allow the scale of the desktop to be changed without screwing up the size relative to the parent. - height: parent.height / scale - width: parent.width / scale + anchors.fill: parent onHeightChanged: d.repositionAll(); onWidthChanged: d.repositionAll();