From 3ec027b3161422822858b94e2743b963296f6250 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 23 Jul 2010 12:53:37 +0300 Subject: EXT-8318 ADDITIONAL FIXED avoid an extra copy of std::string Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/775/ --HG-- branch : product-engine --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 804c00fd60..852a57af85 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -689,7 +689,7 @@ wchar_t* ll_convert_string_to_wide(const std::string& in, unsigned int code_page std::string ll_convert_string_to_utf8_string(const std::string& in) { wchar_t* w_mesg = ll_convert_string_to_wide(in, CP_ACP); - std::string out_utf8 = ll_convert_wide_to_string(w_mesg, CP_UTF8); + std::string out_utf8(ll_convert_wide_to_string(w_mesg, CP_UTF8)); delete[] w_mesg; return out_utf8; -- cgit v1.2.3 From 9aa622ea1f3704c95c055bc59cb4171304116dbc Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Fri, 23 Jul 2010 16:03:06 +0300 Subject: EXT-8421 FIXED hardcoded strings. - Replaced hardcoded strings under Group Profile Land/Assets with related strings from strings.xml - Added new string "Group" to strings.xml Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/794/. --HG-- branch : product-engine --- indra/newview/llpanelgrouplandmoney.cpp | 8 ++++---- indra/newview/skins/default/xui/en/strings.xml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 65fe7165c2..b7d6b65ce5 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1432,10 +1432,10 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, // text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); // text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); - text.append( " Group\n"); - text.append(llformat( "%-24s %6d\n", "Credits", total_credits)); - text.append(llformat( "%-24s %6d\n", "Debits", total_debits)); - text.append(llformat( "%-24s %6d\n", "Total", total_credits + total_debits)); + text.append(llformat( "%s\n", LLTrans::getString("GroupColumn").c_str())); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits)); if ( mImplementationp->mTextEditorp ) { diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3d8ceb9912..8687bee0be 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2103,6 +2103,7 @@ Clears (deletes) the media and all params from the given face. + Balance Credits Debits -- cgit v1.2.3 From 6e88f198eddc061a7940d86b31cfc5097bb3142e Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 22 Jul 2010 19:02:17 +0300 Subject: EXT-5403 FIXED texture picker to scroll to selected texture initially after being open. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/736/. --HG-- branch : product-engine --- indra/newview/llfolderview.h | 1 + indra/newview/lltexturectrl.cpp | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 3944fa53c9..03e1bb9eee 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -263,6 +263,7 @@ public: BOOL needsAutoRename() { return mNeedsAutoRename; } void setNeedsAutoRename(BOOL val) { mNeedsAutoRename = val; } void setAutoSelectOverride(BOOL val) { mAutoSelectOverride = val; } + void setPinningSelectedItem(BOOL val) { mPinningSelectedItem = val; } void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 0b02861b75..c0518b705b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -175,6 +175,8 @@ protected: BOOL mNoCopyTextureSelected; F32 mContextConeOpacity; LLSaveFolderState mSavedFolderState; + + BOOL mSelectedItemPinned; }; LLFloaterTexturePicker::LLFloaterTexturePicker( @@ -197,7 +199,8 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mFilterEdit(NULL), mImmediateFilterPermMask(immediate_filter_perm_mask), mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), - mContextConeOpacity(0.f) + mContextConeOpacity(0.f), + mSelectedItemPinned( FALSE ) { mCanApplyImmediately = can_apply_immediately; LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml",NULL); @@ -597,6 +600,31 @@ void LLFloaterTexturePicker::draw() mTentativeLabel->setVisible( TRUE ); drawChild(mTentativeLabel); } + + if (mSelectedItemPinned) return; + + LLFolderView* folder_view = mInventoryPanel->getRootFolder(); + if (!folder_view) return; + + LLInventoryFilter* filter = folder_view->getFilter(); + if (!filter) return; + + bool is_filter_active = folder_view->getCompletedFilterGeneration() < filter->getCurrentGeneration() && + filter->isNotDefault(); + + // After inventory panel filter is applied we have to update + // constraint rect for the selected item because of folder view + // AutoSelectOverride set to TRUE. We force PinningSelectedItem + // flag to FALSE state and setting filter "dirty" to update + // scroll container to show selected item (see LLFolderView::doIdle()). + if (!is_filter_active && !mSelectedItemPinned) + { + folder_view->setPinningSelectedItem(mSelectedItemPinned); + folder_view->dirtyFilter(); + folder_view->arrangeFromRoot(); + + mSelectedItemPinned = TRUE; + } } } -- cgit v1.2.3 From a8632670db7366d7b1be362fa2300c6896cc0f61 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 23 Jul 2010 17:06:27 +0300 Subject: EXT-6739 FIXED Provided updating of object inspector gear menu 'Touch' and 'Sit' entries. Details: 1 Provided using Object.EnableSit and Object.EnableTouch callbacks for both object menu and inspector gear menu. Now default menu item label stores in hash map and since callback receives triggered control no need to hardcode updating menu item labels from callback. 2 Removed redundant attribute 'parameter' from menu xml's since now handler callbacks receives triggered menu item as function parameter. 3 Replaced LLObjectEnableTouch class with enable_object_touch function, since there no need on triggering callback on menu commit event. 4 Added symmetric method LLMenuItemGL::getValue(). 5 Removed unused "Object.EnableGearSit" callback. reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/774/ --HG-- branch : product-engine --- indra/llui/llmenugl.cpp | 6 ++ indra/llui/llmenugl.h | 1 + indra/newview/llviewermenu.cpp | 84 ++++++++++++++-------- .../skins/default/xui/en/menu_attachment_self.xml | 3 +- .../default/xui/en/menu_inspect_object_gear.xml | 2 +- 5 files changed, 63 insertions(+), 33 deletions(-) (limited to 'indra') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index b4a1bcb7c5..8610d79142 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -217,6 +217,12 @@ void LLMenuItemGL::setValue(const LLSD& value) setLabel(value.asString()); } +//virtual +LLSD LLMenuItemGL::getValue() const +{ + return getLabel(); +} + //virtual BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 7668f301ea..a484405eaa 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -95,6 +95,7 @@ public: // LLUICtrl overrides /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ LLSD getValue() const; virtual BOOL handleAcceleratorKey(KEY key, MASK mask); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7cca118392..df8e127b1f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -108,9 +108,12 @@ #include "llappearancemgr.h" #include "lltrans.h" #include "lleconomy.h" +#include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; +static boost::unordered_map sDefaultItemLabels; + BOOL enable_land_build(void*); BOOL enable_object_build(void*); @@ -2403,31 +2406,53 @@ void handle_object_touch() msg->sendMessage(object->getRegion()->getHost()); } -// One object must have touch sensor -class LLObjectEnableTouch : public view_listener_t +static void init_default_item_label(const std::string& item_name) { - bool handleEvent(const LLSD& userdata) + boost::unordered_map::iterator it = sDefaultItemLabels.find(item_name); + if (it == sDefaultItemLabels.end()) { - LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - - bool new_value = obj && obj->flagHandleTouch(); - - // Update label based on the node touch name if available. - std::string touch_text; - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); - if (node && node->mValid && !node->mTouchName.empty()) - { - touch_text = node->mTouchName; - } - else + LLStringExplicit default_label = gMenuHolder->childGetValue(item_name).asString(); + if (!default_label.empty()) { - touch_text = userdata.asString(); + sDefaultItemLabels.insert(std::pair(item_name, default_label)); } - gMenuHolder->childSetText("Object Touch", touch_text); - gMenuHolder->childSetText("Attachment Object Touch", touch_text); + } +} - return new_value; +static LLStringExplicit get_default_item_label(const std::string& item_name) +{ + LLStringExplicit res(""); + boost::unordered_map::iterator it = sDefaultItemLabels.find(item_name); + if (it != sDefaultItemLabels.end()) + { + res = it->second; + } + + return res; +} + + +bool enable_object_touch(LLUICtrl* ctrl) +{ + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + + bool new_value = obj && obj->flagHandleTouch(); + + std::string item_name = ctrl->getName(); + init_default_item_label(item_name); + + // Update label based on the node touch name if available. + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if (node && node->mValid && !node->mTouchName.empty()) + { + gMenuHolder->childSetText(item_name, node->mTouchName); + } + else + { + gMenuHolder->childSetText(item_name, get_default_item_label(item_name)); } + + return new_value; }; //void label_touch(std::string& label, void*) @@ -5519,27 +5544,27 @@ bool enable_object_stand_up() return sitting_on_selection(); } -bool enable_object_sit() +bool enable_object_sit(LLUICtrl* ctrl) { // 'Object Sit' menu item is enabled when agent is not sitting on selection bool sitting_on_sel = sitting_on_selection(); if (!sitting_on_sel) { - LLMenuItemGL* sit_menu_item = gMenuHolder->getChild("Object Sit"); - // Init default 'Object Sit' menu item label - static const LLStringExplicit sit_text(sit_menu_item->getLabel()); + std::string item_name = ctrl->getName(); + + // init default labels + init_default_item_label(item_name); + // Update label - std::string label; LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mSitName.empty()) { - label.assign(node->mSitName); + gMenuHolder->childSetText(item_name, node->mSitName); } else { - label = sit_text; + gMenuHolder->childSetText(item_name, get_default_item_label(item_name)); } - sit_menu_item->setLabel(label); } return !sitting_on_sel && is_object_sittable(); } @@ -8048,7 +8073,6 @@ void initialize_menus() view_listener_t::addMenu(new LLObjectBuild(), "Object.Build"); commit.add("Object.Touch", boost::bind(&handle_object_touch)); commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand)); - enable.add("Object.EnableGearSit", boost::bind(&is_object_sittable)); commit.add("Object.Delete", boost::bind(&handle_object_delete)); view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar"); view_listener_t::addMenu(new LLObjectReturn(), "Object.Return"); @@ -8064,12 +8088,12 @@ void initialize_menus() commit.add("Object.Open", boost::bind(&handle_object_open)); commit.add("Object.Take", boost::bind(&handle_take)); enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); - view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); + enable.add("Object.EnableTouch", boost::bind(&enable_object_touch, _1)); enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid)); enable.add("Object.EnableStandUp", boost::bind(&enable_object_stand_up)); - enable.add("Object.EnableSit", boost::bind(&enable_object_sit)); + enable.add("Object.EnableSit", boost::bind(&enable_object_sit, _1)); view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn"); view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 7239b13466..e2348375d5 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -11,8 +11,7 @@ function="Object.Touch" /> + name="EnableTouch"/> Date: Tue, 27 Jul 2010 10:51:35 +0100 Subject: Fix implicit downcast in world map change. --- indra/newview/llfloaterworldmap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 031294ad56..88f8545877 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1191,9 +1191,9 @@ void LLFloaterWorldMap::onCoordinatesCommit() return; } - F32 x_coord = (F32)childGetValue("teleport_coordinate_x").asReal(); - F32 y_coord = (F32)childGetValue("teleport_coordinate_y").asReal(); - F32 z_coord = (F32)childGetValue("teleport_coordinate_z").asReal(); + S32 x_coord = (S32)childGetValue("teleport_coordinate_x").asReal(); + S32 y_coord = (S32)childGetValue("teleport_coordinate_y").asReal(); + S32 z_coord = (S32)childGetValue("teleport_coordinate_z").asReal(); const std::string region_name = childGetValue("location").asString(); -- cgit v1.2.3