From 9ebd99d8ae5f1939a1fe48349820c7c6ed6c06a4 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 15 Feb 2010 20:57:34 +0200 Subject: Fixed low bug (EXT-5251) Status text isn't aligned to top in inventory SP - Changed status textbox rect in folder view. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 8dbdfff635..3230402bdc 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -234,7 +234,7 @@ LLFolderView::LLFolderView(const Params& p) // Textbox LLTextBox::Params text_p; - LLRect new_r(5, 13-50, 300, 0-50); + LLRect new_r(5, 40, 300, 40-13); text_p.name(std::string(p.name)); text_p.rect(new_r); text_p.font(getLabelFontForStyle(mLabelStyle)); -- cgit v1.2.3 From f25fda6edc2b7d4c835dd2d113e01f3878f4c00d Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 15 Feb 2010 21:07:12 +0200 Subject: Fixed major bug EXT-4778 ([crashhunters] Crash @ LLGroupMgr::sendGroupMemberEjects [secondlife-bin llgroupmgr.cpp:1708]) - Replaced usage of map iterator (which later became invalid and this caused crash) with pointer to data. --HG-- branch : product-engine --- indra/newview/llgroupmgr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 4db75bbd8a..686e2dd734 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1730,6 +1730,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(*it); if (mit != group_datap->mMembers.end()) { + LLGroupMemberData* member_data = (*mit).second; // Add them to the message if (start_message) { @@ -1752,8 +1753,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, } // Clean up groupmgr - for (LLGroupMemberData::role_list_t::iterator rit = (*mit).second->roleBegin(); - rit != (*mit).second->roleEnd(); ++rit) + for (LLGroupMemberData::role_list_t::iterator rit = member_data->roleBegin(); + rit != member_data->roleEnd(); ++rit) { if ((*rit).first.notNull() && (*rit).second!=0) { @@ -1766,7 +1767,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMembers.erase(*it); llwarns << "LLGroupMgr::sendGroupMemberEjects - deleting memnber data " << llendl; - delete (*mit).second; + delete member_data; } } -- cgit v1.2.3 From c97704b394058319fa12def0279cfc5b133bb213 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 15 Feb 2010 21:22:35 +0200 Subject: No ticket. Minor cleanup in LLGroupMgr::sendGroupMemberEjects() - Removed warnings used to deal with fixed EXT-4778 - Replaced (*it) with ejected_member_id where it wasn't to make code more clear --HG-- branch : product-engine --- indra/newview/llgroupmgr.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 686e2dd734..6dbd3a81e8 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1721,13 +1721,11 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, { LLUUID& ejected_member_id = (*it); - llwarns << "LLGroupMgr::sendGroupMemberEjects -- ejecting member" << ejected_member_id << llendl; - // Can't use 'eject' to leave a group. - if ((*it) == gAgent.getID()) continue; + if (ejected_member_id == gAgent.getID()) continue; // Make sure they are in the group, and we need the member data - LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(*it); + LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(ejected_member_id); if (mit != group_datap->mMembers.end()) { LLGroupMemberData* member_data = (*mit).second; @@ -1759,14 +1757,11 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, if ((*rit).first.notNull() && (*rit).second!=0) { (*rit).second->removeMember(ejected_member_id); - - llwarns << "LLGroupMgr::sendGroupMemberEjects - removing member from role " << llendl; } } - group_datap->mMembers.erase(*it); + group_datap->mMembers.erase(ejected_member_id); - llwarns << "LLGroupMgr::sendGroupMemberEjects - deleting memnber data " << llendl; delete member_data; } } @@ -1775,8 +1770,6 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, { gAgent.sendReliableMessage(); } - - llwarns << "LLGroupMgr::sendGroupMemberEjects - done " << llendl; } void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) -- cgit v1.2.3 From 876369f615c62f07849368a481ae2260d13680a3 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 15 Feb 2010 21:24:14 +0200 Subject: fixed Bug Major EXT-5086 llDialog buttons are displayed in wrong order Order of the buttons has been recovered to viewer 1.23 behavior. --HG-- branch : product-engine --- indra/newview/app_settings/settings.xml | 4 +- indra/newview/lltoastnotifypanel.cpp | 130 +++++++++++++-------- indra/newview/lltoastnotifypanel.h | 8 +- .../skins/default/xui/en/panel_notification.xml | 12 +- 4 files changed, 97 insertions(+), 57 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d0c2f3cb34..c0cf8ec1ad 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5055,7 +5055,9 @@ Comment Default width of buttons in the toast. - Note if required width will be less then this one, a button will be reshaped to default size , otherwise to required + Notes: + If required width will be less then this one, a button will be reshaped to default size , otherwise to required + Change of this parameter will affect the layout of buttons in notification toast. Persist 1 Type diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 980b51337f..ef3535042c 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -46,6 +46,7 @@ #include "llnotificationsutil.h" const S32 BOTTOM_PAD = VPAD * 3; +const S32 IGNORE_BTN_TOP_DELTA = 3*VPAD;//additional ignore_btn padding S32 BUTTON_WIDTH = 90; //static @@ -127,14 +128,6 @@ mAddedDefaultBtn(false) { std::vector buttons; buttons.reserve(mNumOptions); - for (S32 i = 0; i < mNumOptions; i++) - { - LLSD form_element = form->getElement(i); - if (form_element["type"].asString() != "button") - { - continue; - } - } S32 buttons_width = 0; // create all buttons and accumulate they total width to reshape mControlPanel for (S32 i = 0; i < mNumOptions; i++) @@ -155,22 +148,42 @@ mAddedDefaultBtn(false) } else { - //try get an average left_pad to spread out buttons - S32 left_pad = (getRect().getWidth() - buttons_width) / (S32(buttons.size() + 1)); - // left_pad can be < 2*HPAD if we have a lot of buttons. - if(left_pad < 2*HPAD) + const S32 button_panel_width = mControlPanel->getRect().getWidth();// do not change width of the panel + S32 button_panel_height = mControlPanel->getRect().getHeight(); + //try get an average h_pad to spread out buttons + S32 h_pad = (button_panel_width - buttons_width) / (S32(buttons.size())); + if(h_pad < 2*HPAD) { - //Probably it is a scriptdialog toast, set default left_pad - left_pad = 2*HPAD; + /* + * Probably it is a scriptdialog toast + * for a scriptdialog toast h_pad can be < 2*HPAD if we have a lot of buttons. + * In last case set default h_pad to avoid heaping of buttons + */ + h_pad = 2*HPAD; } - //how many rows we need to fit all buttons with current width of the panel - S32 button_rows = (buttons_width + left_pad * S32(buttons.size() + 1)) / getRect().getWidth() + 1; - //calculate required panel height - S32 button_panel_height = button_rows *( BTN_HEIGHT + VPAD) + BOTTOM_PAD; - - adjustPanelForScriptNotice(getRect().getWidth(), button_panel_height); - //we begin from lefttop angle and go to rightbottom. - updateButtonsLayout(buttons, left_pad, button_panel_height); + if (mIsScriptDialog) + { + // we are using default width for script buttons so we can determinate button_rows + //to get a number of rows we divide the required width of the buttons to button_panel_width + S32 button_rows = llceil(F32(buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width); + //S32 button_rows = (buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width; + //reserve one row for the ignore_btn + button_rows++; + //calculate required panel height for scripdialog notification. + button_panel_height = button_rows * (BTN_HEIGHT + VPAD) + IGNORE_BTN_TOP_DELTA + BOTTOM_PAD; + } + else + { + // in common case buttons can have different widths so we need to calculate button_rows according to buttons_width + //S32 button_rows = llceil(F32(buttons.size()) * (buttons_width + h_pad) / button_panel_width); + S32 button_rows = llceil(F32((buttons.size() - 1) * h_pad + buttons_width) / button_panel_width); + //calculate required panel height + button_panel_height = button_rows * (BTN_HEIGHT + VPAD) + BOTTOM_PAD; + } + + // we need to keep min width and max height to make visible all buttons, because width of the toast can not be changed + adjustPanelForScriptNotice(button_panel_width, button_panel_height); + updateButtonsLayout(buttons, h_pad); } } // adjust panel's height to the text size @@ -202,7 +215,8 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt mBtnCallbackData.push_back(userdata); LLButton::Params p; - const LLFontGL* font = form_element["index"].asInteger() == -1 ? sFontSmall: sFont; // for ignore button in script dialog + bool is_ignore_btn = form_element["index"].asInteger() == -1; + const LLFontGL* font = is_ignore_btn ? sFontSmall: sFont; // for ignore button in script dialog p.name(form_element["name"].asString()); p.label(form_element["text"].asString()); p.font(font); @@ -216,12 +230,19 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt p.image_color(LLUIColorTable::instance().getColor("ButtonCautionImageColor")); p.image_color_disabled(LLUIColorTable::instance().getColor("ButtonCautionImageColor")); } + // for the scriptdialog buttons we use fixed button size. This is a limit! if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > BUTTON_WIDTH) { p.rect.width = 1; p.auto_resize = true; } - + else if (mIsScriptDialog && is_ignore_btn) + { + // this is ignore button,make it smaller + p.rect.height = BTN_HEIGHT_SMALL; + p.rect.width = 1; + p.auto_resize = true; + } LLButton* btn = LLUICtrlFactory::create(p); mNumButtons++; btn->autoResize(); @@ -241,38 +262,48 @@ LLToastNotifyPanel::~LLToastNotifyPanel() LLNotifications::getInstance()->cancel(mNotification); } } -void LLToastNotifyPanel::updateButtonsLayout(const std::vector& buttons, S32 left_pad, S32 top) + +void LLToastNotifyPanel::updateButtonsLayout(const std::vector& buttons, S32 h_pad) { - S32 left = left_pad; + S32 left = 0; + //reserve place for ignore button + S32 bottom_offset = mIsScriptDialog ? (BTN_HEIGHT + IGNORE_BTN_TOP_DELTA + BOTTOM_PAD) : BOTTOM_PAD; + S32 max_width = mControlPanel->getRect().getWidth(); LLButton* ignore_btn = NULL; for (std::vector::const_iterator it = buttons.begin(); it != buttons.end(); it++) { - if(left + it->second->getRect().getWidth() + 2*HPAD > getRect().getWidth()) - { - // looks like we need to add button to the next row - left = left_pad; - top-= (BTN_HEIGHT + VPAD); - } - LLRect btn_rect(it->second->getRect()); - if(mIsScriptDialog && it->first == -1) + if (it->first == -1) { - //this is ignore button ( index == -1) we need to add it into new extra row at the end ignore_btn = it->second; continue; } - btn_rect.setLeftTopAndSize(left, top, btn_rect.getWidth(), btn_rect.getHeight()); - it->second->setRect(btn_rect); - left = btn_rect.mLeft + btn_rect.getWidth() + left_pad; - addChild(it->second, -1); + LLButton* btn = it->second; + LLRect btn_rect(btn->getRect()); + if (left + btn_rect.getWidth() > max_width)// whether there is still some place for button+h_pad in the mControlPanel + { + // looks like we need to add button to the next row + left = 0; + bottom_offset += (BTN_HEIGHT + VPAD); + } + //we arrange buttons from bottom to top for backward support of old script + btn_rect.setOriginAndSize(left, bottom_offset, btn_rect.getWidth(), btn_rect.getHeight()); + btn->setRect(btn_rect); + left = btn_rect.mLeft + btn_rect.getWidth() + h_pad; + mControlPanel->addChild(btn, -1); } - if(ignore_btn) + if (mIsScriptDialog && ignore_btn != NULL) { - LLRect btn_rect(ignore_btn->getRect()); - btn_rect.setOriginAndSize(getRect().getWidth() - btn_rect.getWidth() - left_pad, - BOTTOM_PAD,// move button at the bottom edge - btn_rect.getWidth(), btn_rect.getHeight()); - ignore_btn->setRect(btn_rect); - addChild(ignore_btn, -1); + LLRect ignore_btn_rect(ignore_btn->getRect()); + S32 buttons_per_row = max_width / BUTTON_WIDTH; //assume that h_pad far less than BUTTON_WIDTH + S32 ignore_btn_left = buttons_per_row * BUTTON_WIDTH + (buttons_per_row - 1) * h_pad - ignore_btn_rect.getWidth(); + if (ignore_btn_left + ignore_btn_rect.getWidth() > max_width)// make sure that the ignore button is in panel + { + ignore_btn_left = max_width - ignore_btn_rect.getWidth() - 2 * HPAD; + } + ignore_btn_rect.setOriginAndSize(ignore_btn_left, BOTTOM_PAD,// always move ignore button at the bottom + ignore_btn_rect.getWidth(), ignore_btn_rect.getHeight()); + ignore_btn->setRect(ignore_btn_rect); + mControlPanel->addChild(ignore_btn, -1); } } @@ -280,18 +311,15 @@ void LLToastNotifyPanel::adjustPanelForScriptNotice(S32 button_panel_width, S32 { //adjust layout // we need to keep min width and max height to make visible all buttons, because width of the toast can not be changed - LLRect button_rect = mControlPanel->getRect(); reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight() + button_panel_height + VPAD); - button_rect.set(0, button_rect.mBottom + button_panel_height, button_rect.getWidth(), button_rect.mBottom); - mControlPanel->reshape(button_rect.getWidth(), button_panel_height); - mControlPanel->setRect(button_rect); + mControlPanel->reshape( button_panel_width, button_panel_height); } void LLToastNotifyPanel::adjustPanelForTipNotice() { LLRect info_rect = mInfoPanel->getRect(); LLRect this_rect = getRect(); - + //we don't need display ControlPanel for tips because they doesn't contain any buttons. mControlPanel->setVisible(FALSE); reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight()); diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index 1f50c21f6f..3d57c50386 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -73,7 +73,13 @@ private: void adjustPanelForScriptNotice(S32 max_width, S32 max_height); void adjustPanelForTipNotice(); void addDefaultButton(); - void updateButtonsLayout(const std::vector& buttons, S32 left_pad, S32 top); + /* + * It lays out buttons of the notification in mControlPanel. + * Buttons will be placed from BOTTOM to TOP. + * @param h_pad horizontal space between buttons. It is depent on number of buttons. + * @param buttons vector of button to be added. + */ + void updateButtonsLayout(const std::vector& buttons, S32 h_pad); // panel elements LLTextBase* mTextBox; diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml index 145a24b642..f3c63afedf 100644 --- a/indra/newview/skins/default/xui/en/panel_notification.xml +++ b/indra/newview/skins/default/xui/en/panel_notification.xml @@ -83,12 +83,16 @@ + top_pad="5"> + -- cgit v1.2.3 From ef21d64c84a7dd1382ac0da1f14c7707351373fa Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 15 Feb 2010 22:07:38 +0200 Subject: Fixed normal bug EXT-5328 (Focus is lost after LEFT arrow button has been pressed in Landmarks tab) --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3230402bdc..d053933dfb 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1625,7 +1625,11 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - setSelection(parent_folder, FALSE, TRUE); + // Don't change selectin to hidden folder. See EXT-5328. + if (!parent_folder->getHidden()) + { + setSelection(parent_folder, FALSE, TRUE); + } } else { -- cgit v1.2.3 From 9c5de933878b6af68a171aa171bca2f0fe104196 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 15 Feb 2010 22:20:52 +0200 Subject: Fixed low bug EXT-5421 (IM floater doesn't remember minimized state when leaving mouselook) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 52312b87a5..8b2c5b039f 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -489,7 +489,11 @@ void LLIMFloater::setVisible(BOOL visible) channel->redrawToasts(); } - if (visible && mChatHistory && mInputEditor) + BOOL is_minimized = visible && isChatMultiTab() + ? LLIMFloaterContainer::getInstance()->isMinimized() + : !visible; + + if (!is_minimized && mChatHistory && mInputEditor) { //only if floater was construced and initialized from xml updateMessages(); -- cgit v1.2.3 From 41c8ad6efe5ec98a3196c047ea0e4ed2a9ee93bf Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 16 Feb 2010 10:47:29 +0200 Subject: additional fix for reopened EXT-5429 IM chat history of active tab in IM container is not updated when IM container is unminimized --HG-- branch : product-engine --- indra/newview/llimfloatercontainer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index a775115ac9..3c6692b79a 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -147,6 +147,8 @@ LLIMFloaterContainer* LLIMFloaterContainer::getInstance() void LLIMFloaterContainer::setMinimized(BOOL b) { + if (isMinimized() == b) return; + LLMultiFloater::setMinimized(b); if (isMinimized()) return; -- cgit v1.2.3 From 59e93da87b90acfc51404bac91ca3dc601716c8e Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 16 Feb 2010 10:58:50 +0200 Subject: Fixed major bug EXT - 5400 (erroneously blinking IM tab on group chat message) --HG-- branch : product-engine --- indra/newview/llimfloatercontainer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 3c6692b79a..2f248f3596 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -110,8 +110,8 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, icon_params.avatar_id = avatar_id; icon = LLUICtrlFactory::instance().createWidget(icon_params); - mSessions[avatar_id] = floaterp; - floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, avatar_id)); + mSessions[session_id] = floaterp; + floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id)); } mTabContainer->setTabImage(floaterp, icon); } @@ -123,7 +123,7 @@ void LLIMFloaterContainer::onCloseFloater(LLUUID& id) void LLIMFloaterContainer::onNewMessageReceived(const LLSD& data) { - LLUUID session_id = data["from_id"].asUUID(); + LLUUID session_id = data["session_id"].asUUID(); LLFloater* floaterp = get_ptr_in_map(mSessions, session_id); LLFloater* current_floater = LLMultiFloater::getActiveFloater(); -- cgit v1.2.3 From 481e26ae2db0415226a04eec3b3f05f9a246081d Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 16 Feb 2010 11:24:06 +0200 Subject: Fixed normal bug EXT - 5383 ('Save as outfit' floater has no title) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_outfit_save_as.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml index 16079b30cb..a2938e8574 100644 --- a/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml +++ b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml @@ -4,6 +4,7 @@ can_minimize="false" height="100" layout="topleft" + title="Save Outfit" name="modal container" width="240">