PageRenderTime 45ms CodeModel.GetById 36ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/llfloatermodeluploadbase.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 58 lines | 27 code | 5 blank | 26 comment | 1 complexity | f74cfdea4673462db4a148e710ae0830 MD5 | raw file
 1/**
 2 * @file llfloatermodeluploadbase.cpp
 3 * @brief LLFloaterUploadModelBase class definition
 4 *
 5 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2011, 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 "llfloatermodeluploadbase.h"
30#include "llagent.h"
31#include "llviewerregion.h"
32#include "llnotificationsutil.h"
33
34LLFloaterModelUploadBase::LLFloaterModelUploadBase(const LLSD& key)
35:LLFloater(key),
36 mHasUploadPerm(false)
37{
38}
39
40void LLFloaterModelUploadBase::requestAgentUploadPermissions()
41{
42	std::string capability = "MeshUploadFlag";
43	std::string url = gAgent.getRegion()->getCapability(capability);
44
45	if (!url.empty())
46	{
47		llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <<llendl;
48		LLHTTPClient::get(url, new LLUploadModelPremissionsResponder(getPermObserverHandle()));
49	}
50	else
51	{
52		LLSD args;
53		args["CAPABILITY"] = capability;
54		LLNotificationsUtil::add("RegionCapabilityRequestError", args);
55		// BAP HACK avoid being blocked by broken server side stuff
56		mHasUploadPerm = true;
57	}
58}