3838 * <p><em>This API currently has no effect and is not used.</em></p>
3939 *
4040 * @namespace OffscreenFlags
41- *
41+ *
4242 * @hifi-interface
4343 * @hifi-client-entity
4444 * @hifi-avatar
4545 *
46- * @property {boolean} navigationFocused - <code>true</code> if UI has joystick navigation focus, <code>false</code> if it
46+ * @property {boolean} navigationFocused - <code>true</code> if UI has joystick navigation focus, <code>false</code> if it
4747 * doesn't.
48- * @property {boolean} navigationFocusDisabled - <code>true</code> if UI joystick navigation focus is disabled,
48+ * @property {boolean} navigationFocusDisabled - <code>true</code> if UI joystick navigation focus is disabled,
4949 * <code>false</code> if it isn't.
5050 */
5151
@@ -75,7 +75,7 @@ class OffscreenFlags : public QObject {
7575 emit navigationFocusDisabledChanged ();
7676 }
7777 }
78-
78+
7979signals:
8080
8181 /* @jsdoc
@@ -99,9 +99,9 @@ class OffscreenFlags : public QObject {
9999
100100static OffscreenFlags* offscreenFlags { nullptr };
101101
102- // This hack allows the QML UI to work with keys that are also bound as
103- // shortcuts at the application level. However, it seems as though the
104- // bound actions are still getting triggered. At least for backspace.
102+ // This hack allows the QML UI to work with keys that are also bound as
103+ // shortcuts at the application level. However, it seems as though the
104+ // bound actions are still getting triggered. At least for backspace.
105105// Not sure why.
106106//
107107// However, the problem may go away once we switch to the new menu system,
@@ -168,7 +168,7 @@ void OffscreenUi::onRootContextCreated(QQmlContext* qmlContext) {
168168 qmlContext->setContextProperty (" fileDialogHelper" , new FileDialogHelper ());
169169#ifdef DEBUG
170170 qmlContext->setContextProperty (" DebugQML" , QVariant (true ));
171- #else
171+ #else
172172 qmlContext->setContextProperty (" DebugQML" , QVariant (false ));
173173#endif
174174
@@ -284,7 +284,7 @@ QQuickItem* OffscreenUi::createMessageBox(Icon icon, const QString& title, const
284284 map.insert (" buttons" , buttons.operator int ());
285285 map.insert (" defaultButton" , defaultButton);
286286 QVariant result;
287- bool invokeResult;
287+ bool invokeResult = false ;
288288 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
289289 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
290290 if (tablet->getToolbarMode () && _desktop) {
@@ -309,7 +309,7 @@ int OffscreenUi::waitForMessageBoxResult(QQuickItem* messageBox) {
309309 if (!messageBox) {
310310 return QMessageBox::NoButton;
311311 }
312-
312+
313313 return MessageBoxListener (messageBox).waitForButtonResult ();
314314}
315315
@@ -424,8 +424,8 @@ QString OffscreenUi::getText(const Icon icon, const QString& title, const QStrin
424424QString OffscreenUi::getItem (const Icon icon, const QString& title, const QString& label, const QStringList& items,
425425 int current, bool editable, bool * ok) {
426426
427- if (ok) {
428- *ok = false ;
427+ if (ok) {
428+ *ok = false ;
429429 }
430430
431431 auto offscreenUi = DependencyManager::get<OffscreenUi>();
@@ -580,7 +580,7 @@ QQuickItem* OffscreenUi::createInputDialog(const Icon icon, const QString& title
580580 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
581581 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
582582
583- bool invokeResult;
583+ bool invokeResult = false ;
584584 if (tablet->getToolbarMode () && _desktop) {
585585 invokeResult = QMetaObject::invokeMethod (_desktop, " inputDialog" ,
586586 Q_RETURN_ARG (QVariant, result),
@@ -608,7 +608,7 @@ QQuickItem* OffscreenUi::createCustomInputDialog(const Icon icon, const QString&
608608 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
609609 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
610610
611- bool invokeResult;
611+ bool invokeResult = false ;
612612 if (tablet->getToolbarMode () && _desktop) {
613613 invokeResult = QMetaObject::invokeMethod (_desktop, " inputDialog" ,
614614 Q_RETURN_ARG (QVariant, result),
@@ -619,7 +619,7 @@ QQuickItem* OffscreenUi::createCustomInputDialog(const Icon icon, const QString&
619619 Q_ARG (QVariant, QVariant::fromValue (map)));
620620 emit tabletScriptingInterface->tabletNotification ();
621621 }
622-
622+
623623 if (!invokeResult) {
624624 qWarning () << " Failed to create custom message box" ;
625625 return nullptr ;
@@ -648,13 +648,13 @@ void OffscreenUi::setNavigationFocused(bool focused) {
648648// FIXME HACK....
649649// This hack is an attempt to work around the 'offscreen UI can't gain keyboard focus' bug
650650// https://app.asana.com/0/27650181942747/83176475832393
651- // The problem seems related to https://bugreports.qt.io/browse/QTBUG-50309
651+ // The problem seems related to https://bugreports.qt.io/browse/QTBUG-50309
652652//
653653// The workaround seems to be to give some other window (same process or another process doesn't seem to matter)
654- // focus and then put focus back on the interface main window.
654+ // focus and then put focus back on the interface main window.
655655//
656- // If I could reliably reproduce this bug I could eventually track down what state change is occuring
657- // during the process of the main window losing and then gaining focus, but failing that, here's a
656+ // If I could reliably reproduce this bug I could eventually track down what state change is occuring
657+ // during the process of the main window losing and then gaining focus, but failing that, here's a
658658// brute force way of triggering that state change at application start in a way that should be nearly
659659// imperceptible to the user.
660660class KeyboardFocusHack : public QObject {
@@ -754,7 +754,7 @@ private slots:
754754
755755QString OffscreenUi::fileDialog (const QVariantMap& properties) {
756756 QVariant buildDialogResult;
757- bool invokeResult;
757+ bool invokeResult = false ;
758758 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
759759 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
760760 if (tablet->getToolbarMode () && _desktop) {
@@ -783,7 +783,7 @@ QString OffscreenUi::fileDialog(const QVariantMap& properties) {
783783
784784ModalDialogListener* OffscreenUi::fileDialogAsync (const QVariantMap& properties) {
785785 QVariant buildDialogResult;
786- bool invokeResult;
786+ bool invokeResult = false ;
787787 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
788788 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
789789 if (tablet->getToolbarMode () && _desktop) {
@@ -1003,7 +1003,7 @@ class AssetDialogListener : public ModalDialogListener {
10031003QString OffscreenUi::assetDialog (const QVariantMap& properties) {
10041004 // ATP equivalent of fileDialog().
10051005 QVariant buildDialogResult;
1006- bool invokeResult;
1006+ bool invokeResult = false ;
10071007 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
10081008 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
10091009 if (tablet->getToolbarMode () && _desktop) {
@@ -1033,7 +1033,7 @@ QString OffscreenUi::assetDialog(const QVariantMap& properties) {
10331033ModalDialogListener *OffscreenUi::assetDialogAsync (const QVariantMap& properties) {
10341034 // ATP equivalent of fileDialog().
10351035 QVariant buildDialogResult;
1036- bool invokeResult;
1036+ bool invokeResult = false ;
10371037 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
10381038 TabletProxy* tablet = dynamic_cast <TabletProxy*>(tabletScriptingInterface->getTablet (" com.highfidelity.interface.tablet.system" ));
10391039 if (tablet->getToolbarMode () && _desktop) {
@@ -1165,7 +1165,7 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) {
11651165 }
11661166
11671167 // QML input elements absorb key press, but apparently not key release.
1168- // therefore we want to ensure that key release events for key presses that were
1168+ // therefore we want to ensure that key release events for key presses that were
11691169 // accepted by the QML layer are suppressed
11701170 if (type == QEvent::KeyRelease && pressed) {
11711171 pressed = false ;
@@ -1175,10 +1175,6 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) {
11751175 return result;
11761176}
11771177
1178- unsigned int OffscreenUi::getMenuUserDataId () const {
1179- return _vrMenu->_userDataId ;
1180- }
1181-
11821178ModalDialogListener::ModalDialogListener (QQuickItem *dialog) : _dialog(dialog) {
11831179 if (!dialog) {
11841180 _finished = true ;
0 commit comments