From 3d3f2fa4be8b28041b46983010547fb804ff8144 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 2 Dec 2009 14:25:18 +0000 Subject: DEV-43439: Initial web-based Home side tray panel Moved LLSideTrayInfoPanel from llsidetray.cpp into its own llpanelhome.{cpp|h} module. Updated the XUI for the Home tab to simply embed a web view. Thanks to Erica for the initial cut at this XUI. --- indra/newview/llpanelhome.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 indra/newview/llpanelhome.cpp (limited to 'indra/newview/llpanelhome.cpp') diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp new file mode 100644 index 0000000000..7f2d24ab34 --- /dev/null +++ b/indra/newview/llpanelhome.cpp @@ -0,0 +1,47 @@ +/** +* @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" + +static LLRegisterPanelClassWrapper t_people("panel_sidetray_home"); + +LLPanelHome::LLPanelHome() : + LLPanel() +{ +} + +void LLPanelHome::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + return LLPanel::reshape(width, height, called_from_parent); +} -- cgit v1.2.3 From a6b9765d6237f6a251eb875d38164b53c0eb2bd2 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 2 Dec 2009 16:52:19 +0000 Subject: DEV-43439: Initial implementation of web-based Home panel. The home panel now displays a web page - hardcoded to secondlife.com until we have something more relevant to display. --- indra/newview/llpanelhome.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelhome.cpp') diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index 7f2d24ab34..5e7b9ef6bb 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -34,14 +34,36 @@ #include "llviewerprecompiledheaders.h" #include "llpanelhome.h" +#include "llmediactrl.h" + static LLRegisterPanelClassWrapper t_people("panel_sidetray_home"); LLPanelHome::LLPanelHome() : - LLPanel() + LLPanel(), + mBrowser(NULL), + mFirstView(true) +{ +} + +void LLPanelHome::onOpen(const LLSD& key) { + // display the home page the first time we open the panel + if (mFirstView && mBrowser) + { + mBrowser->navigateHome(); + } + mFirstView = false; } -void LLPanelHome::reshape(S32 width, S32 height, BOOL called_from_parent) +BOOL LLPanelHome::postBuild() { - return LLPanel::reshape(width, height, called_from_parent); + mBrowser = getChild("browser"); + if (mBrowser) + { + mBrowser->setTrusted(true); + mBrowser->setHomePageUrl("http://www.secondlife.com/"); + } + + return TRUE; } + -- cgit v1.2.3 From d491050c553ad2fa20f1ecadc37077fba3962b10 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 2 Dec 2009 21:18:59 +0000 Subject: DEV-43439: Added navigation buttons to the Home side panel. Added Back, Forward, and Home buttons to the web view for the Home side panel. Still more work to do here, but the basic functionality is there; albeit hardcoded to secondlife.com. I notice that you can click Back on the first page. Seems to be an issue for the general media browser too. I'll file a JIRA for that. --- indra/newview/llpanelhome.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'indra/newview/llpanelhome.cpp') diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index 5e7b9ef6bb..de7a85836d 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -40,6 +40,7 @@ static LLRegisterPanelClassWrapper t_people("panel_sidetray_home"); LLPanelHome::LLPanelHome() : LLPanel(), + LLViewerMediaObserver(), mBrowser(NULL), mFirstView(true) { @@ -48,6 +49,7 @@ LLPanelHome::LLPanelHome() : 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(); @@ -60,10 +62,51 @@ BOOL LLPanelHome::postBuild() mBrowser = getChild("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()); +} -- cgit v1.2.3