diff options
author | dolphin <dolphin@lindenlab.com> | 2014-06-27 12:57:16 -0700 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2014-06-27 12:57:16 -0700 |
commit | dd309984d7566710b9ceaf8f6edf2de1672f4f9c (patch) | |
tree | 41d0b99eceeb52d4b05dfe10877e1b0b2b70fd90 /indra/newview | |
parent | 74634fb9dae5280c5a020b25f027a6f910053feb (diff) | |
parent | f80a41cf36f023aa0b5a7368d81dd237dafc8d4a (diff) |
Merge
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | indra/newview/llcompilequeue.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llexperienceassociationresponder.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llexperienceassociationresponder.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterexperienceprofile.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloaterexperiences.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llfloaterland.cpp | 30 | ||||
-rwxr-xr-x | indra/newview/llfloaterregioninfo.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelexperiencepicker.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelexperiences.cpp | 43 | ||||
-rw-r--r-- | indra/newview/llpanelexperiences.h | 12 | ||||
-rw-r--r-- | indra/newview/llpanelgroupexperiences.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llpreviewscript.cpp | 2 |
13 files changed, 103 insertions, 38 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1f88fdc4f0..cfa523da0d 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -232,6 +232,8 @@ set(viewer_SOURCE_FILES llfloatereditwater.cpp llfloaterenvironmentsettings.cpp llfloaterevent.cpp + llfloaterfacebook.cpp + llfloaterflickr.cpp llfloaterexperiencepicker.cpp llfloaterexperienceprofile.cpp llfloaterexperiences.cpp @@ -840,6 +842,8 @@ set(viewer_HEADER_FILES llfloatereditwater.h llfloaterenvironmentsettings.h llfloaterevent.h + llfloaterfacebook.h + llfloaterflickr.h llfloaterexperiencepicker.h llfloaterexperienceprofile.h llfloaterexperiences.h diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 9e554ba0eb..d9fd4509a5 100755 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -251,11 +251,11 @@ public: LLUUID mParent; - virtual void result(const LLSD& content) + /*virtual*/ void httpSuccess() { - sendResult(content); + sendResult(getContent()); } - virtual void error(U32 status, const std::string& reason) + /*virtual*/ void httpFailure() { sendResult(LLSD()); } diff --git a/indra/newview/llexperienceassociationresponder.cpp b/indra/newview/llexperienceassociationresponder.cpp index 33ada4906d..b50c81eedc 100644 --- a/indra/newview/llexperienceassociationresponder.cpp +++ b/indra/newview/llexperienceassociationresponder.cpp @@ -61,19 +61,19 @@ void ExperienceAssociationResponder::fetchAssociatedExperience(LLSD& request, ca } } -void ExperienceAssociationResponder::error( U32 status, const std::string& reason ) +void ExperienceAssociationResponder::httpFailure() { LLSD msg; - msg["error"]=(LLSD::Integer)status; - msg["message"]=reason; - LL_INFOS("ExperienceAssociation") << "Failed to look up associated experience: " << status << ": " << reason << LL_ENDL; + msg["error"]=(LLSD::Integer)getStatus(); + msg["message"]=getReason(); + LL_INFOS("ExperienceAssociation") << "Failed to look up associated experience: " << getStatus() << ": " << getReason() << LL_ENDL; sendResult(msg); } -void ExperienceAssociationResponder::result( const LLSD& content ) +void ExperienceAssociationResponder::httpSuccess() { - if(!content.has("experience")) + if(!getContent().has("experience")) { LLSD msg; @@ -83,7 +83,7 @@ void ExperienceAssociationResponder::result( const LLSD& content ) return; } - LLExperienceCache::get(content["experience"].asUUID(), boost::bind(&ExperienceAssociationResponder::sendResult, this, _1)); + LLExperienceCache::get(getContent()["experience"].asUUID(), boost::bind(&ExperienceAssociationResponder::sendResult, this, _1)); } diff --git a/indra/newview/llexperienceassociationresponder.h b/indra/newview/llexperienceassociationresponder.h index 8ff62a3dbc..2bdc3d251b 100644 --- a/indra/newview/llexperienceassociationresponder.h +++ b/indra/newview/llexperienceassociationresponder.h @@ -41,8 +41,8 @@ public: ExperienceAssociationResponder(callback_t callback); - virtual void result(const LLSD& content); - virtual void error(U32 status, const std::string& reason); + /*virtual*/ void httpSuccess(); + /*virtual*/ void httpFailure(); static void fetchAssociatedExperience(const LLUUID& object_it, const LLUUID& item_id, callback_t callback); diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index f80fdd9cfe..764d9088a1 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -138,9 +138,9 @@ public: HandleResponder(const LLHandle<T>& parent):mParent(parent){} LLHandle<T> mParent; - virtual void error(U32 status, const std::string& reason) + virtual void httpFailure() { - LL_WARNS() << "HandleResponder failed with code: " << status<< ", reason: " << reason << LL_ENDL; + LL_WARNS() << "HandleResponder failed with code: " << getStatus() << ", reason: " << getReason() << LL_ENDL; } }; @@ -151,12 +151,12 @@ public: { } - virtual void result(const LLSD& content) + virtual void httpSuccess() { LLFloaterExperienceProfile* parent=mParent.get(); if(parent) { - parent->onSaveComplete(content); + parent->onSaveComplete(getContent()); } } }; @@ -225,14 +225,14 @@ public: } - virtual void result(const LLSD& content) + virtual void httpSuccess() { if(mId.notNull()) { - post(getPermission(content)); + post(getPermission(getContent())); return; } - LLEventPumps::instance().obtain("experience_permission").post(content); + LLEventPumps::instance().obtain("experience_permission").post(getContent()); } void post( const char* perm ) @@ -257,7 +257,7 @@ public: { } - virtual void result(const LLSD& content) + virtual void httpSuccess() { LLFloaterExperienceProfile* parent = mParent.get(); if(!parent) @@ -275,7 +275,7 @@ public: if(url.empty()) enabled = false; } - if(enabled && content["status"].asBoolean()) + if(enabled && getContent()["status"].asBoolean()) { parent->getChild<LLLayoutPanel>(PNL_TOP)->setVisible(TRUE); parent->getChild<LLButton>(BTN_EDIT)->setVisible(TRUE); diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 98b26f5ac9..ac79c9ab43 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -43,7 +43,7 @@ #define SHOW_RECENT_TAB (0) -class LLExperienceListResponder : public LLCurl::Responder +class LLExperienceListResponder : public LLHTTPClient::Responder { public: typedef std::map<std::string, std::string> NameMap; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8d2d29ace1..4fda1ebb7d 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3012,21 +3012,31 @@ void LLPanelLandExperiences::refreshPanel(LLPanelExperienceListEditor* panel, U3 LLParcel *parcel = mParcel->getParcel(); // Display options - if (parcel == NULL || panel == NULL) + if (panel == NULL) { return; } - - LLAccessEntry::map entries = parcel->getExperienceKeysByType(xp_type); - LLAccessEntry::map::iterator it = entries.begin(); - LLSD ids = LLSD::emptyArray(); - for (/**/; it != entries.end(); ++it) + if (parcel == NULL) + { + // disable the panel + panel->setEnabled(FALSE); + panel->setExperienceIds(LLSD::emptyArray()); + } + else { - ids.append(it->second.mID); + // enable the panel + panel->setEnabled(TRUE); + LLAccessEntry::map entries = parcel->getExperienceKeysByType(xp_type); + LLAccessEntry::map::iterator it = entries.begin(); + LLSD ids = LLSD::emptyArray(); + for (/**/; it != entries.end(); ++it) + { + ids.append(it->second.mID); + } + panel->setExperienceIds(ids); + panel->setReadonly(!LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS)); + panel->refreshExperienceCounter(); } - panel->setExperienceIds(ids); - panel->setReadonly(!LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS)); - panel->refreshExperienceCounter(); } void LLPanelLandExperiences::refresh() diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 487610b797..f70152fc59 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3620,7 +3620,7 @@ void LLPanelRegionExperiences::processResponse( const LLSD& content ) } -class LLRegionExperienceResponder : public LLCurl::Responder +class LLRegionExperienceResponder : public LLHTTPClient::Responder { public: typedef boost::function<void (const LLSD&)> callback_t; diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index 3a55295d8c..0a572a8a5c 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -57,7 +57,7 @@ const static std::string columnSpace = " "; static LLPanelInjector<LLPanelExperiencePicker> t_panel_status("llpanelexperiencepicker"); -class LLExperienceSearchResponder : public LLCurl::Responder +class LLExperienceSearchResponder : public LLHTTPClient::Responder { public: LLUUID mQueryID; diff --git a/indra/newview/llpanelexperiences.cpp b/indra/newview/llpanelexperiences.cpp index 0d67dbf916..2885ef9305 100644 --- a/indra/newview/llpanelexperiences.cpp +++ b/indra/newview/llpanelexperiences.cpp @@ -38,9 +38,13 @@ #include "lllayoutstack.h" + static LLPanelInjector<LLPanelExperiences> register_experiences_panel("experiences_panel"); +//comparators +static const LLExperienceItemComparator NAME_COMPARATOR; + LLPanelExperiences::LLPanelExperiences( ) : mExperiencesList(NULL) { @@ -54,6 +58,7 @@ BOOL LLPanelExperiences::postBuild( void ) { mExperiencesList->setNoItemsCommentText(getString("no_experiences")); } + mExperiencesList->setComparator(&NAME_COMPARATOR); return TRUE; } @@ -81,6 +86,8 @@ void LLPanelExperiences::setExperienceList( const LLSD& experiences ) item->init(public_key); mExperiencesList->addItem(item, public_key); } + + mExperiencesList->sort(); } LLPanelExperiences* LLPanelExperiences::create(const std::string& name) @@ -112,6 +119,7 @@ void LLPanelExperiences::addExperience( const LLUUID& id ) item->init(id); mExperiencesList->addItem(item, id); + mExperiencesList->sort(); } } @@ -137,21 +145,32 @@ void LLPanelExperiences::enableButton( bool enable ) LLExperienceItem::LLExperienceItem() + : mName(NULL) { buildFromFile("panel_experience_list_item.xml"); } void LLExperienceItem::init( const LLUUID& id) { - getChild<LLUICtrl>("experience_name")->setValue(LLSLURL("experience", id, "profile").getSLURLString()); + mName = getChild<LLUICtrl>("experience_name"); + mName->setValue(LLSLURL("experience", id, "profile").getSLURLString()); } - LLExperienceItem::~LLExperienceItem() { } +std::string LLExperienceItem::getExperienceName() const +{ + if (mName) + { + return mName->getValue(); + } + + return ""; +} + void LLPanelSearchExperiences::doSearch() { @@ -169,3 +188,23 @@ BOOL LLPanelSearchExperiences::postBuild( void ) childSetAction("search_button", boost::bind(&LLPanelSearchExperiences::doSearch, this)); return TRUE; } + +bool LLExperienceItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const +{ + const LLExperienceItem* experience_item1 = dynamic_cast<const LLExperienceItem*>(item1); + const LLExperienceItem* experience_item2 = dynamic_cast<const LLExperienceItem*>(item2); + + if (!experience_item1 || !experience_item2) + { + LL_ERRS() << "item1 and item2 cannot be null" << LL_ENDL; + return true; + } + + std::string name1 = experience_item1->getExperienceName(); + std::string name2 = experience_item2->getExperienceName(); + + LLStringUtil::toUpper(name1); + LLStringUtil::toUpper(name2); + + return name1 < name2; +} diff --git a/indra/newview/llpanelexperiences.h b/indra/newview/llpanelexperiences.h index c525b1f548..0370499583 100644 --- a/indra/newview/llpanelexperiences.h +++ b/indra/newview/llpanelexperiences.h @@ -71,6 +71,16 @@ private: LLFlatListView* mExperiencesList; }; +class LLExperienceItemComparator : public LLFlatListView::ItemComparator +{ + LOG_CLASS(LLExperienceItemComparator); + +public: + LLExperienceItemComparator() {}; + virtual ~LLExperienceItemComparator() {}; + + virtual bool compare(const LLPanel* item1, const LLPanel* item2) const; +}; class LLExperienceItem : public LLPanel @@ -80,6 +90,8 @@ public: ~LLExperienceItem(); void init(const LLUUID& experience_id); + std::string getExperienceName() const; protected: + LLUICtrl* mName; }; #endif // LL_LLPANELEXPERIENCES_H diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 4f8c5eb94f..140a71a528 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -42,7 +42,7 @@ static LLPanelInjector<LLPanelGroupExperiences> t_panel_group_experiences("panel_group_experiences"); -class LLGroupExperienceResponder : public LLCurl::Responder +class LLGroupExperienceResponder : public LLHTTPClient::Responder { public: LLHandle<LLPanelGroupExperiences> mHandle; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 780c41172d..1732d4b3e5 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -123,7 +123,7 @@ static bool have_script_upload_cap(LLUUID& object_id) } -class ExperienceResponder : public LLCurl::Responder +class ExperienceResponder : public LLHTTPClient::Responder { public: ExperienceResponder(const LLHandle<LLLiveLSLEditor>& parent):mParent(parent) |