Skip to content
Snippets Groups Projects
Commit 56af0588 authored by ¡Cinder! ㊝'s avatar ¡Cinder! ㊝ :speech_balloon:
Browse files

Better event floater

parent 8cc37990
Branches
Tags
1 merge request!71Sundry features from the Alchemy that made its own stuff
......@@ -3,8 +3,9 @@
* @brief Display for events in the finder
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Alchemy Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2014, Cinder Roxley @ Second Life
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,92 +28,20 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterevent.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"
#include "llpaneleventinfo.h"
LLFloaterEvent::LLFloaterEvent(const LLSD& key)
: LLFloater(key),
LLViewerMediaObserver(),
mBrowser(NULL),
mEventID(0)
{
}
LLFloaterEvent::~LLFloaterEvent()
{
}
BOOL LLFloaterEvent::postBuild()
{
mBrowser = getChild<LLMediaCtrl>("browser");
if (mBrowser)
: LLFloater(key)
, mEventId(0)
{
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)
{
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::ostringstream url;
url << gSavedSettings.getString("EventURL") << event_id << std::endl;
// and load the URL in the web view
mBrowser->navigateTo(url.str());
}
getChild<LLPanel>("event_panel")->onOpen(mEventId);
}
......@@ -3,8 +3,9 @@
* @brief Display for events in the finder
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Alchemy Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2014, Cinder Roxley @ Second Life
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -28,35 +29,17 @@
#define LL_LLFLOATEREVENT_H
#include "llfloater.h"
#include "llviewermediaobserver.h"
class LLMediaCtrl;
class LLButton;
class LLFloaterEvent final : public LLFloater,
public LLViewerMediaObserver
class LLFloaterEvent final : public LLFloater
{
public:
LLFloaterEvent(const LLSD& key);
/*virtual*/ ~LLFloaterEvent();
/*virtual*/ BOOL postBuild();
/*virtual*/ ~LLFloaterEvent() = default;
void setEventID(const U32 event_id);
U32 getEventID() { return mEventID; }
protected:
/*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event);
U32 mEventID;
LLMediaCtrl* mBrowser;
private:
S32 mEventId;
};
#endif // LL_LLFLOATEREVENT_H
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
height="400"
height="590"
can_resize="true"
help_topic="event_details"
label="Event"
layout="topleft"
name="Event"
save_rect="true"
save_visibility="false"
title="EVENT DETAILS"
width="600">
<floater.string
name="loading_text">
Loading...
</floater.string>
<floater.string
name="done_text">
Done
</floater.string>
<web_browser
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" />
max_width="320"
width="313">
<panel
follows="all"
name="event_panel"
top="0"
bottom="590"
left="0"
right="313"
class="panel_event_info"
filename="panel_event_info.xml" />
</floater>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment