diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-11 09:32:47 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-11 09:32:47 -0800 |
commit | a8776acbb314373b633f3c4102c1b6f12f134522 (patch) | |
tree | bc6f207ab84b2ea95c825b0d56254e3cd538fbbf /indra/newview | |
parent | 2ce17076427c02943fb7f5f594813167188c2741 (diff) | |
parent | 5066e850df6e44e65bf7760ac990fdd5ed1c7b8e (diff) |
merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_cof_gear.xml | 2 |
7 files changed, 54 insertions, 37 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 2b13ce6377..cef45a5b56 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -62,7 +62,8 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param mExpandCollapseBtn(NULL), mConversationsRoot(NULL), mConversationsEventStream("ConversationsEvents"), - mInitialized(false) + mInitialized(false), + mIsFirstLaunch(false) { mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2)); mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2)); @@ -243,6 +244,7 @@ BOOL LLFloaterIMContainer::postBuild() mGeneralTitle = getTitle(); mInitialized = true; + mIsFirstLaunch = true; // Add callbacks: // We'll take care of view updates on idle @@ -273,14 +275,19 @@ void LLFloaterIMContainer::addFloater(LLFloater* floaterp, openFloater(floaterp->getKey()); return; } + + LLUUID session_id = floaterp->getKey(); // Make sure the message panel is open when adding a floater or it stays mysteriously hidden - collapseMessagesPane(false); + if (!mIsFirstLaunch) + { + collapseMessagesPane(false); + } // Add the floater LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); - LLUUID session_id = floaterp->getKey(); + LLIconCtrl* icon = 0; @@ -630,6 +637,12 @@ void LLFloaterIMContainer::collapseMessagesPane(bool collapse) return; } + if (mIsFirstLaunch) + { + mIsFirstLaunch = false; + return; + } + // Save current width of panels before collapsing/expanding right pane. S32 conv_pane_width = mConversationsPane->getRect().getWidth(); S32 msg_pane_width = mMessagesPane->getRect().getWidth(); @@ -1756,7 +1769,7 @@ void LLFloaterIMContainer::openNearbyChat() { // If there's only one conversation in the container and that conversation is the nearby chat //(which it should be...), open it so to make the list of participants visible. This happens to be the most common case when opening the Chat floater. - if(mConversationsItems.size() == 1) + if((mConversationsItems.size() == 1)&&(!mConversationsPane->isCollapsed())) { LLConversationViewSession* nearby_chat = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,LLUUID())); if (nearby_chat) diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 06af6c7b51..a28dba3b98 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -167,6 +167,7 @@ private: LLLayoutStack* mConversationsStack; bool mInitialized; + bool mIsFirstLaunch; LLUUID mSelectedSession; std::string mGeneralTitle; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 578b83fd28..fabcd50c7d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1370,7 +1370,7 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) case KEY_BACKSPACE: // Delete selected items if delete or backspace key hit on the inventory panel // Note: on Mac laptop keyboards, backspace and delete are one and the same - if (mask == MASK_NONE) + if (isSelectionRemovable() && (mask == MASK_NONE)) { LLInventoryAction::doToSelected(mInventory, mFolderRoot, "delete"); handled = TRUE; @@ -1380,6 +1380,35 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) return handled; } +bool LLInventoryPanel::isSelectionRemovable() +{ + bool can_delete = false; + if (mFolderRoot) + { + std::set<LLFolderViewItem*> selection_set = mFolderRoot->getSelectionList(); + if (!selection_set.empty()) + { + can_delete = true; + for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + LLFolderViewItem *item = *iter; + const LLFolderViewModelItemInventory *listener = static_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem()); + if (!listener) + { + can_delete = false; + } + else + { + can_delete &= listener->isItemRemovable() && !listener->isItemInTrash(); + } + } + } + } + return can_delete; +} + /************************************************************************/ /* Recent Inventory Panel related class */ /************************************************************************/ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 6eb85fbad2..00a90325ad 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -162,6 +162,7 @@ public: void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); void clearSelection(); + bool isSelectionRemovable(); LLInventoryFilter& getFilter(); const LLInventoryFilter& getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 82b79db60a..d6535c88e9 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1112,27 +1112,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "delete") { - BOOL can_delete = FALSE; - LLFolderView* root = getActivePanel()->getRootFolder(); - if (root) - { - can_delete = TRUE; - std::set<LLFolderViewItem*> selection_set = root->getSelectionList(); - if (selection_set.empty()) return FALSE; - for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin(); - iter != selection_set.end(); - ++iter) - { - LLFolderViewItem *item = *iter; - const LLFolderViewModelItemInventory *listener = static_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem()); - llassert(listener); - if (!listener) return FALSE; - can_delete &= listener->isItemRemovable(); - can_delete &= !listener->isItemInTrash(); - } - return can_delete; - } - return FALSE; + return getActivePanel()->isSelectionRemovable(); } if (command_name == "save_texture") { diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 30f137bdba..c09d4393c8 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -186,11 +186,8 @@ private: // Populate the menu with items like "New Skin", "New Pants", etc. static void populateCreateWearableSubmenus(LLMenuGL* menu) { - // MAINT-2276...these menus are created as dummies because they are not available - // when this function is called. This prevents their parent from popping up later. - // - //LLView* menu_clothes = gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE); - //LLView* menu_bp = gMenuHolder->getChildView("COF.Geear.New_Body_Parts", FALSE); + LLView* menu_clothes = gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE); + LLView* menu_bp = gMenuHolder->getChildView("COF.Gear.New_Body_Parts", FALSE); for (U8 i = LLWearableType::WT_SHAPE; i != (U8) LLWearableType::WT_COUNT; ++i) { @@ -203,11 +200,7 @@ private: p.on_click.function_name = "Wearable.Create"; p.on_click.parameter = LLSD(type_name); - //LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp; - // This is a work-around for MAINT-2276 wherein the parent toggleable menu does not appear - // It puts everything under one menu, but that menu appears, which is better than not. - // - LLView* parent = menu; + LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp; LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent); } } diff --git a/indra/newview/skins/default/xui/en/menu_cof_gear.xml b/indra/newview/skins/default/xui/en/menu_cof_gear.xml index a6e9a40e31..45cf780557 100644 --- a/indra/newview/skins/default/xui/en/menu_cof_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_cof_gear.xml @@ -9,5 +9,5 @@ <menu label="New Body Parts" layout="topleft" - name="COF.Geear.New_Body_Parts" /> + name="COF.Gear.New_Body_Parts" /> </toggleable_menu> |