diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloatermyenvironment.cpp | 75 | ||||
-rw-r--r-- | indra/newview/llfloatermyenvironment.h | 2 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.cpp | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_fixedenvironment.xml | 2 |
5 files changed, 62 insertions, 26 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 7d20a27813..01d4dd631d 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -590,7 +590,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data) S32 x(0), y(0); LLUI::getMousePositionLocal(mFramesSlider, &x, &y); - sliderpos = mFramesSlider->getSliderValueFromX(x); + sliderpos = mFramesSlider->getSliderValueFromPos(x, y); } else { @@ -657,7 +657,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderDoubleClick(S32 x, S32 y, MASK mask) void LLFloaterEditExtDayCycle::onFrameSliderMouseDown(S32 x, S32 y, MASK mask) { stopPlay(); - F32 sliderpos = mFramesSlider->getSliderValueFromX(x); + F32 sliderpos = mFramesSlider->getSliderValueFromPos(x, y); std::string slidername = mFramesSlider->getCurSlider(); @@ -681,7 +681,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderMouseDown(S32 x, S32 y, MASK mask) void LLFloaterEditExtDayCycle::onFrameSliderMouseUp(S32 x, S32 y, MASK mask) { - F32 sliderpos = mFramesSlider->getSliderValueFromX(x); + F32 sliderpos = mFramesSlider->getSliderValueFromPos(x, y); mTimeSlider->setCurSliderValue(sliderpos); selectFrame(sliderpos, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 35f43d57e2..6dcff7c264 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -157,9 +157,9 @@ LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) : mSelectedAsset() { mCommitCallbackRegistrar.add(ACTION_DOCREATE, [this](LLUICtrl *, const LLSD &userdata) { onDoCreate(userdata); }); - mCommitCallbackRegistrar.add(ACTION_DOEDIT, [](LLUICtrl *, const LLSD &userdata) { }); + mCommitCallbackRegistrar.add(ACTION_DOEDIT, [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->openSelected(); }); mCommitCallbackRegistrar.add(ACTION_DOAPPLY, [this](LLUICtrl *, const LLSD &userdata) { onDoApply(userdata.asString()); }); - mCommitCallbackRegistrar.add(ACTION_COPYPASTE, [](LLUICtrl *, const LLSD &userdata) { }); + mCommitCallbackRegistrar.add(ACTION_COPYPASTE, [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->doToSelected(userdata.asString()); }); mEnableCallbackRegistrar.add(ENABLE_ACTION, [this](LLUICtrl *, const LLSD &userdata) { return canAction(userdata.asString()); }); mEnableCallbackRegistrar.add(ENABLE_CANAPPLY, [this](LLUICtrl *, const LLSD &userdata) { return canApply(userdata.asString()); }); @@ -343,27 +343,49 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context) } } - bool LLFloaterMyEnvironment::canAction(const std::string &context) { -// uuid_vec_t selected; -// getSelectedIds(selected); -// -// if (selected.empty()) -// return false; -// -// if (context == PARAMETER_EDIT) -// { -// } -// else if (context == PARAMETER_COPY) -// { -// } -// else if (context == PARAMETER_PASTE) -// { -// } -// else if (context == PARAMETER_COPYUUID) -// { -// } + uuid_vec_t selected; + getSelectedIds(selected); + + if (selected.empty()) + return false; + + if (context == PARAMETER_EDIT) + { + return (selected.size() == 1) && isSettingSelected(selected.front()); + } + else if (context == PARAMETER_COPY) + { + for (std::vector<LLUUID>::iterator it = selected.begin(); it != selected.end(); it++) + { + if(!isSettingSelected(*it)) + { + return false; + } + } + return true; + } + else if (context == PARAMETER_PASTE) + { + if (!LLClipboard::instance().hasContents()) + return false; + + std::vector<LLUUID> ids; + LLClipboard::instance().pasteFromClipboard(ids); + for (std::vector<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++) + { + if (!isSettingSelected(*it)) + { + return false; + } + } + return (selected.size() == 1); + } + else if (context == PARAMETER_COPYUUID) + { + return (selected.size() == 1) && isSettingSelected(selected.front()); + } return false; } @@ -449,6 +471,17 @@ LLUUID LLFloaterMyEnvironment::findItemByAssetId(LLUUID asset_id, bool copyable_ return LLUUID::null; } +bool LLFloaterMyEnvironment::isSettingSelected(LLUUID item_id) +{ + LLInventoryItem* itemp = gInventory.getItem(item_id); + + if (itemp && itemp->getInventoryType() == LLInventoryType::IT_SETTINGS) + { + return true; + } + return false; +} + void LLFloaterMyEnvironment::getSelectedIds(uuid_vec_t& ids) const { LLInventoryPanel::selected_items_t items = mInventoryList->getSelectedItems(); diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 9d9659576d..10d64eaa93 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -76,6 +76,8 @@ private: void getSelectedIds(uuid_vec_t& ids) const; void refreshButtonStates(); + bool isSettingSelected(LLUUID item_id); + static LLUUID findItemByAssetId(LLUUID asset_id, bool copyable_only, bool ignore_library); #if 0 diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index a486a29aa2..3ec8e1e911 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -301,6 +301,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) BOOL is_complete = item->isFinished(); const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(item->getInventoryType()); const BOOL is_calling_card = (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD); + const BOOL is_settings = (item->getInventoryType() == LLInventoryType::IT_SETTINGS); const LLPermissions& perm = item->getPermissions(); const BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); @@ -637,7 +638,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) getChildView("NextOwnerLabel")->setEnabled(TRUE); getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); + getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions && !is_settings); getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); combo_sale_type->setEnabled(is_complete && is_for_sale); diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 36462dcd02..73f2683e84 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - can_minimize="false" can_tear_off="false" can_resize="false" can_drag_on_left="false" @@ -13,6 +12,7 @@ save_rect="true" title="Fixed Environment" save_visibility="false" + help_topic="fixed_environment" single_instance="true" width="750"> <layout_stack name="floater_stack" |