PageRenderTime 35ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfloaterevent.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 119 lines | 74 code | 17 blank | 28 comment | 4 complexity | 5faf49500d95e3c8b233055aff87acee MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloaterevent.cpp
  3. * @brief Display for events in the finder
  4. *
  5. * $LicenseInfo:firstyear=2004&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #include "llviewerprecompiledheaders.h"
  27. #include "llfloaterevent.h"
  28. #include "message.h"
  29. #include "llnotificationsutil.h"
  30. #include "llui.h"
  31. #include "llagent.h"
  32. #include "llviewerwindow.h"
  33. #include "llbutton.h"
  34. #include "llcachename.h"
  35. #include "llcommandhandler.h" // secondlife:///app/chat/ support
  36. #include "lleventflags.h"
  37. #include "llmediactrl.h"
  38. #include "llexpandabletextbox.h"
  39. #include "llfloater.h"
  40. #include "llfloaterreg.h"
  41. #include "llmediactrl.h"
  42. #include "llfloaterworldmap.h"
  43. #include "llinventorymodel.h"
  44. #include "llsecondlifeurls.h"
  45. #include "llslurl.h"
  46. #include "lltextbox.h"
  47. #include "lltexteditor.h"
  48. #include "lluiconstants.h"
  49. #include "llviewercontrol.h"
  50. #include "llweb.h"
  51. #include "llworldmap.h"
  52. #include "llworldmapmessage.h"
  53. #include "lluictrlfactory.h"
  54. #include "lltrans.h"
  55. LLFloaterEvent::LLFloaterEvent(const LLSD& key)
  56. : LLFloater(key),
  57. LLViewerMediaObserver(),
  58. mBrowser(NULL),
  59. mEventID(0)
  60. {
  61. }
  62. LLFloaterEvent::~LLFloaterEvent()
  63. {
  64. }
  65. BOOL LLFloaterEvent::postBuild()
  66. {
  67. mBrowser = getChild<LLMediaCtrl>("browser");
  68. if (mBrowser)
  69. {
  70. mBrowser->addObserver(this);
  71. }
  72. return TRUE;
  73. }
  74. void LLFloaterEvent::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event)
  75. {
  76. switch (event)
  77. {
  78. case MEDIA_EVENT_NAVIGATE_BEGIN:
  79. getChild<LLUICtrl>("status_text")->setValue(getString("loading_text"));
  80. break;
  81. case MEDIA_EVENT_NAVIGATE_COMPLETE:
  82. getChild<LLUICtrl>("status_text")->setValue(getString("done_text"));
  83. break;
  84. default:
  85. break;
  86. }
  87. }
  88. void LLFloaterEvent::setEventID(const U32 event_id)
  89. {
  90. mEventID = event_id;
  91. if (event_id != 0)
  92. {
  93. LLSD subs;
  94. subs["EVENT_ID"] = (S32)event_id;
  95. // get the search URL and expand all of the substitutions
  96. // (also adds things like [LANGUAGE], [VERSION], [OS], etc.)
  97. std::ostringstream url;
  98. url << gSavedSettings.getString("EventURL") << event_id << "/" << std::endl;
  99. // and load the URL in the web view
  100. mBrowser->navigateTo(url.str());
  101. }
  102. }