diff options
| author | Lynx Linden <lynx@lindenlab.com> | 2009-12-02 21:19:45 +0000 | 
|---|---|---|
| committer | Lynx Linden <lynx@lindenlab.com> | 2009-12-02 21:19:45 +0000 | 
| commit | 669c069d5cf717b6b98e470a4d269f9ac9669f4c (patch) | |
| tree | b58dbac4627da4aca236043eb0140c5893120b0d | |
| parent | 7bb862c8c1aa56fea6e533d5a257b3d39b428cac (diff) | |
| parent | d491050c553ad2fa20f1ecadc37077fba3962b10 (diff) | |
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0
| -rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/newview/llfloatersearch.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelhome.cpp | 112 | ||||
| -rw-r--r-- | indra/newview/llpanelhome.h | 68 | ||||
| -rw-r--r-- | indra/newview/llsidetray.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_help_browser.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_search.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_side_tray.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml | 333 | 
9 files changed, 266 insertions, 284 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 73240cebbb..c2ca366ce4 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -316,6 +316,7 @@ set(viewer_SOURCE_FILES      llpanelgrouplandmoney.cpp      llpanelgroupnotices.cpp      llpanelgrouproles.cpp +    llpanelhome.cpp      llpanelimcontrolpanel.cpp      llpanelland.cpp      llpanellandaudio.cpp @@ -813,6 +814,7 @@ set(viewer_HEADER_FILES      llpanelgrouplandmoney.h      llpanelgroupnotices.h      llpanelgrouproles.h +    llpanelhome.h      llpanelimcontrolpanel.h      llpanelland.h      llpanellandaudio.h diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index c8ff36b4f4..4d3724a758 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -41,6 +41,7 @@  LLFloaterSearch::LLFloaterSearch(const LLSD& key) :  	LLFloater(key), +	LLViewerMediaObserver(),  	mBrowser(NULL)  {  	// declare a map that transforms a category name into diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp new file mode 100644 index 0000000000..de7a85836d --- /dev/null +++ b/indra/newview/llpanelhome.cpp @@ -0,0 +1,112 @@ +/**  +* @file llpanelhome.cpp +* @author Martin Reddy +* @brief The Home side tray panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +*  +* Copyright (c) 2009, Linden Research, Inc. +*  +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab.  Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +*  +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +*  +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +*  +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" +#include "llpanelhome.h" + +#include "llmediactrl.h" + +static LLRegisterPanelClassWrapper<LLPanelHome> t_people("panel_sidetray_home"); + +LLPanelHome::LLPanelHome() : +	LLPanel(), +	LLViewerMediaObserver(), +	mBrowser(NULL), +	mFirstView(true) +{ +} + +void LLPanelHome::onOpen(const LLSD& key) +{ +	// display the home page the first time we open the panel +	// *NOTE: this seems to happen during login. Can we avoid that? +	if (mFirstView && mBrowser) +	{ +		mBrowser->navigateHome(); +	} +	mFirstView = false; +} + +BOOL LLPanelHome::postBuild() +{ +    mBrowser = getChild<LLMediaCtrl>("browser"); +    if (mBrowser) +	{ +		mBrowser->addObserver(this); +		mBrowser->setTrusted(true); +		mBrowser->setHomePageUrl("http://www.secondlife.com/"); + +		childSetAction("back", onClickBack, this); +		childSetAction("forward", onClickForward, this); +		childSetAction("home", onClickHome, this); +	} + +    return TRUE; +} + +//static  +void LLPanelHome::onClickBack(void* user_data) +{ +	LLPanelHome *self = (LLPanelHome*)user_data; +	if (self && self->mBrowser) +	{ +		self->mBrowser->navigateBack(); +	} +} + +//static  +void LLPanelHome::onClickForward(void* user_data) +{ +	LLPanelHome *self = (LLPanelHome*)user_data; +	if (self && self->mBrowser) +	{ +		self->mBrowser->navigateForward(); +	} +} + +//static  +void LLPanelHome::onClickHome(void* user_data) +{ +	LLPanelHome *self = (LLPanelHome*)user_data; +	if (self && self->mBrowser) +	{ +		self->mBrowser->navigateHome(); +	} +} + +void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) +{ +	// update back/forward button state +	childSetEnabled("back", mBrowser->canNavigateBack()); +	childSetEnabled("forward", mBrowser->canNavigateForward()); +} diff --git a/indra/newview/llpanelhome.h b/indra/newview/llpanelhome.h new file mode 100644 index 0000000000..b5ca48b23f --- /dev/null +++ b/indra/newview/llpanelhome.h @@ -0,0 +1,68 @@ +/**  +* @file llpanelhome.h +* @author Martin Reddy +* @brief The Home side tray panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +*  +* Copyright (c) 2009, Linden Research, Inc. +*  +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab.  Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +*  +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +*  +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +*  +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#ifndef LL_LLPANELHOME_H +#define LL_LLPANELHOME_H + +#include "llpanel.h" +#include "llsd.h" +#include "llviewermediaobserver.h" + +class LLMediaCtrl; + +/** + * Base class for web-based Home side tray + */ +class LLPanelHome : +	public LLPanel, +	public LLViewerMediaObserver +{ +public: +	LLPanelHome(); + +    /*virtual*/ BOOL postBuild(); +    /*virtual*/ void onOpen(const LLSD& key); + +	static void onClickBack(void* user_data); +	static void onClickForward(void* user_data); +	static void onClickHome(void* user_data); + +private: +	// inherited from LLViewerMediaObserver +	/*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); + +    LLMediaCtrl *mBrowser; +	bool         mFirstView; +}; + +#endif //LL_LLPANELHOME_H diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index ee62d689b5..9333465052 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -66,37 +66,6 @@ static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title";  LLSideTray* LLSideTray::sInstance = 0; -class LLSideTrayInfoPanel: public LLPanel -{ -	 -public: -	LLSideTrayInfoPanel():LLPanel() -	{ -		setBorderVisible(true); -	} - -	BOOL handleHover(S32 x, S32 y, MASK mask) -	{ -		getWindow()->setCursor(UI_CURSOR_HAND); -		return TRUE; -	} - -	BOOL handleMouseUp(S32 x, S32 y, MASK mask) -	{ -		std::string name = getName(); -		onCommit(); -		LLSideTray::getInstance()->selectTabByName(name); -		return LLPanel::handleMouseUp(x,y,mask); -	} -	void reshape		(S32 width, S32 height, BOOL called_from_parent ) -	{ -		return LLPanel::reshape(width, height, called_from_parent); -	} - -}; - -static LLRegisterPanelClassWrapper<LLSideTrayInfoPanel> t_people("panel_sidetray_home_info"); -  LLSideTray* LLSideTray::getInstance()  {  	if (!sInstance) diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index f50ff01230..55a6179afb 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -43,6 +43,7 @@               left="0"               name="browser"               top="0" +             start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E"               width="570" />              <button               follows="bottom|left" diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index d9498586af..d363452204 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -47,6 +47,7 @@               left="0"               name="browser"               top="0" +             start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E"               width="570" />              <text               follows="bottom|left" diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 95242a9639..63b7112c17 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -23,6 +23,7 @@      background_visible="true"    >        <panel +        class="panel_sidetray_home"          name="panel_home"          filename="panel_sidetray_home_tab.xml"          label="home" diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml index 9839075862..4b841b0a09 100644 --- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml +++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml @@ -1,265 +1,92 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- Part of side tray, see that XML file for panel config --> +<!-- the web-based Home panel of the side tray -->  <panel   follows="all" - height="560" + height="570" + min_height="350"   label="home_tab" + help_topic="sidetray_home"   layout="topleft" + top="0" + left="0"   name="home_tab"   width="333"> -  <scroll_container -   color="DkGray" +  <layout_stack     follows="all" +   height="550"     layout="topleft" -   left="0" -   name="profile_scroll" -   opaque="true" -   height="560" -   width="333" -   top="0"> -  <panel -   background_visible="true" -   height="560" -   layout="topleft" -   name="profile_scroll_panel" -   top="0" -   left="0" -   width="311"> -    <panel -     background_visible="true" -     bg_alpha_color="DkGray2" -     class="panel_sidetray_home_info" -     follows="left|top|right" -     height="90" -     layout="topleft" -     left="15" -     top="17" -     name="sidebar_people" -     width="303"> -        <text -         follows="left|right|top" -         font="SansSerifBigBold" -         height="30" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_name" -         text_color="EmphasisColor" -         top="10" -         value="People" -         width="200" -         word_wrap="true" /> -        <icon -         follows="top|right" -         height="20" -         layout="topleft" -         name="tab_icon" -         right="-10" -         top="10" -         image_name="TabIcon_People_Selected" -         width="20" /> -        <text -         follows="left|right|bottom" -         height="90" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_description" -         right="-10" -         text_color="white" -         top="40" -         word_wrap="true"> -            Find your friends, your groups, contacts and people nearby. -        </text> -    </panel> -    <panel -     background_visible="true" -     bg_alpha_color="DkGray2" -     class="panel_sidetray_home_info" -     follows="left|top|right" -     height="90" -     layout="topleft" -     left="15" -     top_pad="15" -     name="sidebar_places" -     width="303"> -        <text -         follows="left|right|top" -         font="SansSerifBigBold" -         height="30" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_name" -         text_color="EmphasisColor" -         top="10" -         value="Places" -         width="200" -         word_wrap="true" /> -        <icon -         follows="top|right" -         height="20" -         layout="topleft" -         name="tab_icon" -         right="-10" -         top="10" -         width="20" -         image_name="TabIcon_Places_Selected"/> -        <text -         follows="all" -         height="90" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_description" -         right="-10" -         text_color="white" -         top="40" -         word_wrap="true"> -            Find places to go and places you've visited before. -        </text> -    </panel> -    <panel -     background_visible="true" -     bg_alpha_color="DkGray2" -     class="panel_sidetray_home_info" -     follows="left|top|right" -     height="90" -     layout="topleft" -     left="15" -     top_pad="15" -     name="sidebar_me" -     width="303"> -        <text -         follows="left|right|top" -         font="SansSerifBigBold" -         height="30" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_name" -         text_color="EmphasisColor" -         top="10" -         value="My Profile" -         width="200" -         word_wrap="true" /> -        <icon -         follows="top|right" -         height="20" -         layout="topleft" -         name="tab_icon" -         right="-10" -         top="10" -         width="20" -         image_name="TabIcon_Me_Selected"/> -        <text -         follows="all" -         height="90" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_description" -         right="-10" -         text_color="white" -         top="40" -         word_wrap="true"> -            Edit your public profile. -        </text> -    </panel> -    <panel -     background_visible="true" -     bg_alpha_color="DkGray2" -     class="panel_sidetray_home_info" -     follows="left|top|right" -     height="90" +   left="10" +   name="stack" +   top_pad="10" +   width="313"> +    <layout_panel +     auto_resize="false" +     height="20"       layout="topleft" -     left="15" -     top_pad="15" -     name="sidebar_appearance" -     width="303"> -        <text -         follows="left|right|top" -         font="SansSerifBigBold" -         height="30" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_name" -         text_color="EmphasisColor" -         top="10" -         value="My Appearance" -         width="200" -         word_wrap="true" /> -        <icon -         follows="top|right" -         height="20" -         layout="topleft" -         name="tab_icon" -         right="-10" -         top="10" -         width="20" -         image_name="TabIcon_Appearance_Selected"/> -        <text -         follows="all" -         height="90" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_description" -         right="-10" -         text_color="white" -         top="40" -         word_wrap="true"> -            Change your appearance and current look. -        </text> -    </panel> -    <panel -     background_visible="true" -     bg_alpha_color="DkGray2" -     class="panel_sidetray_home_info" -     follows="left|top|right" -     height="90" +     left="0" +     name="nav_controls" +     top="0" +     user_resize="false" +     width="313"> +      <button +       follows="left|top" +       enabled="false" +       height="20" +       label="Back" +       layout="topleft" +       tab_stop="false" +       left="0" +       name="back" +       top="0" +       width="70"> +        <button.commit_callback +         function="MediaBrowser.Back" /> +      </button> +      <button +       follows="left|top" +       height="20" +       enabled="false" +       label="Forward" +       layout="topleft" +       tab_stop="false" +       left_pad="3" +       name="forward" +       top_delta="0" +       width="70"> +        <button.commit_callback +         function="MediaBrowser.Forward" /> +      </button> +      <button +       follows="left|top" +       height="20" +       label="Home" +       layout="topleft" +       tab_stop="false" +       left_pad="2" +       name="home" +       top_delta="0" +       width="70"> +        <button.commit_callback +         function="MediaBrowser.Home" /> +      </button> +    </layout_panel> +    <layout_panel +     height="530"       layout="topleft" -     left="15" -     top_pad="15" -     name="sidebar_inventory" -     width="303"> -        <text -         follows="left|right|top" -         font="SansSerifBigBold" -         height="30" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_name" -         text_color="EmphasisColor" -         top="10" -         value="My Inventory" -         width="200" -         word_wrap="true" /> -        <icon -         follows="top|right" -         height="20" -         layout="topleft" -         name="tab_icon" -         right="-10" -         top="10" -         width="20" -         image_name="TabIcon_Things_Selected"/> -        <text -         follows="all" -         height="90" -         layout="topleft" -         left="10" -         mouse_opaque="false" -         name="tab_description" -         right="-10" -         text_color="white" -         top="40" -         word_wrap="true"> -            Browse your inventory. -        </text> -    </panel> -  </panel> -  </scroll_container> +     left_delta="0" +     name="browser_layout" +     top_delta="0" +     width="313"> +      <web_browser +       border_visible="false" +       follows="all" +       height="530" +       layout="topleft" +       left="0" +       name="browser" +       start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22 text=%22eeeeee%22%3E %3Ch3%3E %0D%0A%0D%0ALoading... %3C/h3%3E %3C/body%3E%3C/html%3E" +       top="0" +       width="313" /> +    </layout_panel> +  </layout_stack>  </panel> | 
