diff options
author | Martin Reddy <lynx@lindenlab.com> | 2009-10-15 13:08:12 +0000 |
---|---|---|
committer | Martin Reddy <lynx@lindenlab.com> | 2009-10-15 13:08:12 +0000 |
commit | 925f01f6a066113049e8c829c6fc3875c69ef566 (patch) | |
tree | 4b28ca62ce3de11e3e9727ab09cdfe63466233cf /indra | |
parent | 0051f6bc6d421b8f973d801189b9495c311a647b (diff) |
DEV-41253: Updated the help context calculation code so that it will
now search through a panel's children to see if there are any visible
tabs that have a help topic string defined. If so, we use this string.
Updated all of the XUI files that include a tab_container to define
help topic strings for their child panels. I named all of these strings
with the floater name as the prefix and "tab" at the end. For example,
"preferences_display_tab" or "people_nearby_tab".
Diffstat (limited to 'indra')
20 files changed, 131 insertions, 7 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8d2783db20..47ca4899df 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1443,7 +1443,18 @@ void LLFloater::onClickHelp( LLFloater* self ) { if (self && LLUI::sHelpImpl) { - LLUI::sHelpImpl->showTopic(self->getHelpTopic()); + // get the help topic for this floater + std::string help_topic = self->getHelpTopic(); + + // but use a more specific help topic for the currently + // displayed tab inside of this floater, if present + LLPanel *curtab = self->childGetVisibleTabWithHelp(); + if (curtab) + { + help_topic = curtab->getHelpTopic(); + } + + LLUI::sHelpImpl->showTopic(help_topic); } } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 69ff3dddc3..742427525b 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -810,6 +810,47 @@ LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const return NULL; } +static LLPanel *childGetVisibleTabWithHelp(LLView *parent) +{ + LLView *child; + + // look through immediate children first for an active tab with help + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + LLTabContainer *tab = dynamic_cast<LLTabContainer *>(child); + if (tab && tab->getVisible()) + { + LLPanel *curTabPanel = tab->getCurrentPanel(); + if (curTabPanel && !curTabPanel->getHelpTopic().empty()) + { + return curTabPanel; + } + } + } + + // then try a bit harder and recurse through all children + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + if (child->getVisible()) + { + LLPanel* tab = ::childGetVisibleTabWithHelp(child); + if (tab) + { + return tab; + } + } + } + + // couldn't find any active tabs with a help topic string + return NULL; +} + +LLPanel *LLPanel::childGetVisibleTabWithHelp() +{ + // find a visible tab with a help topic (to determine help context) + return ::childGetVisibleTabWithHelp(this); +} + void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) { LLLineEditor* child = findChild<LLLineEditor>(id); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 0594762333..e8db68ffbb 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -208,6 +208,7 @@ public: // LLTabContainer void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); LLPanel *childGetVisibleTab(const std::string& id) const; + LLPanel *childGetVisibleTabWithHelp(); // LLTextBox/LLTextEditor/LLLineEditor void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 5b72f87a78..84b1c92097 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -795,16 +795,29 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) LLUICtrl* ctrl = this; // search back through the control's parents for a panel - // with a help_topic string defined + // or tab with a help_topic string defined while (ctrl) { LLPanel *panel = dynamic_cast<LLPanel *>(ctrl); - if (panel && !panel->getHelpTopic().empty()) + + if (panel) { - help_topic_out = panel->getHelpTopic(); - return true; // success + // does the panel have an active tab with a help topic? + LLPanel *tab = panel->childGetVisibleTabWithHelp(); + if (tab) + { + help_topic_out = tab->getHelpTopic(); + return true; // success (tab) + } + + // otherwise, does the panel have a help topic itself? + if (!panel->getHelpTopic().empty()) + { + help_topic_out = panel->getHelpTopic(); + return true; // success (panel) + } } - + ctrl = ctrl->getParentUICtrl(); } diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index dc6af79db5..4d7433233a 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -78,6 +78,7 @@ <panel border="true" label="Support" + help_topic="about_support_tab" name="support_panel"> <text_editor allow_html="true" @@ -103,6 +104,7 @@ <panel border="true" label="Credits" + help_topic="about_credits_tab" name="credits_panel"> <text_editor enabled="false" @@ -134,6 +136,7 @@ It is a rare mind indeed that can render the hitherto non-existent blindingly ob <panel border="true" label="Licenses" + help_topic="about_licenses_tab" name="licenses_panel"> <text_editor enabled="false" diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 524495d83d..1f366f6c52 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -40,6 +40,7 @@ label="General" layout="topleft" left="1" + help_topic="land_general_tab" name="land_general_panel" top="-31" width="458"> @@ -535,6 +536,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Covenant" layout="topleft" left_delta="-1" + help_topic="land_covenant_tab" name="land_covenant_panel" top_delta="-47" width="458"> @@ -801,6 +803,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Objects" layout="topleft" left_delta="0" + help_topic="land_objects_tab" name="land_objects_panel" top_delta="-47" width="458"> @@ -1166,6 +1169,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Options" layout="topleft" left_delta="0" + help_topic="land_options_tab" name="land_options_panel" top_delta="31" width="458"> @@ -1603,6 +1607,7 @@ Only large parcels can be listed in search. label="Media" layout="topleft" left_delta="0" + help_topic="land_media_tab" name="land_media_panel" top_delta="1" width="458"> @@ -1865,6 +1870,7 @@ Texture: label="Audio" layout="topleft" left_delta="0" + help_topic="land_audio_tab" name="land_audio_panel" top_delta="1" width="458"> @@ -1968,6 +1974,7 @@ Texture: label="Access" layout="topleft" left_delta="0" + help_topic="land_access_tab" name="land_access_panel" top_delta="31" width="458"> diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index e1f8011cbe..0542d4509e 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -40,6 +40,7 @@ label="Search" layout="topleft" left="6" + help_topic="avatarpicker_search_tab" name="SearchPanel" top="150" width="132"> @@ -91,6 +92,7 @@ label="Near Me" layout="topleft" left="6" + help_topic="avatarpicker_near_me_tab" name="NearMePanel" top="150" width="132"> diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index 615c35e6c3..53d05f3c61 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -23,6 +23,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="godtools_grid_tab" name="grid" top="16" width="398"> @@ -61,6 +62,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="godtools_region_tab" name="region" top_delta="0" width="398"> @@ -483,6 +485,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="godtools_objects_tab" name="objects" top_delta="0" width="398"> @@ -690,6 +693,7 @@ label="Request" layout="topleft" left_delta="0" + help_topic="godtools_request_tab" name="request" top_delta="0" width="398"> diff --git a/indra/newview/skins/default/xui/en/floater_my_friends.xml b/indra/newview/skins/default/xui/en/floater_my_friends.xml index a9a18f44c4..0ca4fc825a 100644 --- a/indra/newview/skins/default/xui/en/floater_my_friends.xml +++ b/indra/newview/skins/default/xui/en/floater_my_friends.xml @@ -28,6 +28,7 @@ label="Friends" layout="topleft" left="0" + help_topic="my_friends_friends_tab" name="friends_panel" width="370" /> <panel @@ -36,6 +37,7 @@ label="Groups" layout="topleft" left="0" + help_topic="my_friends_groups_tab" name="groups_panel" width="370" /> </tab_container> diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml index aaf7aecd6b..571f4149f0 100644 --- a/indra/newview/skins/default/xui/en/floater_post_process.xml +++ b/indra/newview/skins/default/xui/en/floater_post_process.xml @@ -23,6 +23,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="post_process_color_filter_tab" name="wmiColorFilterPanel" top="0" width="398"> @@ -184,6 +185,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="post_process_night_vision_tab" name="wmiNightVisionPanel" top_delta="-236" width="398"> @@ -279,6 +281,7 @@ label="Bloom" layout="topleft" left_delta="0" + help_topic="post_process_bloom_tab" name="wmiBloomPanel" top_delta="-236" width="398"> @@ -374,6 +377,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="post_process_extras_tab" name="Extras" top_delta="-236" width="398"> diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index d655c268b2..cf9e3a82fc 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -52,54 +52,63 @@ filename="panel_preferences_general.xml" label="General" layout="topleft" + help_topic="preferences_general_tab" name="general" /> <panel class="panel_preference" filename="panel_preferences_graphics1.xml" label="Graphics" layout="topleft" + help_topic="preferences_display_tab" name="display" /> <panel class="panel_preference" filename="panel_preferences_im.xml" label="Privacy" layout="topleft" + help_topic="preferences_im_tab" name="im" /> <panel class="panel_preference" filename="panel_preferences_audio.xml" label="Sound" layout="topleft" + help_topic="preferences_audio_tab" name="audio" /> <panel class="panel_preference" filename="panel_preferences_chat.xml" label="Chat" layout="topleft" + help_topic="preferences_chat_tab" name="chat" /> <panel class="panel_preference" filename="panel_preferences_popups.xml" label="Alerts" layout="topleft" + help_topic="preferences_msgs_tab" name="msgs" /> <panel class="panel_preference" filename="panel_preferences_input.xml" label="Setup" layout="topleft" + help_topic="preferences_input_tab" name="input" /> <panel class="panel_preference" filename="panel_preferences_advanced.xml" label="Advanced" layout="topleft" + help_topic="preferences_advanced1_tab" name="advanced1" /> <panel class="panel_preference" filename="panel_preferences_advanced2.xml" label="Move or Kill" layout="topleft" + help_topic="preferences_advanced2_tab" name="advanced2" /> </tab_container> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 8df0d759ce..d3ceb67ceb 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -761,6 +761,7 @@ label="General" layout="topleft" mouse_opaque="false" + help_topic="toolbox_general_tab" name="General" top="16"> <panel.string @@ -1211,7 +1212,7 @@ width="50"> F: </text> - </panel> + </panel> </panel> <panel border="false" @@ -1221,6 +1222,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_object_tab" name="Object" top="16" width="280"> @@ -2009,6 +2011,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_features_tab" name="Features" top_delta="0" width="280"> @@ -2246,6 +2249,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_texture_tab" name="Texture" top_delta="0" width="280"> @@ -2751,6 +2755,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_contents_tab" name="Contents" top_delta="0" width="280"> diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml index febfd1929e..6206ea29c2 100644 --- a/indra/newview/skins/default/xui/en/floater_water.xml +++ b/indra/newview/skins/default/xui/en/floater_water.xml @@ -75,6 +75,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="water_settings_tab" name="Settings" top="60" width="698"> @@ -465,6 +466,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="water_waves_tab" name="Waves" top_delta="44" width="698"> diff --git a/indra/newview/skins/default/xui/en/floater_windlight_options.xml b/indra/newview/skins/default/xui/en/floater_windlight_options.xml index 872bd704d5..2b3bc5f11a 100644 --- a/indra/newview/skins/default/xui/en/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/en/floater_windlight_options.xml @@ -84,6 +84,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="windlight_atmosphere_tab" name="Atmosphere" top="60" width="698"> @@ -519,6 +520,7 @@ label="Lighting" layout="topleft" left_delta="0" + help_topic="windlight_lighting_tab" name="Lighting" top_delta="4" width="698"> @@ -978,6 +980,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="windlight_clouds_tab" name="Clouds" top_delta="4" width="698"> diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 4386c0c5ee..8f88366842 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -30,6 +30,7 @@ label="Objects" layout="topleft" left="1" + help_topic="worldmap_objects_tab" name="objects_mapview" top="19" width="540" /> @@ -40,6 +41,7 @@ label="Terrain" layout="topleft" left_delta="0" + help_topic="worldmap_terrain_tab" name="terrain_mapview" top_delta="3" width="540" /> diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 999aa814b1..d61fcf529a 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -259,6 +259,7 @@ label="Planning" layout="topleft" left="1" + help_topic="group_money_planning_tab" name="group_money_planning_tab" top="5" width="265"> @@ -284,6 +285,7 @@ label="Details" layout="topleft" left_delta="0" + help_topic="group_money_details_tab" name="group_money_details_tab" top_delta="0" width="265"> @@ -329,6 +331,7 @@ label="Sales" layout="topleft" left_delta="0" + help_topic="group_money_sales_tab" name="group_money_sales_tab" top_delta="-1" width="265"> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 6435951157..bf861af4f2 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -174,6 +174,7 @@ label="Members" layout="topleft" left="1" + help_topic="roles_members_tab" name="members_sub_tab" tool_tip="Members" top="17" @@ -283,6 +284,7 @@ clicking on their names. label="Roles" layout="topleft" left_delta="0" + help_topic="roles_roles_tab" name="roles_sub_tab" class="panel_group_roles_subtab" top="17" @@ -400,6 +402,7 @@ including the Everyone and Owner Roles. label="Abilities" layout="topleft" left_delta="0" + help_topic="roles_actions_tab" name="actions_sub_tab" class="panel_group_actions_subtab" top="17" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 786c39c5e9..b51d53a1b4 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -60,6 +60,7 @@ color="DkGray" label="Nearby" layout="topleft" left="0" + help_topic="people_nearby_tab" name="nearby_panel" top="0" width="313"> @@ -109,6 +110,7 @@ color="DkGray" top="0" label="Friends" layout="topleft" + help_topic="people_friends_tab" name="friends_panel" width="313"> <accordion @@ -214,6 +216,7 @@ color="DkGray" label="Groups" top="0" layout="topleft" + help_topic="people_groups_tab" name="groups_panel" width="313"> <group_list @@ -301,6 +304,7 @@ color="DkGray" height="390" label="Recent" layout="topleft" + help_topic="people_recent_tab" name="recent_panel" width="313"> <avatar_list diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 1761c80a39..1ea6e1149d 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -41,6 +41,7 @@ height="326" layout="topleft" left="0" + help_topic="places_info_tab" name="panel_place_info" top="30" visible="false" /> @@ -48,6 +49,7 @@ height="25" layout="topleft" left="0" + help_topic="places_button_tab" name="button_panel" top_pad="10" width="313"> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index cf9ac3a94b..8a48574440 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -63,18 +63,21 @@ filename="panel_profile.xml" label="Profile" layout="topleft" + help_topic="profile_profile_tab" name="panel_profile" /> <panel class="panel_picks" filename="panel_picks.xml" label="Picks" layout="topleft" + help_topic="profile_picks_tab" name="panel_picks" /> <panel class="panel_notes" filename="panel_notes.xml" label="Notes & Privacy" layout="topleft" + help_topic="profile_notes_tab" name="panel_notes" /> </tab_container> </panel> |