summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-09-30 09:57:05 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-09-30 09:57:05 +0100
commit318fcd957d29184ecb61d41f2d5373c04711b57d (patch)
tree6d5114c8479993b07aafb04bfab64d9a70cf885c /indra/newview
parent4dfb0b7b2d76cf288cca34c23218c4769ec76991 (diff)
parenta1c24eae81177e576e0329ebb0bcdb26729ec7bb (diff)
merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llavataractions.cpp80
-rw-r--r--indra/newview/llavataractions.h11
-rw-r--r--indra/newview/llbottomtray.cpp2
-rw-r--r--indra/newview/llfloaterland.cpp5
-rw-r--r--indra/newview/llfloaterpreference.cpp11
-rw-r--r--indra/newview/llfloaterpreference.h2
-rw-r--r--indra/newview/llsidepanelinventory.cpp63
-rw-r--r--indra/newview/llsidepanelinventory.h2
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_setup.xml1
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml2
10 files changed, 147 insertions, 32 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index b9ae976e58..79b0c63b38 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -49,6 +49,7 @@
#include "llfloaterpay.h"
#include "llfloaterworldmap.h"
#include "llgiveinventory.h"
+#include "llinventorybridge.h"
#include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType
#include "llinventorypanel.h"
#include "llimview.h" // for gIMMgr
@@ -443,17 +444,27 @@ namespace action_give_inventory
}
/**
- * Checks My Inventory visibility.
+ * @return active inventory panel, or NULL if there's no such panel
*/
- static bool is_give_inventory_acceptable()
+ static LLInventoryPanel* get_active_inventory_panel()
{
LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
if (!active_panel)
{
active_panel = get_outfit_editor_inventory_panel();
- if (!active_panel) return false;
}
+ return active_panel;
+ }
+
+ /**
+ * Checks My Inventory visibility.
+ */
+ static bool is_give_inventory_acceptable()
+ {
+ LLInventoryPanel* active_panel = get_active_inventory_panel();
+ if (!active_panel) return false;
+
// check selection in the panel
const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
if (inventory_selected_uuids.empty()) return false; // nothing selected
@@ -543,12 +554,8 @@ namespace action_give_inventory
return;
}
- LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
- if (!active_panel)
- {
- active_panel = get_outfit_editor_inventory_panel();
- if (!active_panel) return;
- }
+ LLInventoryPanel* active_panel = get_active_inventory_panel();
+ if (!active_panel) return;
const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
if (inventory_selected_uuids.empty())
@@ -632,12 +639,8 @@ namespace action_give_inventory
llassert(avatar_names.size() == avatar_uuids.size());
- LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
- if (!active_panel)
- {
- active_panel = get_outfit_editor_inventory_panel();
- if (!active_panel) return;
- }
+ LLInventoryPanel* active_panel = get_active_inventory_panel();
+ if (!active_panel) return;
const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
if (inventory_selected_uuids.empty())
@@ -672,6 +675,53 @@ void LLAvatarActions::shareWithAvatars()
LLNotificationsUtil::add("ShareNotification");
}
+
+// static
+bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/)
+{
+ using namespace action_give_inventory;
+
+ if (!inv_panel)
+ {
+ LLInventoryPanel* active_panel = get_active_inventory_panel();
+ if (!active_panel) return false;
+ inv_panel = active_panel;
+ }
+
+ // check selection in the panel
+ LLFolderView* root_folder = inv_panel->getRootFolder();
+ const uuid_set_t inventory_selected_uuids = root_folder->getSelectionList();
+ if (inventory_selected_uuids.empty()) return false; // nothing selected
+
+ bool can_share = true;
+ uuid_set_t::const_iterator it = inventory_selected_uuids.begin();
+ const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end();
+ for (; it != it_end; ++it)
+ {
+ LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
+ // any category can be offered.
+ if (inv_cat)
+ {
+ continue;
+ }
+
+ // check if inventory item can be given
+ LLFolderViewItem* item = root_folder->getItemByID(*it);
+ if (!item) return false;
+ LLInvFVBridge* bridge = dynamic_cast<LLInvFVBridge*>(item->getListener());
+ if (bridge && bridge->canShare())
+ {
+ continue;
+ }
+
+ // there are neither item nor category in inventory
+ can_share = false;
+ break;
+ }
+
+ return can_share;
+}
+
// static
void LLAvatarActions::toggleBlock(const LLUUID& id)
{
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 6313ae0759..44bd3778da 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -34,6 +34,8 @@
#include <string>
#include <vector>
+class LLInventoryPanel;
+
/**
* Friend-related actions (add, remove, offer teleport, etc)
*/
@@ -183,6 +185,15 @@ public:
*/
static bool canOfferTeleport(const uuid_vec_t& ids);
+ /**
+ * Checks whether all items selected in the given inventory panel can be shared
+ *
+ * @param inv_panel Inventory panel to get selection from. If NULL, the active inventory panel is used.
+ *
+ * @return false if the selected items cannot be shared or the active inventory panel cannot be obtained
+ */
+ static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL);
+
private:
static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 33d006578d..ef6f2f7337 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -770,7 +770,7 @@ void LLBottomTray::loadButtonsOrder()
}
// Nearbychat is not stored in order settings file, but it must be the first of the panels, so moving it
// manually here
- mToolbarStack->movePanel(mNearbyChatBar, NULL, true);
+ mToolbarStack->movePanel(mChatBarContainer, NULL, true);
}
void LLBottomTray::onDraggableButtonMouseUp(LLUICtrl* ctrl, S32 x, S32 y)
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index df0d22561e..e124263db5 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -565,7 +565,10 @@ void LLPanelLandGeneral::refresh()
if (regionp)
{
insert_maturity_into_textbox(mContentRating, gFloaterView->getParentFloater(this), MATURITY);
- mLandType->setText(LLTrans::getString(regionp->getSimProductName()));
+
+ std::string land_type;
+ bool is_land_type_localized = LLTrans::findString(land_type, regionp->getSimProductName());
+ mLandType->setText(is_land_type_localized ? land_type : regionp->getSimProductName());
}
// estate owner/manager cannot edit other parts of the parcel
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index ff6df548c4..41f85ae29d 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -323,8 +323,9 @@ BOOL LLFloaterPreference::postBuild()
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
+ getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227)
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
- getChild<LLUICtrl>("cache_location")->setValue(cache_location);
+ setCacheLocation(cache_location);
// if floater is opened before login set default localized busy message
if (LLStartUp::getStartupState() < STATE_STARTED)
@@ -414,7 +415,7 @@ void LLFloaterPreference::apply()
fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView());
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
- getChild<LLUICtrl>("cache_location")->setValue(cache_location);
+ setCacheLocation(cache_location);
LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue());
@@ -1310,6 +1311,12 @@ void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param)
color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
}
+void LLFloaterPreference::setCacheLocation(const LLStringExplicit& location)
+{
+ LLUICtrl* cache_location_editor = getChild<LLUICtrl>("cache_location");
+ cache_location_editor->setValue(location);
+ cache_location_editor->setToolTip(location);
+}
//----------------------------------------------------------------------------
static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference");
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index d1e15d5ab8..e99731b92e 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -103,6 +103,8 @@ protected:
public:
+ void setCacheLocation(const LLStringExplicit& location);
+
void onClickSetCache();
void onClickResetCache();
void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata);
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 23e96c22fa..31ea542743 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -182,8 +182,26 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action)
void LLSidepanelInventory::onWearButtonClicked()
{
- performActionOnSelection("wear");
- performActionOnSelection("attach");
+ LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
+ if (!panel_main_inventory)
+ {
+ llassert(panel_main_inventory != NULL);
+ return;
+ }
+
+ // Get selected items set.
+ const std::set<LLUUID> selected_uuids_set = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
+ if (selected_uuids_set.empty()) return; // nothing selected
+
+ // Convert the set to a vector.
+ uuid_vec_t selected_uuids_vec;
+ for (std::set<LLUUID>::const_iterator it = selected_uuids_set.begin(); it != selected_uuids_set.end(); ++it)
+ {
+ selected_uuids_vec.push_back(*it);
+ }
+
+ // Wear all selected items.
+ wear_multiple(selected_uuids_vec, true);
}
void LLSidepanelInventory::onPlayButtonClicked()
@@ -286,7 +304,7 @@ void LLSidepanelInventory::updateVerbs()
case LLInventoryType::IT_OBJECT:
case LLInventoryType::IT_ATTACHMENT:
mWearBtn->setVisible(TRUE);
- mWearBtn->setEnabled(get_can_item_be_worn(item->getLinkedUUID()));
+ mWearBtn->setEnabled(canWearSelected());
mShopBtn->setVisible(FALSE);
break;
case LLInventoryType::IT_SOUND:
@@ -311,18 +329,39 @@ bool LLSidepanelInventory::canShare()
LLPanelMainInventory* panel_main_inventory =
mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
- LLFolderView* root_folder =
- panel_main_inventory->getActivePanel()->getRootFolder();
+ if (!panel_main_inventory)
+ {
+ llwarns << "Failed to get the main inventory panel" << llendl;
+ return false;
+ }
+
+ LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel();
+ // Avoid flicker in the Recent tab while inventory is being loaded.
+ if (!active_panel->getRootFolder()->hasVisibleChildren()) return false;
+
+ return LLAvatarActions::canShareSelectedItems(active_panel);
+}
- LLFolderViewItem* current_item = root_folder->hasVisibleChildren()
- ? root_folder->getCurSelectedItem()
- : NULL;
+bool LLSidepanelInventory::canWearSelected()
+{
+ LLPanelMainInventory* panel_main_inventory =
+ mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
- LLInvFVBridge* bridge = current_item
- ? dynamic_cast <LLInvFVBridge*> (current_item->getListener())
- : NULL;
+ if (!panel_main_inventory)
+ {
+ llassert(panel_main_inventory != NULL);
+ return false;
+ }
+
+ std::set<LLUUID> selected_uuids = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
+ for (std::set<LLUUID>::const_iterator it = selected_uuids.begin();
+ it != selected_uuids.end();
+ ++it)
+ {
+ if (!get_can_item_be_worn(*it)) return false;
+ }
- return bridge ? bridge->canShare() : false;
+ return true;
}
LLInventoryItem *LLSidepanelInventory::getSelectedItem()
diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h
index 4776dd7530..32c98bc034 100644
--- a/indra/newview/llsidepanelinventory.h
+++ b/indra/newview/llsidepanelinventory.h
@@ -65,6 +65,8 @@ protected:
void performActionOnSelection(const std::string &action);
void updateVerbs();
+ bool canWearSelected(); // check whether selected items can be worn
+
//
// UI Elements
//
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index 879781f746..140d16e37f 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -195,7 +195,6 @@
control_name="CacheLocationTopFolder"
border_style="line"
border_thickness="1"
- enabled="false"
follows="left|top"
font="SansSerif"
height="23"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 6b3fd9ff9e..8470d91b8c 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -321,6 +321,8 @@
<!-- For land type back from the simulator -->
<string name="Estate / Full Region">Estate / Full Region</string>
+ <string name="Estate / Homestead">Estate / Homestead</string>
+ <string name="Mainland / Homestead">Mainland / Homestead</string>
<string name="Mainland / Full Region">Mainland / Full Region</string>
<!-- File load/save dialogs -->