PageRenderTime 344ms CodeModel.GetById 161ms app.highlight 6ms RepoModel.GetById 175ms 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
  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
 27#include "llviewerprecompiledheaders.h"
 28
 29#include "llfloaterevent.h"
 30
 31#include "message.h"
 32#include "llnotificationsutil.h"
 33#include "llui.h"
 34
 35#include "llagent.h"
 36#include "llviewerwindow.h"
 37#include "llbutton.h"
 38#include "llcachename.h"
 39#include "llcommandhandler.h"	// secondlife:///app/chat/ support
 40#include "lleventflags.h"
 41#include "llmediactrl.h"
 42#include "llexpandabletextbox.h"
 43#include "llfloater.h"
 44#include "llfloaterreg.h"
 45#include "llmediactrl.h"
 46#include "llfloaterworldmap.h"
 47#include "llinventorymodel.h"
 48#include "llsecondlifeurls.h"
 49#include "llslurl.h"
 50#include "lltextbox.h"
 51#include "lltexteditor.h"
 52#include "lluiconstants.h"
 53#include "llviewercontrol.h"
 54#include "llweb.h"
 55#include "llworldmap.h"
 56#include "llworldmapmessage.h"
 57#include "lluictrlfactory.h"
 58#include "lltrans.h"
 59
 60
 61LLFloaterEvent::LLFloaterEvent(const LLSD& key)
 62	: LLFloater(key),
 63      LLViewerMediaObserver(),
 64      mBrowser(NULL),
 65	  mEventID(0)
 66{
 67}
 68
 69
 70LLFloaterEvent::~LLFloaterEvent()
 71{
 72}
 73
 74
 75BOOL LLFloaterEvent::postBuild()
 76{
 77	mBrowser = getChild<LLMediaCtrl>("browser");
 78	if (mBrowser)
 79	{
 80		mBrowser->addObserver(this);
 81	}
 82
 83	return TRUE;
 84}
 85
 86void LLFloaterEvent::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event)
 87{
 88	switch (event) 
 89	{
 90		case MEDIA_EVENT_NAVIGATE_BEGIN:
 91			getChild<LLUICtrl>("status_text")->setValue(getString("loading_text"));
 92			break;
 93			
 94		case MEDIA_EVENT_NAVIGATE_COMPLETE:
 95			getChild<LLUICtrl>("status_text")->setValue(getString("done_text"));
 96			break;
 97			
 98		default:
 99			break;
100	}
101}
102
103void LLFloaterEvent::setEventID(const U32 event_id)
104{
105	mEventID = event_id;
106
107	if (event_id != 0)
108	{
109		LLSD subs;
110		subs["EVENT_ID"] = (S32)event_id;
111        // get the search URL and expand all of the substitutions                                                       
112        // (also adds things like [LANGUAGE], [VERSION], [OS], etc.)                                                    
113		std::ostringstream url;
114		url <<  gSavedSettings.getString("EventURL") << event_id << "/" << std::endl;
115		// and load the URL in the web view                                                                             
116        mBrowser->navigateTo(url.str());
117		
118	}
119}