From 9ca4b8219f1a18b11d457d6f18d3c695aba9aed2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 15:46:45 -0700 Subject: EXP-1275 WIP A UI element or Keyboard shortcut to clear the viewport added confirmation dialog before hiding UI --- indra/newview/llviewermenu.cpp | 30 +++++++++++++++++++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 14 +++++----- .../newview/skins/default/xui/en/notifications.xml | 14 ++++++++++ 3 files changed, 50 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0cbbfae002..478af6ab7d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3766,9 +3766,37 @@ class LLViewToggleUI : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility()); + LLNotification::Params params("ConfirmHideUI"); + params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2)); + LLSD substitutions; +#if LL_DARWIN + substitutions["SHORTCUT"] = "Cmd+Shift+U"; +#else + substitutions["SHORTCUT"] = "Ctrl+Shift+U"; +#endif + params.substitutions = substitutions; + if (gViewerWindow->getUIVisibility()) + { + // hiding, so show notification + LLNotifications::instance().add(params); + } + else + { + LLNotifications::instance().forceResponse(params, 0); + } + return true; } + + void confirm(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) // OK + { + gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility()); + } + } }; class LLEditDuplicate : public view_listener_t diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index fdbc3d1882..c586e3a098 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -24,6 +24,13 @@ function="Floater.Toggle" parameter="toybox" /> + + + @@ -1719,13 +1726,6 @@ - - - + + + confirm + This action will hide all menu items and buttons. To get them back, click [SHORTCUT] again. + + + You do not appear to have the proper hardware requirements for [APP_NAME]. [APP_NAME] requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system. -- cgit v1.2.3