do some magic EXPECTO PATRONUM

This commit is contained in:
bittenbythedark
2019-03-01 16:23:30 +01:00
parent b80be075d7
commit 1c6bdf7aef
9 changed files with 52 additions and 49 deletions

View File

@@ -54,6 +54,8 @@
#include "llweb.h"
#include "llworldmap.h"
#include "lluictrlfactory.h"
#include "hippogridmanager.h"
#include "lfsimfeaturehandler.h"
//static
std::list<LLPanelEvent*> LLPanelEvent::sAllPanels;
@@ -69,6 +71,10 @@ LLPanelEvent::~LLPanelEvent()
sAllPanels.remove(this);
}
void enable_create(const std::string& url, LLView* btn)
{
btn->setEnabled(!url.empty());
}
BOOL LLPanelEvent::postBuild()
{
@@ -97,8 +103,15 @@ BOOL LLPanelEvent::postBuild()
mNotifyBtn = getChild<LLButton>( "notify_btn");
mNotifyBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickNotify,this));
mCreateEventBtn = getChild<LLButton>( "create_event_btn");
mCreateEventBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickCreateEvent,this));
mCreateEventBtn = getChild<LLButton>("create_event_btn");
mCreateEventBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickCreateEvent, this));
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
{
auto& inst(LFSimFeatureHandler::instance());
mCreateEventBtn->setEnabled(!inst.getEventsURL().empty());
inst.setEventsURLCallback(boost::bind(enable_create, _1, mCreateEventBtn));
}
return TRUE;
}
@@ -286,8 +299,8 @@ bool LLPanelEvent::callbackCreateEventWebPage(const LLSD& notification, const LL
if (0 == option)
{
LL_INFOS() << "Loading events page " << EVENTS_URL << LL_ENDL;
LLWeb::loadURL(EVENTS_URL);
const std::string& opensim_events = LFSimFeatureHandler::instance().getEventsURL();
LLWeb::loadURL(opensim_events.empty() ? EVENTS_URL : opensim_events);
}
return false;
}