diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcallingcard.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llgrouplist.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelprofile.cpp | 65 | ||||
-rw-r--r-- | indra/newview/llpanelprofile.h | 6 | ||||
-rw-r--r-- | indra/newview/llpanelprofileclassifieds.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llpanelprofileclassifieds.h | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile_classified.xml | 32 |
7 files changed, 64 insertions, 101 deletions
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 6d20b23e9f..89e2db9404 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -639,6 +639,7 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) if(mBuddyInfo.find(agent_related) != mBuddyInfo.end()) { (mBuddyInfo[agent_related])->setRightsTo(new_rights); + mChangedBuddyIDs.insert(agent_related); } } else diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 3a81d1557e..179a9d6368 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -153,7 +153,7 @@ BOOL LLGroupList::handleDoubleClick(S32 x, S32 y, MASK mask) // Handle double click only for the selected item in the list, skip clicks on empty space. if (handled) { - if (mDoubleClickSignal) + if (mDoubleClickSignal && getItemsRect().pointInRect(x, y)) { (*mDoubleClickSignal)(this, x, y, mask); } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 86b6163f45..1b3462176e 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1294,8 +1294,6 @@ BOOL LLPanelProfileNotes::postBuild() mEditObjectRights = getChild<LLCheckBoxCtrl>("objects_check"); mNotesEditor = getChild<LLTextEditor>("notes_edit"); - mOnlineStatus->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitRights, this)); - mMapRights->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitRights, this)); mEditObjectRights->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitRights, this)); mNotesEditor->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitNotes,this)); @@ -1315,6 +1313,7 @@ void LLPanelProfileNotes::onOpen(const LLSD& key) void LLPanelProfileNotes::apply() { onCommitNotes(); + applyRights(); } void LLPanelProfileNotes::fillRightsData() @@ -1347,40 +1346,48 @@ void LLPanelProfileNotes::onCommitNotes() } void LLPanelProfileNotes::rightsConfirmationCallback(const LLSD& notification, - const LLSD& response, S32 rights) + const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(), rights); - } - else + if (option != 0) { mEditObjectRights->setValue(mEditObjectRights->getValue().asBoolean() ? FALSE : TRUE); } } -void LLPanelProfileNotes::confirmModifyRights(bool grant, S32 rights) +void LLPanelProfileNotes::confirmModifyRights(bool grant) { LLSD args; args["NAME"] = LLSLURL("agent", getAvatarId(), "completename").getSLURLString(); - if (grant) - { - LLNotificationsUtil::add("GrantModifyRights", args, LLSD(), - boost::bind(&LLPanelProfileNotes::rightsConfirmationCallback, this, - _1, _2, rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(), - boost::bind(&LLPanelProfileNotes::rightsConfirmationCallback, this, - _1, _2, rights)); - } + + LLNotificationsUtil::add(grant ? "GrantModifyRights" : "RevokeModifyRights", args, LLSD(), + boost::bind(&LLPanelProfileNotes::rightsConfirmationCallback, this, _1, _2)); + } void LLPanelProfileNotes::onCommitRights() { + const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); + + if (!buddy_relationship) + { + LL_WARNS("LegacyProfile") << "Trying to modify rights for non-friend avatar. Skipped." << LL_ENDL; + return; + } + + bool allow_modify_objects = mEditObjectRights->getValue().asBoolean(); + + // if modify objects checkbox clicked + if (buddy_relationship->isRightGrantedTo( + LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) + { + confirmModifyRights(allow_modify_objects); + } +} + +void LLPanelProfileNotes::applyRights() +{ const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); if (!buddy_relationship) @@ -1405,20 +1412,7 @@ void LLPanelProfileNotes::onCommitRights() rights |= LLRelationship::GRANT_MODIFY_OBJECTS; } - bool allow_modify_objects = mEditObjectRights->getValue().asBoolean(); - - // if modify objects checkbox clicked - if (buddy_relationship->isRightGrantedTo( - LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) - { - confirmModifyRights(allow_modify_objects, rights); - } - // only one checkbox can trigger commit, so store the rest of rights - else - { - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( - getAvatarId(), rights); - } + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(), rights); } void LLPanelProfileNotes::processProperties(void* data, EAvatarProcessorType type) @@ -1597,6 +1591,7 @@ void LLPanelProfile::apply() mPanelInterests->apply(); mPanelPicks->apply(); mPanelNotes->apply(); + mPanelClassifieds->apply(); //KC - Classifieds handles this itself } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 9eeb926549..d4f9499894 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -371,12 +371,14 @@ protected: */ void fillRightsData(); - void rightsConfirmationCallback(const LLSD& notification, const LLSD& response, S32 rights); - void confirmModifyRights(bool grant, S32 rights); + void rightsConfirmationCallback(const LLSD& notification, const LLSD& response); + void confirmModifyRights(bool grant); void onCommitRights(); void onCommitNotes(); void enableCheckboxes(bool enable); + void applyRights(); + LLCheckBoxCtrl* mOnlineStatus; LLCheckBoxCtrl* mMapRights; LLCheckBoxCtrl* mEditObjectRights; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 3a5347018d..079867d03f 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -356,7 +356,20 @@ bool LLPanelProfileClassifieds::canDeleteClassified() return (mTabContainer->getTabCount() > 0); } - +void LLPanelProfileClassifieds::apply() +{ + if (getIsLoaded()) + { + for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + { + LLPanelProfileClassified* classified_panel = dynamic_cast<LLPanelProfileClassified*>(mTabContainer->getPanelByIndex(tab_idx)); + if (classified_panel && classified_panel->isDirty() && !classified_panel->isNew()) + { + classified_panel->doSave(); + } + } + } +} //----------------------------------------------------------------------------- // LLDispatchClassifiedClickThrough //----------------------------------------------------------------------------- @@ -406,6 +419,7 @@ LLPanelProfileClassified::LLPanelProfileClassified() , mTeleportClicksNew(0) , mMapClicksNew(0) , mProfileClicksNew(0) + , mPriceForListing(0) , mSnapshotCtrl(NULL) , mPublishFloater(NULL) , mIsNew(false) @@ -462,8 +476,6 @@ BOOL LLPanelProfileClassified::postBuild() mLocationEdit = getChild<LLUICtrl>("classified_location_edit"); mCategoryCombo = getChild<LLComboBox>("category_edit"); mContentTypeCombo = getChild<LLComboBox>("content_type_edit"); - mPriceEdit = getChild<LLUICtrl>("price_for_listing_edit"); - mPricelabel = getChild<LLUICtrl>("price_for_listing_edit_label"); mAutoRenewEdit = getChild<LLUICtrl>("auto_renew_edit"); mSaveButton = getChild<LLButton>("save_changes_btn"); @@ -500,7 +512,6 @@ BOOL LLPanelProfileClassified::postBuild() mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); - mPriceEdit->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mAutoRenewEdit->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); return TRUE; @@ -600,9 +611,6 @@ void LLPanelProfileClassified::onOpen(const LLSD& key) } - mPricelabel->setVisible(is_new); - mPriceEdit->setVisible(is_new); - bool is_self = getSelfProfile(); getChildView("auto_renew_layout_panel")->setVisible(is_self); getChildView("clickthrough_layout_panel")->setVisible(is_self); @@ -647,8 +655,6 @@ void LLPanelProfileClassified::processProperties(void* data, EAvatarProcessorTyp static LLUIString price_str = getString("l$_price"); price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing)); mPriceText->setValue(LLSD(price_str)); - mPriceEdit->setValue(c_info->price_for_listing); - mPriceEdit->setEnabled(isNew()); static std::string date_fmt = getString("date_fmt"); std::string date_str = date_fmt; @@ -729,7 +735,6 @@ void LLPanelProfileClassified::enableEditing(bool enable) mSetLocationButton->setEnabled(enable); mCategoryCombo->setEnabled(enable); mContentTypeCombo->setEnabled(enable); - mPriceEdit->setEnabled(enable); mAutoRenewEdit->setEnabled(enable); } @@ -740,8 +745,7 @@ void LLPanelProfileClassified::resetControls() mCategoryCombo->setCurrentByIndex(0); mContentTypeCombo->setCurrentByIndex(0); mAutoRenewEdit->setValue(false); - mPriceEdit->setValue(MINIMUM_PRICE_FOR_LISTING); - mPriceEdit->setEnabled(TRUE); + mPriceForListing = MINIMUM_PRICE_FOR_LISTING; } void LLPanelProfileClassified::onEditClick() @@ -759,8 +763,7 @@ void LLPanelProfileClassified::onCancelClick() mCategoryCombo->setCurrentByIndex(0); mContentTypeCombo->setCurrentByIndex(0); mAutoRenewEdit->setValue(false); - mPriceEdit->setValue(MINIMUM_PRICE_FOR_LISTING); - mPriceEdit->setEnabled(TRUE); + mPriceForListing = MINIMUM_PRICE_FOR_LISTING; } else { @@ -850,10 +853,11 @@ void LLPanelProfileClassified::resetData() mMapClicksNew = 0; mProfileClicksNew = 0; + mPriceForListing = MINIMUM_PRICE_FOR_LISTING; + mCategoryText->setValue(LLStringUtil::null); mContentTypeText->setValue(LLStringUtil::null); getChild<LLUICtrl>("click_through_text")->setValue(LLStringUtil::null); - mPriceEdit->setValue(LLStringUtil::null); mEditButton->setValue(LLStringUtil::null); getChild<LLUICtrl>("creation_date")->setValue(LLStringUtil::null); mContentTypeM->setVisible(FALSE); @@ -1080,7 +1084,6 @@ BOOL LLPanelProfileClassified::isDirty() const dirty |= mCategoryCombo->isDirty(); dirty |= mContentTypeCombo->isDirty(); dirty |= mAutoRenewEdit->isDirty(); - dirty |= mPriceEdit->isDirty(); return dirty; } @@ -1097,7 +1100,6 @@ void LLPanelProfileClassified::resetDirty() mCategoryCombo->resetDirty(); mContentTypeCombo->resetDirty(); mAutoRenewEdit->resetDirty(); - mPriceEdit->resetDirty(); } bool LLPanelProfileClassified::canClose() @@ -1208,16 +1210,6 @@ std::string LLPanelProfileClassified::makeClassifiedName() return name; } -S32 LLPanelProfileClassified::getPriceForListing() -{ - return mPriceEdit->getValue().asInteger(); -} - -void LLPanelProfileClassified::setPriceForListing(S32 price) -{ - mPriceEdit->setValue(price); -} - void LLPanelProfileClassified::onSetLocationClick() { setPosGlobal(gAgent.getPositionGlobal()); diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 9bf9ff4a6b..31ef1c65b3 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -88,6 +88,8 @@ public: /*virtual*/ void updateData(); + /*virtual*/ void apply(); + private: void onClickNewBtn(); void onClickDelete(); @@ -183,7 +185,7 @@ public: bool getAutoRenew(); - S32 getPriceForListing(); + S32 getPriceForListing() { return mPriceForListing; } void setEditMode(BOOL edit_mode); bool getEditMode() {return mEditMode;} @@ -203,6 +205,8 @@ public: const LLVector3d& global_pos, const std::string& sim_name); + void doSave(); + protected: /*virtual*/ void resetData(); @@ -235,7 +239,7 @@ protected: std::string makeClassifiedName(); - void setPriceForListing(S32 price); + void setPriceForListing(S32 price) { mPriceForListing = price; } U8 getFlags(); @@ -248,8 +252,6 @@ protected: void onSetLocationClick(); void onChange(); - void doSave(); - void onPublishFloaterPublishClicked(); void onTexturePickerMouseEnter(); @@ -316,8 +318,6 @@ private: LLIconCtrl* mContentTypeG; LLComboBox* mContentTypeCombo; LLUICtrl* mPriceText; - LLUICtrl* mPriceEdit; - LLUICtrl* mPricelabel; LLUICtrl* mAutoRenewText; LLUICtrl* mAutoRenewEdit; @@ -356,6 +356,7 @@ private: S32 mMapClicksNew; S32 mProfileClicksNew; + S32 mPriceForListing; static void handleSearchStatResponse(LLUUID classifiedId, LLSD result); diff --git a/indra/newview/skins/default/xui/en/panel_profile_classified.xml b/indra/newview/skins/default/xui/en/panel_profile_classified.xml index 6a0489ae97..741ea49b1e 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_classified.xml @@ -464,6 +464,7 @@ font="SansSerif" max_length_bytes="30" prevalidate_callback="ascii" + commit_on_focus_lost="false" text_color="black" /> <text @@ -618,36 +619,7 @@ width="250" layout="topleft" /> - <text - name="price_for_listing_edit_label" - value="Price for listing:" - top_pad="10" - left="10" - height="10" - width="120" - follows="left|top" - layout="topleft" - text_color="white" - /> - <spinner - name="price_for_listing_edit" - label="L$" - value="50" - tool_tip="Price for listing." - top_delta="0" - left_pad="0" - height="23" - width="105" - follows="left|top" - layout="topleft" - decimal_digits="0" - halign="left" - increment="1" - label_width="20" - max_val="99999" - min_val="50" - /> - </panel> + </panel> </panel> </scroll_container> <layout_stack |