diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-18 16:57:52 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-18 16:57:52 +0000 |
commit | b5f9e437ea17dd9f1f3e186d6f2bf7108c279ce1 (patch) | |
tree | f5a73b7cab3cbe4e4dcf112bc34339472a74e83a | |
parent | 67af47fd8676718aff3f75d28b1cd9dd77e2ca3e (diff) | |
parent | 8e134590e6651ba36ba9d38ccf10fae249645299 (diff) |
PE merge.
-rw-r--r-- | indra/llui/llbutton.h | 2 | ||||
-rw-r--r-- | indra/llui/llsearcheditor.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llchathistory.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llgrouplist.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llmoveview.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llnotificationhandler.h | 5 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 112 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_script.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_avatar_list_item.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 1 |
17 files changed, 142 insertions, 95 deletions
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 8f35db1007..6a0d8ef3d6 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -257,6 +257,8 @@ public: void setForcePressedState(bool b) { mForcePressedState = b; } + void setAutoResize(bool auto_resize) { mAutoResize = auto_resize; } + protected: LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; } LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; } diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index 491eeeab54..e6c5e3f334 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -155,7 +155,7 @@ void LLSearchEditor::setFocus( BOOL b ) void LLSearchEditor::onClearButtonClick(const LLSD& data) { - setText(LLStringUtil::null); + mSearchEditor->selectAll(); mSearchEditor->doDelete(); // force keystroke callback } diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cf5ac6b2e6..8fb9decf7b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -721,22 +721,26 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL notify_box->setFollowsRight(); notify_box->setFollowsTop(); - LLButton* accept_button = notify_box->getChild<LLButton> ("Accept", - TRUE); - if (accept_button != NULL) + ctrl_list_t ctrls = notify_box->getControlPanel()->getCtrlList(); + S32 offset = 0; + for (ctrl_list_t::iterator it = ctrls.begin(); it != ctrls.end(); it++) { - accept_button->setFollowsNone(); - accept_button->setOrigin(2*HPAD, accept_button->getRect().mBottom); - } - - LLButton* decline_button = notify_box->getChild<LLButton> ( - "Decline", TRUE); - if (accept_button != NULL && decline_button != NULL) - { - decline_button->setFollowsNone(); - decline_button->setOrigin(4*HPAD - + accept_button->getRect().getWidth(), - decline_button->getRect().mBottom); + LLButton * button = dynamic_cast<LLButton*> (*it); + if (button != NULL) + { + button->setOrigin( offset, + button->getRect().mBottom); + button->setLeftHPad(2 * HPAD); + button->setRightHPad(2 * HPAD); + // set zero width before perform autoResize() + button->setRect(LLRect(button->getRect().mLeft, + button->getRect().mTop, button->getRect().mLeft, + button->getRect().mBottom)); + button->setAutoResize(true); + button->autoResize(); + offset += 2 * HPAD + button->getRect().getWidth(); + button->setFollowsNone(); + } } LLTextEditor* text_editor = notify_box->getChild<LLTextEditor>("text_editor_box", TRUE); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0b7e3fee30..853693b927 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -315,7 +315,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); - mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1)); mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); @@ -674,21 +673,6 @@ void LLFloaterPreference::refreshEnabledGraphics() } } -void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl) -{ - // get our UI widgets - LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; - - LLTextBox* m1 = getChild<LLTextBox>("DrawDistanceMeterText1"); - LLTextBox* m2 = getChild<LLTextBox>("DrawDistanceMeterText2"); - - // toggle the two text boxes based on whether we have 1 or two digits - F32 val = slider->getValueF32(); - bool two_digits = val < 100; - m1->setVisible(two_digits); - m2->setVisible(!two_digits); -} - void LLFloaterPreference::onClickBrowserClearCache() { LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 1ed1113f4d..bcfb516b81 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -287,7 +287,7 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata) return gAgent.getGroupID() != selected_group_id; if (userdata.asString() == "call") - return LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking(); + return real_group_selected && LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking(); return real_group_selected; } diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 4bf2bac649..97e2b5b86e 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -250,6 +250,12 @@ void LLFloaterMove::setSittingMode(BOOL bSitting) else { LLPanelStandStopFlying::clearStandStopFlyingMode(LLPanelStandStopFlying::SSFM_STAND); + + // show "Stop Flying" button if needed. EXT-871 + if (gAgent.getFlying()) + { + LLPanelStandStopFlying::setStandStopFlyingMode(LLPanelStandStopFlying::SSFM_STOP_FLYING); + } } enableInstance(!bSitting); } @@ -684,10 +690,6 @@ void LLPanelStandStopFlying::onStandButtonClick() gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); setFocus(FALSE); // EXT-482 - - BOOL fly = gAgent.getFlying(); - mStopFlyingButton->setVisible(fly); - setVisible(fly); } void LLPanelStandStopFlying::onStopFlyingButtonClick() diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 5f4768e321..0d5c431d75 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -334,11 +334,6 @@ public: * Adds notification panel to the IM floater. */ static void addNotifPanelToIM(const LLNotificationPtr& notification); - - /** - * Reloads IM floater messages. - */ - static void reloadIMFloaterMessages(const LLNotificationPtr& notification); }; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 35569cffac..c187ee7bf2 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -94,7 +94,8 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) // static bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) { - return OFFER_FRIENDSHIP == notification->getName(); + return OFFER_FRIENDSHIP == notification->getName() + || USER_GIVE_ITEM == notification->getName(); } @@ -265,31 +266,8 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) offer["from_id"] = notification->getPayload()["from_id"]; offer["from"] = name; offer["time"] = LLLogChat::timestamp(true); + offer["index"] = (LLSD::Integer)session->mMsgs.size(); session->mMsgs.push_front(offer); LLIMFloater::show(session_id); } - -// static -void LLHandlerUtil::reloadIMFloaterMessages( - const LLNotificationPtr& notification) -{ - LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id); - LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>( - "impanel", session_id); - if (im_floater != NULL) - { - LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession( - session_id); - if(session != NULL) - { - session->mMsgs.clear(); - std::list<LLSD> chat_history; - LLLogChat::loadAllHistory(session->mHistoryFileName, chat_history); - session->addMessagesFromHistory(chat_history); - } - - im_floater->reloadMessages(); - } -} diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 8c13b0fafa..8ebd5de258 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -155,10 +155,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } else { - if (LLHandlerUtil::canAddNotifPanelToIM(notification)) - { - LLHandlerUtil::reloadIMFloaterMessages(notification); - } mChannel->killToastByNotificationID(notification->getID()); } } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 8eb0b69491..2ff2597f08 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -351,7 +351,14 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) if (mNoPicks && mNoClassifieds) { - childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText")); + if(getAvatarId() == gAgentID) + { + childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText")); + } + else + { + childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText")); + } } } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 9b46a59782..22a1ef94a7 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -249,6 +249,7 @@ void LLPreviewTexture::draw() } } } + } @@ -283,18 +284,52 @@ void LLPreviewTexture::saveAs() // virtual void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) { -// mLastHeight = 0; -// mLastWidth = 0; - mUpdateDimensions = TRUE; LLPreview::reshape(width, height, called_from_parent); + + LLRect dim_rect; + childGetRect("dimensions", dim_rect); + + S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; + + // add space for dimensions and aspect ratio + S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD; + + LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0); + client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); + client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ; + + S32 client_width = client_rect.getWidth(); + S32 client_height = client_rect.getHeight(); + + if (mAspectRatio > 0.f) + { + if(mAspectRatio > 1.f) + { + client_height = llceil((F32)client_width / mAspectRatio); + if(client_height > client_rect.getHeight()) + { + client_height = client_rect.getHeight(); + client_width = llceil((F32)client_height * mAspectRatio); + } + } + else//mAspectRatio < 1.f + { + client_width = llceil((F32)client_height * mAspectRatio); + if(client_width > client_rect.getWidth()) + { + client_width = client_rect.getWidth(); + client_height = llceil((F32)client_width / mAspectRatio); + } + } + } + + mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height); + } // virtual void LLPreviewTexture::onFocusReceived() { - mLastHeight = 0; - mLastWidth = 0; - mUpdateDimensions = TRUE; LLPreview::onFocusReceived(); } @@ -365,13 +400,19 @@ void LLPreviewTexture::updateDimensions() { if (!mImage) return; + + if(mImage->getFullWidth() == 0 || mImage->getFullHeight() == 0) + { + return; + } + mUpdateDimensions = FALSE; - - // set text on dimensions display (should be moved out of here and into a callback of some sort) + childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth())); childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight())); + LLRect dim_rect; childGetRect("dimensions", dim_rect); @@ -380,34 +421,68 @@ void LLPreviewTexture::updateDimensions() // add space for dimensions and aspect ratio S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD; - LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0); - client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); - client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ; + S32 screen_width = gFloaterView->getSnapRect().getWidth(); + S32 screen_height = gFloaterView->getSnapRect().getHeight(); - S32 client_width = client_rect.getWidth(); - S32 client_height = client_rect.getHeight(); + S32 max_image_width = screen_width - 2*horiz_pad; + S32 max_image_height = screen_height - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD) + - (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height); + + S32 client_width = llmin(max_image_width,mImage->getFullWidth()); + S32 client_height = llmin(max_image_height,mImage->getFullHeight()); if (mAspectRatio > 0.f) { if(mAspectRatio > 1.f) { client_height = llceil((F32)client_width / mAspectRatio); - if(client_height > client_rect.getHeight()) + if(client_height > max_image_height) { - client_height = client_rect.getHeight(); + client_height = max_image_height; client_width = llceil((F32)client_height * mAspectRatio); } } - else + else//mAspectRatio < 1.f { client_width = llceil((F32)client_height * mAspectRatio); - if(client_width > client_rect.getWidth()) + if(client_width > max_image_width) { - client_width = client_rect.getWidth(); + client_width = max_image_width; client_height = llceil((F32)client_width / mAspectRatio); } } } + else + { + + if(client_height > max_image_height) + { + F32 ratio = (F32)max_image_height/client_height; + client_height = max_image_height; + client_width = llceil((F32)client_height * ratio); + } + + if(client_width > max_image_width) + { + F32 ratio = (F32)max_image_width/client_width; + client_width = max_image_width; + client_height = llceil((F32)client_width * ratio); + } + } + + //now back to whole floater + S32 floater_width = llmax(getMinWidth(),client_width + 2*horiz_pad); + S32 floater_height = llmax(getMinHeight(),client_height + (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD) + + (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height)); + + //reshape floater + reshape( floater_width, floater_height ); + gFloaterView->adjustToFitScreen(this, FALSE); + + //setup image rect... + LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0); + client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); + client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ; mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height); @@ -469,6 +544,7 @@ void LLPreviewTexture::loadAsset() mImage->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); mImage->forceToSaveRawImage(0) ; mAssetStatus = PREVIEW_ASSET_LOADING; + mUpdateDimensions = TRUE; updateDimensions(); childSetEnabled("save_tex_btn", canSaveAs()); } diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index ef3535042c..c47c017143 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -346,4 +346,7 @@ void LLToastNotifyPanel::onClickButton(void* data) response[button_name] = true; } self->mNotification->respond(response); + + // disable all buttons + self->mControlPanel->setEnabled(FALSE); } diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index 3d57c50386..e791eea469 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -55,6 +55,7 @@ class LLToastNotifyPanel: public LLToastPanel public: LLToastNotifyPanel(LLNotificationPtr&); virtual ~LLToastNotifyPanel(); + LLPanel * getControlPanel() { return mControlPanel; } protected: LLButton* createButton(const LLSD& form_element, BOOL is_option); diff --git a/indra/newview/skins/default/xui/en/floater_script.xml b/indra/newview/skins/default/xui/en/floater_script.xml index c3e974d978..984c4fcf1d 100644 --- a/indra/newview/skins/default/xui/en/floater_script.xml +++ b/indra/newview/skins/default/xui/en/floater_script.xml @@ -12,7 +12,7 @@ can_minimize="true" visible="true" width="520" - can_resize="true" + can_resize="false" min_width="350" min_height="369"> </floater> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index c605975c8e..1e2e74f882 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -75,6 +75,7 @@ height="16" image_pressed="Info_Press" image_unselected="Info_Over" + layout="topleft" left_pad="3" right="-53" name="info_btn" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 82821a1dfe..f20526b491 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -366,10 +366,7 @@ min_val="64" name="DrawDistance" top="3" - width="255"> - <slider.commit_callback - function="Pref.UpdateMeterText" /> - </slider> + width="255" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7703fc01f7..455b4be264 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2127,6 +2127,7 @@ Clears (deletes) the media and all params from the given face. <!-- panel picks --> <string name="NoPicksClassifiedsText">You haven't created any Picks or Classifieds. Click the Plus button below to create a Pick or Classified.</string> + <string name="NoAvatarPicksClassifiedsText">User has no picks or classfields</string> <string name="PicksClassifiedsLoadingText">Loading...</string> <!-- Multi Preview Floater --> |