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.
master
Lynx Linden 2009-12-02 16:52:19 +00:00
parent 3d3f2fa4be
commit a6b9765d62
6 changed files with 39 additions and 7 deletions

View File

@ -34,14 +34,36 @@
#include "llviewerprecompiledheaders.h"
#include "llpanelhome.h"
#include "llmediactrl.h"
static LLRegisterPanelClassWrapper<LLPanelHome> t_people("panel_sidetray_home");
LLPanelHome::LLPanelHome() :
LLPanel()
LLPanel(),
mBrowser(NULL),
mFirstView(true)
{
}
void LLPanelHome::reshape(S32 width, S32 height, BOOL called_from_parent)
void LLPanelHome::onOpen(const LLSD& key)
{
return LLPanel::reshape(width, height, called_from_parent);
// display the home page the first time we open the panel
if (mFirstView && mBrowser)
{
mBrowser->navigateHome();
}
mFirstView = false;
}
BOOL LLPanelHome::postBuild()
{
mBrowser = getChild<LLMediaCtrl>("browser");
if (mBrowser)
{
mBrowser->setTrusted(true);
mBrowser->setHomePageUrl("http://www.secondlife.com/");
}
return TRUE;
}

View File

@ -35,6 +35,9 @@
#define LL_LLPANELHOME_H
#include "llpanel.h"
#include "llsd.h"
class LLMediaCtrl;
/**
* Base class for web-based Home side tray
@ -44,7 +47,12 @@ class LLPanelHome : public LLPanel
public:
LLPanelHome();
void reshape(S32 width, S32 height, BOOL called_from_parent);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
LLMediaCtrl *mBrowser;
bool mFirstView;
};
#endif //LL_LLPANELHOME_H

View File

@ -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"

View File

@ -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"

View File

@ -23,6 +23,7 @@
background_visible="true"
>
<panel
class="panel_sidetray_home"
name="panel_home"
filename="panel_sidetray_home_tab.xml"
label="home"

View File

@ -11,7 +11,6 @@
name="home_tab"
width="333">
<panel
class="panel_sidetray_home"
follows="all"
height="550"
layout="topleft"
@ -26,8 +25,8 @@
height="550"
layout="topleft"
left="0"
name="sidetray_home_browser"
start_url="about:blank"
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" />
</panel>