Skip to content
Snippets Groups Projects
Commit 97d0bc77 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Revert "Better event floater"

This reverts commit 56af0588.
parent 4d8c2d28
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
* @brief Display for events in the finder * @brief Display for events in the finder
* *
* $LicenseInfo:firstyear=2004&license=viewerlgpl$ * $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Alchemy Viewer Source Code * Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc. * Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2014, Cinder Roxley @ Second Life
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -28,20 +27,93 @@ ...@@ -28,20 +27,93 @@
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llfloaterevent.h" #include "llfloaterevent.h"
#include "llpaneleventinfo.h"
#include "message.h"
#include "llnotificationsutil.h"
#include "llui.h"
#include "llagent.h"
#include "llviewerwindow.h"
#include "llbutton.h"
#include "llcachename.h"
#include "llcommandhandler.h" // secondlife:///app/chat/ support
#include "lleventflags.h"
#include "llmediactrl.h"
#include "llexpandabletextbox.h"
#include "llfloater.h"
#include "llfloaterreg.h"
#include "llmediactrl.h"
#include "llfloaterworldmap.h"
#include "llinventorymodel.h"
#include "llslurl.h"
#include "lltextbox.h"
#include "lltexteditor.h"
#include "lluiconstants.h"
#include "llviewercontrol.h"
#include "llweb.h"
#include "llworldmap.h"
#include "llworldmapmessage.h"
#include "lluictrlfactory.h"
#include "lltrans.h"
LLFloaterEvent::LLFloaterEvent(const LLSD& key) LLFloaterEvent::LLFloaterEvent(const LLSD& key)
: LLFloater(key) : LLFloater(key),
, mEventId(0) LLViewerMediaObserver(),
mBrowser(NULL),
mEventID(0)
{
}
LLFloaterEvent::~LLFloaterEvent()
{
}
BOOL LLFloaterEvent::postBuild()
{ {
mBrowser = getChild<LLMediaCtrl>("browser");
if (mBrowser)
{
mBrowser->addObserver(this);
}
return TRUE;
}
void LLFloaterEvent::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event)
{
switch (event)
{
case MEDIA_EVENT_NAVIGATE_BEGIN:
getChild<LLUICtrl>("status_text")->setValue(getString("loading_text"));
break;
case MEDIA_EVENT_NAVIGATE_COMPLETE:
getChild<LLUICtrl>("status_text")->setValue(getString("done_text"));
break;
default:
break;
}
} }
void LLFloaterEvent::setEventID(const U32 event_id) void LLFloaterEvent::setEventID(const U32 event_id)
{ {
mEventId = event_id; mEventID = event_id;
if (event_id == 0) closeFloater();
if (event_id != 0)
{
LLSD subs;
subs["EVENT_ID"] = (S32)event_id;
// get the search URL and expand all of the substitutions
// (also adds things like [LANGUAGE], [VERSION], [OS], etc.)
std::string expanded_url = LLWeb::expandURLSubstitutions(gSavedSettings.getString("EventURL"), subs);
// and load the URL in the web view
mBrowser->navigateTo(expanded_url);
getChild<LLPanel>("event_panel")->onOpen(mEventId); }
} }
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
* @brief Display for events in the finder * @brief Display for events in the finder
* *
* $LicenseInfo:firstyear=2004&license=viewerlgpl$ * $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Alchemy Viewer Source Code * Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc. * Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2014, Cinder Roxley @ Second Life
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -29,17 +28,35 @@ ...@@ -29,17 +28,35 @@
#define LL_LLFLOATEREVENT_H #define LL_LLFLOATEREVENT_H
#include "llfloater.h" #include "llfloater.h"
#include "llviewermediaobserver.h"
class LLFloaterEvent final : public LLFloater
class LLMediaCtrl;
class LLButton;
class LLFloaterEvent final : public LLFloater,
public LLViewerMediaObserver
{ {
public: public:
LLFloaterEvent(const LLSD& key); LLFloaterEvent(const LLSD& key);
/*virtual*/ ~LLFloaterEvent() = default; /*virtual*/ ~LLFloaterEvent();
/*virtual*/ BOOL postBuild();
void setEventID(const U32 event_id); void setEventID(const U32 event_id);
private: U32 getEventID() { return mEventID; }
S32 mEventId;
protected:
/*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event);
U32 mEventID;
LLMediaCtrl* mBrowser;
}; };
#endif // LL_LLFLOATEREVENT_H #endif // LL_LLFLOATEREVENT_H
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater <floater
height="590" height="400"
can_resize="true" can_resize="true"
help_topic="event_details" help_topic="event_details"
label="Event" label="Event"
layout="topleft" layout="topleft"
name="Event" name="Event"
save_rect="true"
save_visibility="false" save_visibility="false"
title="EVENT DETAILS" title="EVENT DETAILS"
max_width="320" width="600">
width="313"> <floater.string
<panel name="loading_text">
follows="all" Loading...
name="event_panel" </floater.string>
top="0" <floater.string
bottom="590" name="done_text">
left="0" Done
right="313" </floater.string>
class="panel_event_info" <web_browser
filename="panel_event_info.xml" /> trusted_content="true"
follows="left|right|top|bottom"
layout="topleft"
left="10"
name="browser"
height="365"
width="580"
top="0"/>
<text
follows="bottom|left"
height="16"
layout="topleft"
left_delta="0"
name="status_text"
top_pad="10"
width="150" />
</floater> </floater>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment