PageRenderTime 29ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "llviewerprecompiledheaders.h"
  28. #include "llpanelhome.h"
  29. #include "llmediactrl.h"
  30. #include "llviewerhome.h"
  31. static LLRegisterPanelClassWrapper<LLPanelHome> t_home("panel_sidetray_home");
  32. LLPanelHome::LLPanelHome() :
  33. LLPanel(),
  34. LLViewerMediaObserver(),
  35. mBrowser(NULL),
  36. mFirstView(true)
  37. {
  38. }
  39. void LLPanelHome::onOpen(const LLSD& key)
  40. {
  41. // display the home page the first time we open the panel
  42. // *NOTE: this seems to happen during login. Can we avoid that?
  43. if (mFirstView && mBrowser)
  44. {
  45. mBrowser->navigateHome();
  46. }
  47. mFirstView = false;
  48. }
  49. BOOL LLPanelHome::postBuild()
  50. {
  51. mBrowser = getChild<LLMediaCtrl>("browser");
  52. if (mBrowser)
  53. {
  54. // read the URL to display from settings.xml
  55. std::string url = LLViewerHome::getHomeURL();
  56. mBrowser->addObserver(this);
  57. mBrowser->setHomePageUrl(url);
  58. }
  59. return TRUE;
  60. }
  61. void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event)
  62. {
  63. }