From 325991a002894011b1da8dd54b16b4cb15f77554 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 23:12:13 -0700 Subject: EXP-60 Hints not showing after Re-enabling Hints in same session --- indra/newview/llhints.cpp | 38 ++++++++++++++++++-------------------- indra/newview/llhints.h | 5 +++-- indra/newview/llviewermenu.cpp | 14 +++----------- 3 files changed, 24 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index bb8f4a995b..393aa188e1 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -345,26 +345,6 @@ void LLHints::hide(LLNotificationPtr hint) } } -//static -void LLHints::hideAll() -{ - std::vector notifications; - for (hint_map_t::iterator it = sHints.begin(), end_it = sHints.end(); - it != end_it; - ++it) - { - notifications.push_back(it->first); - } - - for(std::vector::iterator it = notifications.begin(), end_it = notifications.end(); - it != end_it; - ++it) - { - hide(*it); - } - -} - //static void LLHints::registerHintTarget(const std::string& name, LLHandle target) { @@ -384,3 +364,21 @@ LLHandle LLHints::getHintTarget(const std::string& name) return LLHandle(); } } + +//static +void LLHints::initClass() +{ + sRegister.reference(); + + LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); + control->getSignal()->connect(boost::bind(&showHints, _2)); + gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); + +} + +//staic +void LLHints::showHints(const LLSD& show) +{ + bool visible = show.asBoolean(); + gViewerWindow->getHintHolder()->setVisible(visible); +} \ No newline at end of file diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h index 3bca7f00a1..ebffe561b9 100644 --- a/indra/newview/llhints.h +++ b/indra/newview/llhints.h @@ -31,18 +31,19 @@ #include "llnotifications.h" -class LLHints +class LLHints : public LLInitClass { public: static void show(LLNotificationPtr hint); static void hide(LLNotificationPtr hint); - static void hideAll(); static void registerHintTarget(const std::string& name, LLHandle target); static LLHandle getHintTarget(const std::string& name); + static void initClass(); private: static LLRegistry > sTargetRegistry; typedef std::map hint_map_t; static hint_map_t sHints; + static void showHints(const LLSD& show); }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ba98ffdc52..d4af5048c3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7756,17 +7756,9 @@ class LLToggleUIHints : public view_listener_t bool handleEvent(const LLSD& userdata) { bool ui_hints_enabled = gSavedSettings.getBOOL("EnableUIHints"); - if (ui_hints_enabled) - { - // hide existing hints - LLHints::hideAll(); - - gSavedSettings.setBOOL("EnableUIHints", FALSE); - } - else - { - gSavedSettings.setBOOL("EnableUIHints", TRUE); - } + // toggle + ui_hints_enabled = !ui_hints_enabled; + gSavedSettings.setBOOL("EnableUIHints", ui_hints_enabled); return true; } }; -- cgit v1.2.3