PageRenderTime 30ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "llviewerprecompiledheaders.h"
  27. #include "llfloatermodeluploadbase.h"
  28. #include "llagent.h"
  29. #include "llviewerregion.h"
  30. #include "llnotificationsutil.h"
  31. LLFloaterModelUploadBase::LLFloaterModelUploadBase(const LLSD& key)
  32. :LLFloater(key),
  33. mHasUploadPerm(false)
  34. {
  35. }
  36. void LLFloaterModelUploadBase::requestAgentUploadPermissions()
  37. {
  38. std::string capability = "MeshUploadFlag";
  39. std::string url = gAgent.getRegion()->getCapability(capability);
  40. if (!url.empty())
  41. {
  42. llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <<llendl;
  43. LLHTTPClient::get(url, new LLUploadModelPremissionsResponder(getPermObserverHandle()));
  44. }
  45. else
  46. {
  47. LLSD args;
  48. args["CAPABILITY"] = capability;
  49. LLNotificationsUtil::add("RegionCapabilityRequestError", args);
  50. // BAP HACK avoid being blocked by broken server side stuff
  51. mHasUploadPerm = true;
  52. }
  53. }