PageRenderTime 13ms CodeModel.GetById 6ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelhome.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 72 lines | 34 code | 9 blank | 29 comment | 3 complexity | 91f35c052888512b0543c7ee393d07c4 MD5 | raw file
 1/** 
 2* @file llpanelhome.cpp
 3* @author Martin Reddy
 4* @brief The Home side tray panel
 5*
 6* $LicenseInfo:firstyear=2009&license=viewerlgpl$
 7* Second Life Viewer Source Code
 8* Copyright (C) 2010, Linden Research, Inc.
 9* 
10* This library is free software; you can redistribute it and/or
11* modify it under the terms of the GNU Lesser General Public
12* License as published by the Free Software Foundation;
13* version 2.1 of the License only.
14* 
15* This library is distributed in the hope that it will be useful,
16* but WITHOUT ANY WARRANTY; without even the implied warranty of
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18* Lesser General Public License for more details.
19* 
20* You should have received a copy of the GNU Lesser General Public
21* License along with this library; if not, write to the Free Software
22* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23* 
24* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25* $/LicenseInfo$
26*/
27
28#include "llviewerprecompiledheaders.h"
29#include "llpanelhome.h"
30
31#include "llmediactrl.h"
32#include "llviewerhome.h"
33
34static LLRegisterPanelClassWrapper<LLPanelHome> t_home("panel_sidetray_home");
35
36LLPanelHome::LLPanelHome() :
37	LLPanel(),
38	LLViewerMediaObserver(),
39	mBrowser(NULL),
40	mFirstView(true)
41{
42}
43
44void LLPanelHome::onOpen(const LLSD& key)
45{
46	// display the home page the first time we open the panel
47	// *NOTE: this seems to happen during login. Can we avoid that?
48	if (mFirstView && mBrowser)
49	{
50		mBrowser->navigateHome();
51	}
52	mFirstView = false;
53}
54
55BOOL LLPanelHome::postBuild()
56{
57    mBrowser = getChild<LLMediaCtrl>("browser");
58    if (mBrowser)
59	{
60		// read the URL to display from settings.xml
61		std::string url = LLViewerHome::getHomeURL();
62
63		mBrowser->addObserver(this);
64		mBrowser->setHomePageUrl(url);
65	}
66
67    return TRUE;
68}
69
70void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event)
71{
72}