From 98c74f4eb86b8970159f445e040fb38d0fbf55fd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Dec 2009 15:02:31 -0500 Subject: For EXT-2637: Renaming outfit that's currently worn should update Current Outfit string --HG-- branch : avatar-pipeline --- indra/newview/llappearancemgr.cpp | 29 ++++++++++++++++------------- indra/newview/llappearancemgr.h | 3 +++ indra/newview/llsidepanelappearance.cpp | 26 +++++++++++++++++++++++++- indra/newview/llsidepanelappearance.h | 6 +++++- 4 files changed, 49 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d91b9d7ea4..c06098689d 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -574,29 +574,32 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) linkAll(cof, obj_items, link_waiter); linkAll(cof, gest_items, link_waiter); - LLSidepanelAppearance* panel_appearance = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); // Add link to outfit if category is an outfit. LLViewerInventoryCategory* catp = gInventory.getCategory(category); - if (!append && catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) + if (!append) { - link_inventory_item(gAgent.getID(), category, cof, catp->getName(), - LLAssetType::AT_LINK_FOLDER, link_waiter); - - // Update the current outfit name of the appearance sidepanel. - if (panel_appearance) + std::string new_outfit_name = ""; + if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) { - panel_appearance->refreshCurrentOutfitName(catp->getName()); + link_inventory_item(gAgent.getID(), category, cof, catp->getName(), + LLAssetType::AT_LINK_FOLDER, link_waiter); + new_outfit_name = catp->getName(); } + updatePanelOutfitName(new_outfit_name); } - else +} + +void LLAppearanceManager::updatePanelOutfitName(const std::string& name) +{ + LLSidepanelAppearance* panel_appearance = + dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if (panel_appearance) { - if (panel_appearance) - { - panel_appearance->refreshCurrentOutfitName(""); - } + panel_appearance->refreshCurrentOutfitName(name); } } + void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append) { lldebugs << "updateAgentWearables()" << llendl; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 7038d1a35b..b625d42a50 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -64,6 +64,9 @@ public: // Finds the folder link to the currently worn outfit const LLViewerInventoryItem *getCurrentOutfitLink(); + // Update the displayed outfit name in UI. + void updatePanelOutfitName(const std::string& name); + void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); // For debugging - could be moved elsewhere. diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index d5f01418c6..eb3695a371 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -67,6 +67,26 @@ private: LLSidepanelAppearance *mPanel; }; +class LLWatchForOutfitRenameObserver : public LLInventoryObserver +{ +public: + LLWatchForOutfitRenameObserver(LLSidepanelAppearance *panel) : + mPanel(panel) + {} + virtual void changed(U32 mask); + +private: + LLSidepanelAppearance *mPanel; +}; + +void LLWatchForOutfitRenameObserver::changed(U32 mask) +{ + if (mask & LABEL) + { + mPanel->refreshCurrentOutfitName(); + } +} + LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), @@ -76,6 +96,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() : { //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_appearance.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() mFetchWorn = new LLCurrentlyWornFetchObserver(this); + + mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this); } LLSidepanelAppearance::~LLSidepanelAppearance() @@ -135,6 +157,8 @@ BOOL LLSidepanelAppearance::postBuild() mCurrOutfitPanel = getChild("panel_currentlook"); + gInventory.addObserver(mOutfitRenameWatcher); + return TRUE; } @@ -299,7 +323,7 @@ void LLSidepanelAppearance::updateVerbs() } } -void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string name) +void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) { if (name == "") { diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index b335fd910d..9c870f631a 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -40,6 +40,7 @@ class LLFilterEditor; class LLCurrentlyWornFetchObserver; +class LLWatchForOutfitRenameObserver; class LLPanelEditWearable; class LLWearable; class LLPanelOutfitsInventory; @@ -53,7 +54,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - void refreshCurrentOutfitName(const std::string name = ""); + void refreshCurrentOutfitName(const std::string& name = ""); static void editWearable(LLWearable *wearable, void *data); @@ -91,6 +92,9 @@ private: // Used to make sure the user's inventory is in memory. LLCurrentlyWornFetchObserver* mFetchWorn; + // Used to update title when currently worn outfit gets renamed. + LLWatchForOutfitRenameObserver* mOutfitRenameWatcher; + // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; -- cgit v1.2.3 From 9eee5fb5a496cb56ac677ed28e776fc181efbe22 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 7 Dec 2009 15:49:08 -0500 Subject: EXT-3214 : Trash icon flahes in Recent Items when nothing in history Trash icon is disabled when no items are selected. --HG-- branch : avatar-pipeline --- indra/newview/llpanelmaininventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9fd92725dc..21627e84ff 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1020,6 +1020,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) can_delete = TRUE; std::set selection_set; folder->getSelectionList(selection_set); + if (selection_set.empty()) return FALSE; for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); ++iter) -- cgit v1.2.3 From 1d60a4c67817292a1e0b32d96fa8effbac2f6285 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 7 Dec 2009 17:15:49 -0500 Subject: EXT-2826 : Rename "Favorite" folder to "Favorites" folder Only will affect new accounts. --HG-- branch : avatar-pipeline --- indra/newview/llviewerfoldertype.cpp | 2 +- indra/newview/skins/default/xui/en/panel_landmarks.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index db54a79610..033d35d80a 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -121,7 +121,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga", TRUE)); addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga", FALSE)); addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga", FALSE)); - addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga", FALSE)); + addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "inv_folder_plain_closed.tga", FALSE)); addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga",TRUE)); addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga", TRUE)); diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index c52b0c83d0..1f211c0fed 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -32,7 +32,7 @@ left="0" mouse_opaque="true" name="favorites_list" - start_folder="Favorite" + start_folder="Favorites" width="380"/> Date: Mon, 7 Dec 2009 17:19:21 -0500 Subject: EXT-3125 : INFRASTRUCTURE : Cleanup LLInventoryFilter to disambiguate various filter options EXT-3124 : Add lookup for finding all linked items to an item Specifying date range now is explicitly tracked as a filter type. --HG-- branch : avatar-pipeline --- indra/newview/llinventoryfilter.cpp | 60 +++++++++++++++++++++++++++---------- indra/newview/llinventoryfilter.h | 3 +- 2 files changed, 47 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 4c5e4d5607..8907bf4c1c 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -95,26 +95,14 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) return TRUE; } - const U16 HOURS_TO_SECONDS = 3600; - time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; - if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) - { - earliest = mFilterOps.mMinDate; - } - else if (!mFilterOps.mHoursAgo) - { - earliest = 0; - } - const LLFolderViewEventListener* listener = item->getListener(); mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; const BOOL passed_filtertype = checkAgainstFilterType(item); const BOOL passed = passed_filtertype && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) && - ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && - (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); - + ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions); + return passed; } @@ -131,6 +119,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const U32 filterTypes = mFilterOps.mFilterTypes; + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_OBJECT // Pass if this item's type is of the correct filter type if (filterTypes & FILTERTYPE_OBJECT) { @@ -143,7 +133,12 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_CATEGORY // Pass if this item is a category of the filter type, or // if its parent is a category of the filter type. if (filterTypes & FILTERTYPE_CATEGORY) @@ -159,13 +154,43 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID if (filterTypes & FILTERTYPE_UUID) { if (object->getLinkedUUID() != mFilterOps.mFilterUUID) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_DATE + // Pass if this item is within the date range. + if (filterTypes & FILTERTYPE_DATE) + { + const U16 HOURS_TO_SECONDS = 3600; + time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; + if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) + { + earliest = mFilterOps.mMinDate; + } + else if (!mFilterOps.mHoursAgo) + { + earliest = 0; + } + if (listener->getCreationDate() < earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } + // + //////////////////////////////////////////////////////////////////////////////// return TRUE; } @@ -359,6 +384,7 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date) mFilterOps.mMaxDate = llmax(mFilterOps.mMinDate, max_date); setModified(); } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) @@ -373,12 +399,14 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) setDateRange(0, time_max()); setModified(); } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } BOOL LLInventoryFilter::isSinceLogoff() const { return (mFilterOps.mMinDate == (time_t)mLastLogoff) && - (mFilterOps.mMaxDate == time_max()); + (mFilterOps.mMaxDate == time_max()) && + (mFilterOps.mFilterTypes & FILTERTYPE_DATE); } void LLInventoryFilter::clearModified() @@ -410,7 +438,9 @@ void LLInventoryFilter::setHoursAgo(U32 hours) setModified(FILTER_RESTART); } } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } + void LLInventoryFilter::setShowFolderState(EFolderShow state) { if (mFilterOps.mShowFolderState != state) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index d65fb8f27c..8cac173fd8 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -61,7 +61,8 @@ public: FILTERTYPE_NONE = 0, FILTERTYPE_OBJECT = 1, // normal default search-by-object-type FILTERTYPE_CATEGORY = 2, // search by folder type - FILTERTYPE_UUID = 4 // find the object with UUID and any links to it + FILTERTYPE_UUID = 4, // find the object with UUID and any links to it + FILTERTYPE_DATE = 8 // search by date range }; // REFACTOR: Change this to an enum. -- cgit v1.2.3 From 209a660f08c9278166b94750cbb2c3e2a2ee15a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Dec 2009 17:56:34 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 2 + indra/newview/llpaneloutfitsinventory.cpp | 67 +++++++++++++++++++++- indra/newview/llpaneloutfitsinventory.h | 2 + .../skins/default/xui/en/menu_inventory.xml | 51 ++++++++-------- .../en/panel_outfits_inventory_gear_default.xml | 54 ++++++++++++++--- 5 files changed, 140 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4c28d5e2df..28b982d386 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2455,6 +2455,8 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Wear As Ensemble")); } mItems.push_back(std::string("Remove From Outfit")); + if (is_sidepanel) + mItems.push_back(std::string("Outfit Separator")); } hide_context_entries(*mMenu, mItems, disabled_items); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 6aba8c0ebb..4511bca23a 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -136,6 +136,24 @@ void LLPanelOutfitsInventory::onWear() } } +void LLPanelOutfitsInventory::onAdd() +{ + LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); + if (listenerp) + { + listenerp->performAction(NULL, NULL,"addtooutfit"); + } +} + +void LLPanelOutfitsInventory::onRemove() +{ + LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); + if (listenerp) + { + listenerp->performAction(NULL, NULL,"removefromoutfit"); + } +} + void LLPanelOutfitsInventory::onEdit() { } @@ -224,8 +242,10 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); - mEnableCallbackRegistrar.add("panel_outfits_inventory_gear_default.Enable", boost::bind(&LLPanelOutfitsInventory::isActionEnabled, this, _2)); + mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", + boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); + mEnableCallbackRegistrar.add("panel_outfits_inventory_gear_default.Enable", + boost::bind(&LLPanelOutfitsInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("panel_outfits_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); } @@ -290,6 +310,22 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) { onWear(); } + if (command_name == "add") + { + onAdd(); + } + if (command_name == "remove") + { + onRemove(); + } + if (command_name == "rename") + { + onClipboardAction("rename"); + } + if (command_name == "remove_link") + { + onClipboardAction("delete"); + } if (command_name == "delete") { onClipboardAction("delete"); @@ -320,8 +356,33 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "remove_link") + { + BOOL can_delete = FALSE; + LLFolderView *folder = getActivePanel()->getRootFolder(); + if (folder) + { + can_delete = TRUE; + std::set selection_set; + folder->getSelectionList(selection_set); + for (std::set::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + const LLUUID &item_id = (*iter); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (!item || !item->getIsLinkType()) + return FALSE; + } + return can_delete; + } + return FALSE; + } if (command_name == "edit" || - command_name == "wear") + command_name == "wear" || + command_name == "add" || + command_name == "remove" + ) { return (getCorrectListenerForAction() != NULL); } diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index aa0ab4efbc..afeaef485d 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -55,6 +55,8 @@ public: void onSearchEdit(const std::string& string); void onWear(); + void onAdd(); + void onRemove(); void onEdit(); void onNew(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index b65a49eaed..a36bfb8ec1 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -339,6 +339,33 @@ function="Inventory.DoToSelected" parameter="open" /> + + + + + + + + + + - - - - - - - - - + name="wear"> + parameter="wear" /> + parameter="wear" /> + name="add"> + parameter="add" /> + parameter="add" /> + + + + + + + + + + + + + Date: Mon, 7 Dec 2009 19:54:49 -0500 Subject: LLSidepanelTaskInfo cosmetic cleanup. --HG-- branch : avatar-pipeline --- indra/newview/llsidepaneltaskinfo.cpp | 757 +++++++++++++++++----------------- indra/newview/llsidepaneltaskinfo.h | 6 + 2 files changed, 377 insertions(+), 386 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 09e067b5f9..3e3a63d438 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -104,9 +104,6 @@ BOOL LLSidepanelTaskInfo::postBuild() childSetPrevalidate("Object Name",LLLineEditor::prevalidateASCIIPrintableNoPipe); childSetPrevalidate("Object Description",LLLineEditor::prevalidateASCIIPrintableNoPipe); -// getChild("button set group")->setCommitCallback(boost::bind(&LLSidepanelTaskInfo::onClickGroup,this)); -// childSetAction("button deed",LLSidepanelTaskInfo::onClickDeedToGroup,this); - mLabelGroupName = getChild("Group Name Proxy"); return TRUE; @@ -119,6 +116,7 @@ void LLSidepanelTaskInfo::setVisible(BOOL visible) if (visible) { sActivePanel = this; + mObject = getFirstSelectedObject(); } else { @@ -126,10 +124,89 @@ void LLSidepanelTaskInfo::setVisible(BOOL visible) } } +void LLSidepanelTaskInfo::disableAll() +{ + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); + + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); + + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); + + //Next owner can: + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); + + //checkbox for sale + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); + + //checkbox include in search + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); + + LLComboBox* combo_sale_type = getChild("sale type"); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); + combo_sale_type->setEnabled(FALSE); + + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); + + childSetEnabled("label click action", FALSE); + LLComboBox* combo_click_action = getChild("clickaction"); + if (combo_click_action) + { + combo_click_action->setEnabled(FALSE); + combo_click_action->clear(); + } + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); +} + void LLSidepanelTaskInfo::refresh() { - LLButton* BtnDeedToGroup = getChild("button deed"); - if(BtnDeedToGroup) + LLButton* btn_deed_to_group = getChild("button deed"); + if (btn_deed_to_group) { std::string deedText; if (gWarningSettings.getBOOL("DeedObject")) @@ -140,156 +217,80 @@ void LLSidepanelTaskInfo::refresh() { deedText = getString("text deed"); } - BtnDeedToGroup->setLabelSelected(deedText); - BtnDeedToGroup->setLabelUnselected(deedText); + btn_deed_to_group->setLabelSelected(deedText); + btn_deed_to_group->setLabelUnselected(deedText); } + BOOL root_selected = TRUE; LLSelectNode* nodep = mObjectSelection->getFirstRootNode(); S32 object_count = mObjectSelection->getRootObjectCount(); - if(!nodep || 0 == object_count) + if (!nodep || (object_count == 0)) { nodep = mObjectSelection->getFirstNode(); object_count = mObjectSelection->getObjectCount(); root_selected = FALSE; } - //BOOL attachment_selected = mObjectSelection->isAttachment(); - //attachment_selected = false; LLViewerObject* objectp = NULL; - if(nodep) objectp = nodep->getObject(); - if(!nodep || !objectp)// || attachment_selected) + if (nodep) { - // ...nothing selected - childSetEnabled("perm_modify",false); - childSetText("perm_modify",LLStringUtil::null); - - childSetEnabled("Creator:",false); - childSetText("Creator Name",LLStringUtil::null); - childSetEnabled("Creator Name",false); - - childSetEnabled("Owner:",false); - childSetText("Owner Name",LLStringUtil::null); - childSetEnabled("Owner Name",false); - - childSetEnabled("Group:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("button set group",false); - - childSetText("Object Name",LLStringUtil::null); - childSetEnabled("Object Name",false); - childSetEnabled("Name:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("Description:",false); - childSetText("Object Description",LLStringUtil::null); - childSetEnabled("Object Description",false); - - childSetEnabled("Permissions:",false); - - childSetValue("checkbox share with group",FALSE); - childSetEnabled("checkbox share with group",false); - childSetEnabled("button deed",false); - - childSetValue("checkbox allow everyone move",FALSE); - childSetEnabled("checkbox allow everyone move",false); - childSetValue("checkbox allow everyone copy",FALSE); - childSetEnabled("checkbox allow everyone copy",false); - - //Next owner can: - childSetEnabled("Next owner can:",false); - childSetValue("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can modify",false); - childSetValue("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can copy",false); - childSetValue("checkbox next owner can transfer",FALSE); - childSetEnabled("checkbox next owner can transfer",false); - - //checkbox for sale - childSetValue("checkbox for sale",FALSE); - childSetEnabled("checkbox for sale",false); - - //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", false); - - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); - - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); - - childSetEnabled("label click action",false); - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) - { - ComboClickAction->setEnabled(FALSE); - ComboClickAction->clear(); - } - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + objectp = nodep->getObject(); + } + // ...nothing selected + if (!nodep || !objectp) + { + disableAll(); return; } // figure out a few variables - BOOL is_one_object = (object_count == 1); - + const BOOL is_one_object = (object_count == 1); + // BUG: fails if a root and non-root are both single-selected. - BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsModify()) - || LLSelectMgr::getInstance()->selectGetModify(); + const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) || + LLSelectMgr::getInstance()->selectGetModify(); const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); + S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = - { - getString("text modify info 1"), - getString("text modify info 2"), - getString("text modify info 3"), - getString("text modify info 4") - }; - if(!is_perm_modify) + { + getString("text modify info 1"), + getString("text modify info 2"), + getString("text modify info 3"), + getString("text modify info 4") + }; + if (!is_perm_modify) { string_index += 2; } - if(!is_one_object) + if (!is_one_object) { ++string_index; } - childSetEnabled("perm_modify",true); - childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:",true); + childSetEnabled("Permissions:", TRUE); // Update creator text field - childSetEnabled("Creator:",true); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, - creator_name); + creator_name); - childSetText("Creator Name",creator_name); - childSetEnabled("Creator Name",TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - childSetEnabled("Owner:",true); + childSetEnabled("Owner:", TRUE); - BOOL owners_identical; std::string owner_name; - owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); - -// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; - + const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); if (mOwnerID.isNull()) { - if(LLSelectMgr::getInstance()->selectIsGroupOwned()) + if (LLSelectMgr::getInstance()->selectIsGroupOwned()) { // Group owned already displayed by selectGetOwner } @@ -304,61 +305,53 @@ void LLSidepanelTaskInfo::refresh() if (!mLastOwnerID.isNull() && !last_owner_name.empty()) { owner_name.append(", last "); - owner_name.append( last_owner_name ); + owner_name.append(last_owner_name); } } } - - childSetText("Owner Name",owner_name); - childSetEnabled("Owner Name",TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - childSetEnabled("Group:",true); - childSetText("Group Name",LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) { - if(mLabelGroupName) + if (mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id,TRUE); mLabelGroupName->setEnabled(TRUE); } } else { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID())); + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - // figure out the contents of the name, description, & category - BOOL edit_name_desc = FALSE; - if(is_one_object && objectp->permModify()) - { - edit_name_desc = TRUE; - } - - childSetEnabled("Name:",true); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); + childSetEnabled("Description:", TRUE); + LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); - if(is_one_object) + if (is_one_object) { - if(keyboard_focus_view != LineEditorObjectName) + if (keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } - if(LineEditorObjectDesc) + if (LineEditorObjectDesc) { - if(keyboard_focus_view != LineEditorObjectDesc) + if (keyboard_focus_view != LineEditorObjectDesc) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -366,19 +359,25 @@ void LLSidepanelTaskInfo::refresh() } else { - childSetText("Object Name",LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } - if(edit_name_desc) + // figure out the contents of the name, description, & category + BOOL edit_name_desc = FALSE; + if (is_one_object && objectp->permModify()) { - childSetEnabled("Object Name",true); - childSetEnabled("Object Description",true); + edit_name_desc = TRUE; + } + if (edit_name_desc) + { + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - childSetEnabled("Object Name",false); - childSetEnabled("Object Description",false); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -387,10 +386,10 @@ void LLSidepanelTaskInfo::refresh() BOOL is_sale_price_mixed = FALSE; U32 num_for_sale = FALSE; LLSelectMgr::getInstance()->selectGetAggregateSaleInfo(num_for_sale, - is_for_sale_mixed, - is_sale_price_mixed, - total_sale_price, - individual_sale_price); + is_for_sale_mixed, + is_sale_price_mixed, + total_sale_price, + individual_sale_price); const BOOL self_owned = (gAgent.getID() == mOwnerID); const BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ; @@ -398,35 +397,35 @@ void LLSidepanelTaskInfo::refresh() const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer(); const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy(); - if(!owners_identical) + if (!owners_identical) { - childSetEnabled("Cost",false); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. - else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) + else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost",getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); - if(!edit_price->hasFocus()) + if (!edit_price->hasFocus()) { // If the sale price is mixed then set the cost to MIXED, otherwise // set to the actual cost. - if (num_for_sale > 0 && is_for_sale_mixed) + if ((num_for_sale > 0) && is_for_sale_mixed) { edit_price->setTentative(TRUE); } - else if (num_for_sale > 0 && is_sale_price_mixed) + else if ((num_for_sale > 0) && is_sale_price_mixed) { edit_price->setTentative(TRUE); } @@ -437,111 +436,99 @@ void LLSidepanelTaskInfo::refresh() } // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. - bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false; - childSetEnabled("Cost",enable_edit); - childSetEnabled("Edit Cost",enable_edit); + BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. - else if(!public_owned) + else if (!public_owned) { - childSetEnabled("Cost",false); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost",llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - childSetText("Edit Cost",LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost",getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes // based on who owns the object. // TODO: Creator permissions - BOOL valid_base_perms = FALSE; - BOOL valid_owner_perms = FALSE; - BOOL valid_group_perms = FALSE; - BOOL valid_everyone_perms = FALSE; - BOOL valid_next_perms = FALSE; - - U32 base_mask_on; - U32 base_mask_off; - U32 owner_mask_on; - U32 owner_mask_off; - U32 group_mask_on; - U32 group_mask_off; - U32 everyone_mask_on; - U32 everyone_mask_off; - U32 next_owner_mask_on = 0; - U32 next_owner_mask_off = 0; - - valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, - &base_mask_on, - &base_mask_off); - - valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - - valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, - &group_mask_on, - &group_mask_off); + U32 base_mask_on = 0; + U32 base_mask_off = 0; + //U32 owner_mask_off = 0; + U32 owner_mask_on = 0; + U32 group_mask_on = 0; + U32 group_mask_off = 0; + U32 everyone_mask_on = 0; + U32 everyone_mask_off = 0; + U32 next_owner_mask_on = 0; + U32 next_owner_mask_off = 0; + + BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, + &base_mask_on, + &base_mask_off); + /* + BOOL valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); + */ + BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, + &group_mask_on, + &group_mask_off); - valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, - &everyone_mask_on, - &everyone_mask_off); + BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, + &everyone_mask_on, + &everyone_mask_off); - valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, - &next_owner_mask_on, - &next_owner_mask_off); + BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, + &next_owner_mask_on, + &next_owner_mask_off); - if( gSavedSettings.getBOOL("DebugPermissions") ) + if (gSavedSettings.getBOOL("DebugPermissions") ) { std::string perm_string; if (valid_base_perms) { - perm_string = "B: "; - perm_string += mask_to_string(base_mask_on); - childSetText("B:",perm_string); - childSetVisible("B:",true); + perm_string = "B: " + mask_to_string(base_mask_on); + childSetText("B:", perm_string); + childSetVisible("B:", TRUE); - perm_string = "O: "; - perm_string += mask_to_string(owner_mask_on); - childSetText("O:",perm_string); - childSetVisible("O:",true); + perm_string = "O: " + mask_to_string(owner_mask_on); + childSetText("O:", perm_string); + childSetVisible("O:", TRUE); - perm_string = "G: "; - perm_string += mask_to_string(group_mask_on); - childSetText("G:",perm_string); - childSetVisible("G:",true); + perm_string = "G: " + mask_to_string(group_mask_on); + childSetText("G:", perm_string); + childSetVisible("G:", TRUE); - perm_string = "E: "; - perm_string += mask_to_string(everyone_mask_on); - childSetText("E:",perm_string); - childSetVisible("E:",true); + perm_string = "E: " + mask_to_string(everyone_mask_on); + childSetText("E:", perm_string); + childSetVisible("E:", TRUE); - perm_string = "N: "; - perm_string += mask_to_string(next_owner_mask_on); - childSetText("N:",perm_string); - childSetVisible("N:",true); + perm_string = "N: " + mask_to_string(next_owner_mask_on); + childSetText("N:", perm_string); + childSetVisible("N:", TRUE); } - perm_string = "F: "; U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; @@ -551,189 +538,187 @@ void LLSidepanelTaskInfo::refresh() flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - perm_string += mask_to_string(flag_mask); - childSetText("F:",perm_string); - childSetVisible("F:",true); + perm_string = "F:" + mask_to_string(flag_mask); + childSetText("F:", perm_string); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } - bool has_change_perm_ability = false; - bool has_change_sale_ability = false; + BOOL has_change_perm_ability = FALSE; + BOOL has_change_sale_ability = FALSE; - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { - has_change_perm_ability = true; + has_change_perm_ability = TRUE; } - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { - has_change_sale_ability = true; + has_change_sale_ability = TRUE; } if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group",true); - childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale",FALSE); - childSetEnabled("sale type",FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - childSetEnabled("Next owner can:",FALSE); - childSetEnabled("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can transfer",FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } - if(valid_group_perms) + if (valid_group_perms) { - if((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) + if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",FALSE); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } - else if((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) + else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group",FALSE); - childSetTentative("checkbox share with group",false); - childSetEnabled("button deed",false); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",true); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } - if(valid_everyone_perms) + if (valid_everyone_perms) { // Move - if(everyone_mask_on & PERM_MOVE) + if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } - else if(everyone_mask_off & PERM_MOVE) + else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move",FALSE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",true); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy - if(everyone_mask_on & PERM_COPY) + if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",!can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } - else if(everyone_mask_off & PERM_COPY) + else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy",FALSE); - childSetTentative("checkbox allow everyone copy",false); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",true); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } - if(valid_next_perms) + if (valid_next_perms) { // Modify == next owner canot modify - if(next_owner_mask_on & PERM_MODIFY) + if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } - else if(next_owner_mask_off & PERM_MODIFY) + else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",FALSE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",true); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy - if(next_owner_mask_on & PERM_COPY) + if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",!can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } - else if(next_owner_mask_off & PERM_COPY) + else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy",FALSE); - childSetTentative("checkbox next owner can copy",FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer - if(next_owner_mask_on & PERM_TRANSFER) + if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",!can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } - else if(next_owner_mask_off & PERM_TRANSFER) + else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",FALSE); - childSetTentative("checkbox next owner can transfer",FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -745,72 +730,70 @@ void LLSidepanelTaskInfo::refresh() LLComboBox* combo_sale_type = getChild("sale type"); if (valid_sale_info) { - combo_sale_type->setValue(sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); - combo_sale_type->setTentative(FALSE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); + combo_sale_type->setTentative( FALSE); // unfortunately this doesn't do anything at the moment. } else { // default option is sell copy, determined to be safest - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setTentative(TRUE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( LLSaleInfo::FS_COPY); + combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", num_for_sale != 0); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. - bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - if (num_for_sale && has_change_sale_ability && cannot_actually_sell) - { - childSetEnabled("checkbox for sale", true); - } - + const BOOL cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); + childSetEnabled("checkbox for sale", (num_for_sale && has_change_sale_ability && cannot_actually_sell)); + // Check search status of objects - BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); + const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; - bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", ! all_include_in_search); + const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) + if (ComboClickAction) { ComboClickAction->setCurrentByIndex((S32)click_action); } } - childSetEnabled("label click action",is_perm_modify && all_volume); - childSetEnabled("clickaction",is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); if (!getIsEditing()) { - const std::string no_item_names[]={ - "Object Name", - "Object Description", - "button set group", - "checkbox share with group", - "button deed", - "checkbox allow everyone move", - "checkbox allow everyone copy", - "checkbox for sale", - "sale type", - "Edit Cost", - "checkbox next owner can modify", - "checkbox next owner can copy", - "checkbox next owner can transfer", - "clickaction", - "search_check", - "perm_modify", - "Group Name", - }; - for(size_t t=0; tselectGetOwner(owner_id, name); LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if(owners_identical && (owner_id == gAgent.getID())) + if (owners_identical && (owner_id == gAgent.getID())) { - LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance("group_picker", LLSD(gAgent.getID())); + LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance("group_picker", LLSD(gAgent.getID())); if (fg) { fg->setSelectGroupCallback( boost::bind(&LLSidepanelTaskInfo::cbGroupID, this, _1) ); - if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); @@ -857,7 +839,7 @@ void LLSidepanelTaskInfo::onClickGroup() void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id) { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(group_id, TRUE); } @@ -866,23 +848,23 @@ void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id) static bool callback_deed_to_group(const LLSD& notification, const LLSD& response) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) + const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) { LLUUID group_id; - BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); - if(group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) + const BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); + if (group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) { LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); // LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } } - return false; + return FALSE; } void LLSidepanelTaskInfo::onClickDeedToGroup() { - LLNotificationsUtil::add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); + LLNotificationsUtil::add("DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); } ///---------------------------------------------------------------------------- @@ -891,8 +873,8 @@ void LLSidepanelTaskInfo::onClickDeedToGroup() void LLSidepanelTaskInfo::onCommitPerm(LLCheckBoxCtrl *ctrl, U8 field, U32 perm) { - LLViewerObject* object = mObjectSelection->getFirstRootObject(); - if(!object) return; + const LLViewerObject* object = mObjectSelection->getFirstRootObject(); + if (!object) return; BOOL new_state = ctrl->get(); LLSelectMgr::getInstance()->selectionSetObjectPermissions(field, new_state, perm); @@ -960,28 +942,24 @@ void LLSidepanelTaskInfo::onCommitSaleType() void LLSidepanelTaskInfo::setAllSaleInfo() { llinfos << "LLSidepanelTaskInfo::setAllSaleInfo()" << llendl; - LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; + LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; LLCheckBoxCtrl *checkPurchase = getChild("checkbox for sale"); - // Set the sale type if the object(s) are for sale. - if(checkPurchase && checkPurchase->get()) + if (checkPurchase && checkPurchase->get()) { sale_type = static_cast(getChild("sale type")->getValue().asInteger()); } S32 price = -1; - - LLSpinCtrl *edit_price = getChild("Edit Cost"); + const LLSpinCtrl *edit_price = getChild("Edit Cost"); price = (edit_price->getTentative()) ? DEFAULT_PRICE : edit_price->getValue().asInteger(); - // If somehow an invalid price, turn the sale off. if (price < 0) sale_type = LLSaleInfo::FS_NOT; - LLSaleInfo sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); - + // If turned off for-sale, make sure click-action buy is turned // off as well if (sale_type == LLSaleInfo::FS_NOT) @@ -1001,8 +979,8 @@ struct LLSelectionPayable : public LLSelectedObjectFunctor { // can pay if you or your parent has money() event in script LLViewerObject* parent = (LLViewerObject*)obj->getParent(); - return (obj->flagTakesMoney() - || (parent && parent->flagTakesMoney())); + return (obj->flagTakesMoney() || + (parent && parent->flagTakesMoney())); } }; @@ -1029,7 +1007,7 @@ void LLSidepanelTaskInfo::onCommitClickAction(U8 click_action) { // Verify object has script with money() handler LLSelectionPayable payable; - bool can_pay = mObjectSelection->applyToObjects(&payable); + const BOOL can_pay = mObjectSelection->applyToObjects(&payable); if (!can_pay) { // Warn, but do it anyway. @@ -1104,6 +1082,13 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel() return sActivePanel; } +LLViewerObject* LLSidepanelTaskInfo::getObject() +{ + if (!mObject->isDead()) + return mObject; + return NULL; +} + LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() { LLSelectNode *node = mObjectSelection->getFirstRootNode(); diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index b6dd4dfb2c..83afac9da8 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -91,6 +91,8 @@ protected: void setAllSaleInfo(); + void disableAll(); + private: LLNameBox* mLabelGroupName; // group name @@ -107,6 +109,10 @@ private: LLButton* mPayBtn; LLButton* mBuyBtn; +protected: + LLViewerObject* getObject(); +private: + LLViewerObject* mObject; LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; }; -- cgit v1.2.3 From 05e4a307b83f7c5ad5f7bd22308b144e65904d2b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 12:59:54 -0500 Subject: Formatting cleanup for (currently unused) llsidepaneltaskinfo. --HG-- branch : avatar-pipeline --- indra/newview/llsidepaneltaskinfo.cpp | 95 ++++++++++++++++++++--------------- indra/newview/llsidepaneltaskinfo.h | 3 ++ 2 files changed, 57 insertions(+), 41 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 3e3a63d438..464546cc77 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -106,6 +106,8 @@ BOOL LLSidepanelTaskInfo::postBuild() mLabelGroupName = getChild("Group Name Proxy"); + childSetCommitCallback("checkbox for sale",onClickForSale,this); + return TRUE; } @@ -474,7 +476,7 @@ void LLSidepanelTaskInfo::refresh() U32 base_mask_on = 0; U32 base_mask_off = 0; - //U32 owner_mask_off = 0; + U32 owner_mask_off = 0; U32 owner_mask_on = 0; U32 group_mask_on = 0; U32 group_mask_off = 0; @@ -486,11 +488,10 @@ void LLSidepanelTaskInfo::refresh() BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, &base_mask_on, &base_mask_off); - /* - BOOL valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - */ + //BOOL valid_owner_perms =// + LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, &group_mask_on, &group_mask_off); @@ -506,50 +507,41 @@ void LLSidepanelTaskInfo::refresh() if (gSavedSettings.getBOOL("DebugPermissions") ) { - std::string perm_string; if (valid_base_perms) { - perm_string = "B: " + mask_to_string(base_mask_on); - childSetText("B:", perm_string); - childSetVisible("B:", TRUE); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - perm_string = "O: " + mask_to_string(owner_mask_on); - childSetText("O:", perm_string); - childSetVisible("O:", TRUE); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - perm_string = "G: " + mask_to_string(group_mask_on); - childSetText("G:", perm_string); - childSetVisible("G:", TRUE); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - perm_string = "E: " + mask_to_string(everyone_mask_on); - childSetText("E:", perm_string); - childSetVisible("E:", TRUE); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - perm_string = "N: " + mask_to_string(next_owner_mask_on); - childSetText("N:", perm_string); - childSetVisible("N:", TRUE); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } + U32 flag_mask = 0x0; - if (objectp->permMove()) - flag_mask |= PERM_MOVE; - if (objectp->permModify()) - flag_mask |= PERM_MODIFY; - if (objectp->permCopy()) - flag_mask |= PERM_COPY; - if (objectp->permTransfer()) - flag_mask |= PERM_TRANSFER; - perm_string = "F:" + mask_to_string(flag_mask); - childSetText("F:", perm_string); - childSetVisible("F:", TRUE); + if (objectp->permMove()) flag_mask |= PERM_MOVE; + if (objectp->permModify()) flag_mask |= PERM_MODIFY; + if (objectp->permCopy()) flag_mask |= PERM_COPY; + if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; + + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } BOOL has_change_perm_ability = FALSE; @@ -745,8 +737,14 @@ void LLSidepanelTaskInfo::refresh() // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. - const BOOL cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - childSetEnabled("checkbox for sale", (num_for_sale && has_change_sale_ability && cannot_actually_sell)); + bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); + if (cannot_actually_sell) + { + if (num_for_sale && has_change_sale_ability) + { + childSetEnabled("checkbox for sale", true); + } + } // Check search status of objects const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); @@ -973,6 +971,21 @@ void LLSidepanelTaskInfo::setAllSaleInfo() } } +// static +void LLSidepanelTaskInfo::onClickForSale(LLUICtrl* ctrl, void* data) +{ + LLSidepanelTaskInfo* self = (LLSidepanelTaskInfo*)data; + self->updateUIFromSaleInfo(); +} + +void LLSidepanelTaskInfo::updateUIFromSaleInfo() +{ + /* + TODO: Update sale button enable/disable state and default + sale button settings when this sale button is enabled/disabled. + */ +} + struct LLSelectionPayable : public LLSelectedObjectFunctor { virtual bool apply(LLViewerObject* obj) diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 83afac9da8..7c6d9983ae 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -91,6 +91,9 @@ protected: void setAllSaleInfo(); + static void onClickForSale(LLUICtrl* ctrl, void *data); + void updateUIFromSaleInfo(); + void disableAll(); private: -- cgit v1.2.3 From ef35d12ec0d4d011fe3d6312da186d7e35886d99 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 13:25:03 -0500 Subject: Incorporated code formatting cleanup from llsidepaneltaskinfo into llpanelpermissions. No functionality changes. --HG-- branch : avatar-pipeline --- indra/newview/llpanelpermissions.cpp | 654 +++++++++++++++++------------------ 1 file changed, 316 insertions(+), 338 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 6a29d76aad..8b8b1bed37 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -181,6 +181,85 @@ LLPanelPermissions::~LLPanelPermissions() } +void LLPanelPermissions::disableAll() +{ + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); + + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); + + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); + + //Next owner can: + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); + + //checkbox for sale + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); + + //checkbox include in search + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); + + LLComboBox* combo_sale_type = getChild("sale type"); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); + combo_sale_type->setEnabled(FALSE); + + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); + + childSetEnabled("label click action", FALSE); + LLComboBox* combo_click_action = getChild("clickaction"); + if (combo_click_action) + { + combo_click_action->setEnabled(FALSE); + combo_click_action->clear(); + } + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); +} + void LLPanelPermissions::refresh() { LLButton* BtnDeedToGroup = getChild("button deed"); @@ -215,136 +294,58 @@ void LLPanelPermissions::refresh() if(!nodep || !objectp)// || attachment_selected) { // ...nothing selected - childSetEnabled("perm_modify",false); - childSetText("perm_modify",LLStringUtil::null); - - childSetEnabled("Creator:",false); - childSetText("Creator Name",LLStringUtil::null); - childSetEnabled("Creator Name",false); - - childSetEnabled("Owner:",false); - childSetText("Owner Name",LLStringUtil::null); - childSetEnabled("Owner Name",false); - - childSetEnabled("Group:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("button set group",false); - - childSetText("Object Name",LLStringUtil::null); - childSetEnabled("Object Name",false); - childSetEnabled("Name:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("Description:",false); - childSetText("Object Description",LLStringUtil::null); - childSetEnabled("Object Description",false); - - childSetEnabled("Permissions:",false); - - childSetValue("checkbox share with group",FALSE); - childSetEnabled("checkbox share with group",false); - childSetEnabled("button deed",false); - - childSetValue("checkbox allow everyone move",FALSE); - childSetEnabled("checkbox allow everyone move",false); - childSetValue("checkbox allow everyone copy",FALSE); - childSetEnabled("checkbox allow everyone copy",false); - - //Next owner can: - childSetEnabled("Next owner can:",false); - childSetValue("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can modify",false); - childSetValue("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can copy",false); - childSetValue("checkbox next owner can transfer",FALSE); - childSetEnabled("checkbox next owner can transfer",false); - - //checkbox for sale - childSetValue("checkbox for sale",FALSE); - childSetEnabled("checkbox for sale",false); - - //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", false); - - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); - - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); - - childSetEnabled("label click action",false); - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) - { - ComboClickAction->setEnabled(FALSE); - ComboClickAction->clear(); - } - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); - + disableAll(); return; } // figure out a few variables - BOOL is_one_object = (object_count == 1); - + const BOOL is_one_object = (object_count == 1); + // BUG: fails if a root and non-root are both single-selected. BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsModify()) - || LLSelectMgr::getInstance()->selectGetModify(); + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); + S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = - { - getString("text modify info 1"), - getString("text modify info 2"), - getString("text modify info 3"), - getString("text modify info 4") - }; - if(!is_perm_modify) + { + getString("text modify info 1"), + getString("text modify info 2"), + getString("text modify info 3"), + getString("text modify info 4") + }; + if (!is_perm_modify) { string_index += 2; } - if(!is_one_object) + if (!is_one_object) { ++string_index; } - childSetEnabled("perm_modify",true); - childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:",true); + childSetEnabled("Permissions:", TRUE); // Update creator text field - childSetEnabled("Creator:",true); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, - creator_name); + creator_name); - childSetText("Creator Name",creator_name); - childSetEnabled("Creator Name",TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - childSetEnabled("Owner:",true); + childSetEnabled("Owner:", TRUE); - BOOL owners_identical; std::string owner_name; - owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); - -// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; - + const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); if (mOwnerID.isNull()) { - if(LLSelectMgr::getInstance()->selectIsGroupOwned()) + if (LLSelectMgr::getInstance()->selectIsGroupOwned()) { // Group owned already displayed by selectGetOwner } @@ -359,61 +360,53 @@ void LLPanelPermissions::refresh() if (!mLastOwnerID.isNull() && !last_owner_name.empty()) { owner_name.append(", last "); - owner_name.append( last_owner_name ); + owner_name.append(last_owner_name); } } } - - childSetText("Owner Name",owner_name); - childSetEnabled("Owner Name",TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - childSetEnabled("Group:",true); - childSetText("Group Name",LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) { - if(mLabelGroupName) + if (mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id,TRUE); mLabelGroupName->setEnabled(TRUE); } } else { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID())); - - // figure out the contents of the name, description, & category - BOOL edit_name_desc = FALSE; - if(is_one_object && objectp->permModify()) - { - edit_name_desc = TRUE; - } + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - childSetEnabled("Name:",true); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); + childSetEnabled("Description:", TRUE); + LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); - if(is_one_object) + if (is_one_object) { - if(keyboard_focus_view != LineEditorObjectName) + if (keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } - if(LineEditorObjectDesc) + if (LineEditorObjectDesc) { - if(keyboard_focus_view != LineEditorObjectDesc) + if (keyboard_focus_view != LineEditorObjectDesc) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -421,19 +414,25 @@ void LLPanelPermissions::refresh() } else { - childSetText("Object Name",LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } - if(edit_name_desc) + // figure out the contents of the name, description, & category + BOOL edit_name_desc = FALSE; + if (is_one_object && objectp->permModify()) { - childSetEnabled("Object Name",true); - childSetEnabled("Object Description",true); + edit_name_desc = TRUE; + } + if (edit_name_desc) + { + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - childSetEnabled("Object Name",false); - childSetEnabled("Object Description",false); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -442,10 +441,10 @@ void LLPanelPermissions::refresh() BOOL is_sale_price_mixed = FALSE; U32 num_for_sale = FALSE; LLSelectMgr::getInstance()->selectGetAggregateSaleInfo(num_for_sale, - is_for_sale_mixed, - is_sale_price_mixed, - total_sale_price, - individual_sale_price); + is_for_sale_mixed, + is_sale_price_mixed, + total_sale_price, + individual_sale_price); const BOOL self_owned = (gAgent.getID() == mOwnerID); const BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ; @@ -453,35 +452,35 @@ void LLPanelPermissions::refresh() const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer(); const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy(); - if(!owners_identical) + if (!owners_identical) { - childSetEnabled("Cost",false); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. - else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) + else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost",getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); - if(!edit_price->hasFocus()) + if (!edit_price->hasFocus()) { // If the sale price is mixed then set the cost to MIXED, otherwise // set to the actual cost. - if (num_for_sale > 0 && is_for_sale_mixed) + if ((num_for_sale > 0) && is_for_sale_mixed) { edit_price->setTentative(TRUE); } - else if (num_for_sale > 0 && is_sale_price_mixed) + else if ((num_for_sale > 0) && is_sale_price_mixed) { edit_price->setTentative(TRUE); } @@ -492,303 +491,279 @@ void LLPanelPermissions::refresh() } // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. - bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false; - childSetEnabled("Cost",enable_edit); - childSetEnabled("Edit Cost",enable_edit); + BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. - else if(!public_owned) + else if (!public_owned) { - childSetEnabled("Cost",false); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost",llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - childSetText("Edit Cost",LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost",getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes // based on who owns the object. // TODO: Creator permissions - BOOL valid_base_perms = FALSE; - BOOL valid_owner_perms = FALSE; - BOOL valid_group_perms = FALSE; - BOOL valid_everyone_perms = FALSE; - BOOL valid_next_perms = FALSE; - - U32 base_mask_on; - U32 base_mask_off; - U32 owner_mask_on; - U32 owner_mask_off; - U32 group_mask_on; - U32 group_mask_off; - U32 everyone_mask_on; - U32 everyone_mask_off; - U32 next_owner_mask_on = 0; - U32 next_owner_mask_off = 0; - - valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, - &base_mask_on, - &base_mask_off); - - valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - - valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, - &group_mask_on, - &group_mask_off); + U32 base_mask_on = 0; + U32 base_mask_off = 0; + U32 owner_mask_off = 0; + U32 owner_mask_on = 0; + U32 group_mask_on = 0; + U32 group_mask_off = 0; + U32 everyone_mask_on = 0; + U32 everyone_mask_off = 0; + U32 next_owner_mask_on = 0; + U32 next_owner_mask_off = 0; + + BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, + &base_mask_on, + &base_mask_off); + //BOOL valid_owner_perms =// + LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); + BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, + &group_mask_on, + &group_mask_off); - valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, - &everyone_mask_on, - &everyone_mask_off); + BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, + &everyone_mask_on, + &everyone_mask_off); - valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, - &next_owner_mask_on, - &next_owner_mask_off); + BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, + &next_owner_mask_on, + &next_owner_mask_off); - if( gSavedSettings.getBOOL("DebugPermissions") ) + if (gSavedSettings.getBOOL("DebugPermissions") ) { - std::string perm_string; if (valid_base_perms) { - perm_string = "B: "; - perm_string += mask_to_string(base_mask_on); - childSetText("B:",perm_string); - childSetVisible("B:",true); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - perm_string = "O: "; - perm_string += mask_to_string(owner_mask_on); - childSetText("O:",perm_string); - childSetVisible("O:",true); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - perm_string = "G: "; - perm_string += mask_to_string(group_mask_on); - childSetText("G:",perm_string); - childSetVisible("G:",true); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - perm_string = "E: "; - perm_string += mask_to_string(everyone_mask_on); - childSetText("E:",perm_string); - childSetVisible("E:",true); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - perm_string = "N: "; - perm_string += mask_to_string(next_owner_mask_on); - childSetText("N:",perm_string); - childSetVisible("N:",true); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } - perm_string = "F: "; + U32 flag_mask = 0x0; - if (objectp->permMove()) - flag_mask |= PERM_MOVE; - if (objectp->permModify()) - flag_mask |= PERM_MODIFY; - if (objectp->permCopy()) - flag_mask |= PERM_COPY; - if (objectp->permTransfer()) - flag_mask |= PERM_TRANSFER; - perm_string += mask_to_string(flag_mask); - childSetText("F:",perm_string); - childSetVisible("F:",true); + if (objectp->permMove()) flag_mask |= PERM_MOVE; + if (objectp->permModify()) flag_mask |= PERM_MODIFY; + if (objectp->permCopy()) flag_mask |= PERM_COPY; + if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; + + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } - bool has_change_perm_ability = false; - bool has_change_sale_ability = false; + BOOL has_change_perm_ability = FALSE; + BOOL has_change_sale_ability = FALSE; - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { - has_change_perm_ability = true; + has_change_perm_ability = TRUE; } - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { - has_change_sale_ability = true; + has_change_sale_ability = TRUE; } if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group",true); - childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale",FALSE); - childSetEnabled("sale type",FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - childSetEnabled("Next owner can:",FALSE); - childSetEnabled("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can transfer",FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } - if(valid_group_perms) + if (valid_group_perms) { - if((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) + if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",FALSE); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } - else if((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) + else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group",FALSE); - childSetTentative("checkbox share with group",false); - childSetEnabled("button deed",false); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",true); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } - if(valid_everyone_perms) + if (valid_everyone_perms) { // Move - if(everyone_mask_on & PERM_MOVE) + if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } - else if(everyone_mask_off & PERM_MOVE) + else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move",FALSE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",true); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy - if(everyone_mask_on & PERM_COPY) + if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",!can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } - else if(everyone_mask_off & PERM_COPY) + else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy",FALSE); - childSetTentative("checkbox allow everyone copy",false); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",true); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } - if(valid_next_perms) + if (valid_next_perms) { // Modify == next owner canot modify - if(next_owner_mask_on & PERM_MODIFY) + if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } - else if(next_owner_mask_off & PERM_MODIFY) + else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",FALSE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",true); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy - if(next_owner_mask_on & PERM_COPY) + if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",!can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } - else if(next_owner_mask_off & PERM_COPY) + else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy",FALSE); - childSetTentative("checkbox next owner can copy",FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer - if(next_owner_mask_on & PERM_TRANSFER) + if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",!can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } - else if(next_owner_mask_off & PERM_TRANSFER) + else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",FALSE); - childSetTentative("checkbox next owner can transfer",FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -800,48 +775,51 @@ void LLPanelPermissions::refresh() LLComboBox* combo_sale_type = getChild("sale type"); if (valid_sale_info) { - combo_sale_type->setValue(sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); - combo_sale_type->setTentative(FALSE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); + combo_sale_type->setTentative( FALSE); // unfortunately this doesn't do anything at the moment. } else { // default option is sell copy, determined to be safest - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setTentative(TRUE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( LLSaleInfo::FS_COPY); + combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", num_for_sale != 0); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - if (num_for_sale && has_change_sale_ability && cannot_actually_sell) + if (cannot_actually_sell) { - childSetEnabled("checkbox for sale", true); + if (num_for_sale && has_change_sale_ability) + { + childSetEnabled("checkbox for sale", true); + } } - + // Check search status of objects - BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); + const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; - bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", ! all_include_in_search); + const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) + LLComboBox* combo_click_action = getChild("clickaction"); + if(combo_click_action) { - std::string combo_value = click_action_to_string_value(click_action); - ComboClickAction->setValue(LLSD(combo_value)); + const std::string combo_value = click_action_to_string_value(click_action); + combo_click_action->setValue(LLSD(combo_value)); } } - childSetEnabled("label click action",is_perm_modify && all_volume); - childSetEnabled("clickaction",is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); } -- cgit v1.2.3 From 65123f20de0c94afca51fc58cd199ee5cad0c6f1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 13:30:25 -0500 Subject: Incorporated code formatting cleanup from llsidepaneltaskinfo into llpanelpermissions. No functionality changes. --HG-- branch : avatar-pipeline --- indra/newview/llpanelpermissions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 805a4dbe97..38d3be532f 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -84,6 +84,9 @@ protected: static void onCommitIncludeInSearch(LLUICtrl* ctrl, void*); protected: + void disableAll(); + +private: LLNameBox* mLabelGroupName; // group name LLUUID mCreatorID; -- cgit v1.2.3 From 7ce49586881fd078ea8bceeab558b4a156b30f63 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 8 Dec 2009 13:47:59 -0500 Subject: Fix for unable to create alpha masks and tattoos in inventory menus --HG-- branch : avatar-pipeline --- indra/newview/llviewerinventory.cpp | 78 +++++++------------------------------ 1 file changed, 14 insertions(+), 64 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5da77ecdb9..03e15c7ee5 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1094,72 +1094,22 @@ void menu_create_inventory_item(LLFolderView* folder, LLFolderBridge *bridge, co LLInventoryType::IT_GESTURE, PERM_ALL); } - else if ("shirt" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_SHIRT); - } - else if ("pants" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_PANTS); - } - else if ("shoes" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_SHOES); - } - else if ("socks" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_SOCKS); - } - else if ("jacket" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_JACKET); - } - else if ("skirt" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_SKIRT); - } - else if ("gloves" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_GLOVES); - } - else if ("undershirt" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_UNDERSHIRT); - } - else if ("underpants" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); - LLFolderBridge::createWearable(parent_id, WT_UNDERPANTS); - } - else if ("shape" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART); - LLFolderBridge::createWearable(parent_id, WT_SHAPE); - } - else if ("skin" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART); - LLFolderBridge::createWearable(parent_id, WT_SKIN); - } - else if ("hair" == type_name) - { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART); - LLFolderBridge::createWearable(parent_id, WT_HAIR); - } - else if ("eyes" == type_name) + else { - const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART); - LLFolderBridge::createWearable(parent_id, WT_EYES); + // Use for all clothing and body parts. Adding new wearable types requires updating LLWearableDictionary. + EWearableType wearable_type = LLWearableDictionary::typeNameToType(type_name); + if (wearable_type >= WT_SHAPE && wearable_type < WT_COUNT) + { + LLAssetType::EType asset_type = LLWearableDictionary::getAssetType(wearable_type); + LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type); + const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(folder_type); + LLFolderBridge::createWearable(parent_id, wearable_type); + } + else + { + llwarns << "Can't create unrecognized type " << type_name << llendl; + } } - folder->setNeedsAutoRename(TRUE); } -- cgit v1.2.3 From e9fcaa09e0817a34056fc049c6d8317bec7ec74d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 15:06:39 -0500 Subject: For EXT-3166 : MyInventory/Library Places accordions are causing massive inventory background fetch on startup Took out line to start background fetch at start of filter; the background fetch will start when the filter is started. This prevents the viewer from requesting a complete inventory fetch at login. --HG-- branch : avatar-pipeline --- indra/newview/llpanellandmarks.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index e87b70f6a5..ebde902e81 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1003,8 +1003,6 @@ static void filter_list(LLInventorySubTreePanel* inventory_list, const std::stri inventory_list->restoreFolderState(); } - gInventory.startBackgroundFetch(); - if (inventory_list->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing -- cgit v1.2.3 From bfdfec637c482c69f47d4c6ab0ade37e2f67ff5e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 17:18:43 -0500 Subject: INFRASTRUCTURE: Took out unused function "getAllAttachmentsArray" from llvoavatarself. --HG-- branch : avatar-pipeline --- indra/newview/llvoavatarself.cpp | 13 ------------- indra/newview/llvoavatarself.h | 1 - 2 files changed, 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7d6401acde..b4c45c23d4 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1067,19 +1067,6 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) return FALSE; } -void LLVOAvatarSelf::getAllAttachmentsArray(LLDynamicArray& attachments) -{ - for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ++iter) - { - LLViewerJointAttachment* attachment = iter->second; - if ( attachment && (attachment->getNumObjects() > 0)) - { - attachments.push_back(iter->first); - } - } -} - U32 LLVOAvatarSelf::getNumWearables(LLVOAvatarDefines::ETextureIndex i) const { EWearableType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 6bf4ef5496..c7bd4eaadc 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -284,7 +284,6 @@ public: const std::string getAttachedPointName(const LLUUID& inv_item_id) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); - void getAllAttachmentsArray(LLDynamicArray& attachments); //-------------------------------------------------------------------- // HUDs -- cgit v1.2.3 From f7c883be9a4bbdcf5e4255ff52e6e6d0824b60ab Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 17:25:31 -0500 Subject: EXT-3266 : Object contents show up as empty always InventoryFilter was rejecting all items that didn't exist in agent inventory. Changed this to properly account for inventory of in-world objects. --HG-- branch : avatar-pipeline --- indra/newview/llinventoryfilter.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8907bf4c1c..38803b4b8b 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -115,8 +115,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const LLUUID object_id = listener->getUUID(); const LLInventoryObject *object = gInventory.getObject(object_id); - if (!object) return FALSE; - const U32 filterTypes = mFilterOps.mFilterTypes; //////////////////////////////////////////////////////////////////////////////// @@ -127,11 +125,13 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // If it has no type, pass it, unless it's a link. if (object_type == LLInventoryType::IT_NONE) { - if (object->getIsLinkType()) + if (object && object->getIsLinkType()) return FALSE; } - if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + { return FALSE; + } } // //////////////////////////////////////////////////////////////////////////////// @@ -143,6 +143,10 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // if its parent is a category of the filter type. if (filterTypes & FILTERTYPE_CATEGORY) { + // Can only filter categories for items in your inventory + // (e.g. versus in-world object contents). + if (!object) return FALSE; + LLUUID cat_id = object_id; if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) { @@ -163,6 +167,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // Pass if this item is the target UUID or if it links to the target UUID if (filterTypes & FILTERTYPE_UUID) { + if (!object) return FALSE; + if (object->getLinkedUUID() != mFilterOps.mFilterUUID) return FALSE; } -- cgit v1.2.3 From d4b888d47840d57b071dd2cf6dea492c4230e4b4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 17:31:02 -0500 Subject: EXT-3133: Viewer crashes after deleting a Trash folder from the My Inventory accordion Put in a quick fix so that folders can't be made reparented to their own children. --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 78 +++++++++++++++++++------------------ indra/newview/llinventorymodel.cpp | 2 + 2 files changed, 43 insertions(+), 37 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 28b982d386..ea47013781 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -714,20 +714,20 @@ BOOL LLInvFVBridge::isItemPermissive() const // static void LLInvFVBridge::changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, - const LLUUID& new_parent, + const LLUUID& new_parent_id, BOOL restamp) { - if(item->getParentUUID() != new_parent) + if(item->getParentUUID() != new_parent_id) { LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); update.push_back(new_folder); gInventory.accountForUpdate(update); LLPointer new_item = new LLViewerInventoryItem(item); - new_item->setParent(new_parent); + new_item->setParent(new_parent_id); new_item->updateParentOnServer(restamp); model->updateItem(new_item); model->notifyObservers(); @@ -737,24 +737,27 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model, // static void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model, LLViewerInventoryCategory* cat, - const LLUUID& new_parent, + const LLUUID& new_parent_id, BOOL restamp) { - if(cat->getParentUUID() != new_parent) + // Can't move a folder into a child of itself. + if (model->isObjectDescendentOf(new_parent_id, cat->getUUID())) { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); - update.push_back(new_folder); - gInventory.accountForUpdate(update); - - LLPointer new_cat = new LLViewerInventoryCategory(cat); - new_cat->setParent(new_parent); - new_cat->updateParentOnServer(restamp); - model->updateCategory(new_cat); - model->notifyObservers(); + return; } + + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); + update.push_back(new_folder); + model->accountForUpdate(update); + + LLPointer new_cat = new LLViewerInventoryCategory(cat); + new_cat->setParent(new_parent_id); + new_cat->updateParentOnServer(restamp); + model->updateCategory(new_cat); + model->notifyObservers(); } @@ -2243,11 +2246,6 @@ BOOL LLFolderBridge::removeItem() LLNotification::Params params("ConfirmDeleteProtectedCategory"); params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); - //params.functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); - /* - LLNotification::Params params("ChangeLindenEstate"); - params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); - */ if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { LLNotifications::instance().add(params); @@ -2278,14 +2276,16 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re LLInventoryModel::item_array_t descendent_items; gInventory.collectDescendents( mUUID, descendent_categories, descendent_items, FALSE ); - S32 i; - for (i = 0; i < descendent_items.count(); i++) + for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin(); + iter != descendent_items.end(); + ++iter) { - LLInventoryItem* item = descendent_items[i]; + const LLInventoryItem* item = (*iter); + const LLUUID& item_id = item->getUUID(); if (item->getType() == LLAssetType::AT_GESTURE - && LLGestureManager::instance().isGestureActive(item->getUUID())) + && LLGestureManager::instance().isGestureActive(item_id)) { - LLGestureManager::instance().deactivateGesture(item->getUUID()); + LLGestureManager::instance().deactivateGesture(item_id); } } @@ -2306,14 +2306,16 @@ void LLFolderBridge::pasteFromClipboard() LLInventoryModel* model = getInventoryModel(); if(model && isClipboardPasteable()) { - LLInventoryItem* item = NULL; + const LLUUID parent_id(mUUID); + LLDynamicArray objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); - const LLUUID parent_id(mUUID); - for(S32 i = 0; i < count; i++) + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) { - item = model->getItem(objects.get(i)); + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); if (item) { if(LLInventoryClipboard::instance().isCutMode()) @@ -2342,13 +2344,15 @@ void LLFolderBridge::pasteLinkFromClipboard() const LLInventoryModel* model = getInventoryModel(); if(model) { + const LLUUID parent_id(mUUID); + LLDynamicArray objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); - LLUUID parent_id(mUUID); - for(S32 i = 0; i < count; i++) + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) { - const LLUUID &object_id = objects.get(i); + const LLUUID &object_id = (*iter); #if SUPPORT_ENSEMBLES if (LLInventoryCategory *cat = model->getCategory(object_id)) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index fb9be1e04f..5d8a8805b5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -192,6 +192,8 @@ void LLInventoryModel::cleanupInventory() BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const { + if (obj_id == cat_id) return TRUE; + const LLInventoryObject* obj = getObject(obj_id); while(obj) { -- cgit v1.2.3 From 947260880713f0bd65b03f796f782b167127e294 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 18:19:39 -0500 Subject: EXT-3256 : Show help message in Favorites bar if empty --HG-- branch : avatar-pipeline --- indra/newview/llfolderview.cpp | 2 +- indra/newview/llinventoryfilter.cpp | 14 +++++++++++++- indra/newview/llinventoryfilter.h | 21 ++++++++++++++------- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/skins/default/xui/en/strings.xml | 1 + 5 files changed, 30 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 4e77b42187..7cf0104075 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -890,7 +890,7 @@ void LLFolderView::draw() } else { - mStatusText = LLTrans::getString("InventoryNoMatchingItems"); + mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage()); font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 38803b4b8b..81b10f5a62 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -63,7 +63,8 @@ LLInventoryFilter::FilterOps::FilterOps() : LLInventoryFilter::LLInventoryFilter(const std::string& name) : mName(name), mModified(FALSE), - mNeedTextRebuild(TRUE) + mNeedTextRebuild(TRUE), + mEmptyLookupMessage("InventoryNoMatchingItems") { mOrder = SO_FOLDERS_BY_NAME; // This gets overridden by a pref immediately @@ -861,3 +862,14 @@ S32 LLInventoryFilter::getMustPassGeneration() const { return mMustPassGeneration; } + +void LLInventoryFilter::setEmptyLookupMessage(const std::string& message) +{ + mEmptyLookupMessage = message; +} + +const std::string& LLInventoryFilter::getEmptyLookupMessage() const +{ + return mEmptyLookupMessage; + +} diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 8cac173fd8..5ca77cb26a 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -73,13 +73,6 @@ public: LLInventoryFilter(const std::string& name); virtual ~LLInventoryFilter(); - // +-------------------------------------------------------------------+ - // + Execution And Results - // +-------------------------------------------------------------------+ - BOOL check(const LLFolderViewItem* item); - BOOL checkAgainstFilterType(const LLFolderViewItem* item); - std::string::size_type getStringMatchOffset() const; - // +-------------------------------------------------------------------+ // + Parameters // +-------------------------------------------------------------------+ @@ -104,12 +97,25 @@ public: void setHoursAgo(U32 hours); U32 getHoursAgo() const; + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ + BOOL check(const LLFolderViewItem* item); + BOOL checkAgainstFilterType(const LLFolderViewItem* item); + std::string::size_type getStringMatchOffset() const; + + // +-------------------------------------------------------------------+ + // + Presentation + // +-------------------------------------------------------------------+ void setShowFolderState( EFolderShow state); EFolderShow getShowFolderState() const; void setSortOrder(U32 order); U32 getSortOrder() const; + void setEmptyLookupMessage(const std::string& message); + const std::string& getEmptyLookupMessage() const; + // +-------------------------------------------------------------------+ // + Status // +-------------------------------------------------------------------+ @@ -188,6 +194,7 @@ private: BOOL mModified; BOOL mNeedTextRebuild; std::string mFilterText; + std::string mEmptyLookupMessage; }; #endif diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ebde902e81..975219458f 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -327,7 +327,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() mFavoritesInventoryPanel = getChild("favorites_list"); initLandmarksPanel(mFavoritesInventoryPanel); - + mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); initAccordion("tab_favorites", mFavoritesInventoryPanel); } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3b32912fbf..3c9ceb6585 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1805,6 +1805,7 @@ Clears (deletes) the media and all params from the given face. No matching items found in inventory. + Drag and drop a landmark here to add to your favorites. You do not have a copy of this texture in your inventory -- cgit v1.2.3 From 92ca569b42947db740390b3b38bf1911e30f3e8f Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Tue, 8 Dec 2009 17:30:58 -0800 Subject: EXT-2702 the Group abilities 'Show in Find Places' is mislabeled. Also updated various places that refer to the 1.23 style UI. --- .../newview/skins/default/xui/en/notifications.xml | 2 +- .../newview/skins/default/xui/en/role_actions.xml | 64 +++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f659062cfe..a07b23d0c3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1688,7 +1688,7 @@ This location can play streaming media. Streaming media requires a fast Internet connection. Play streaming media when available? -(You can change this option later under Preferences > Audio & Video.) +(You can change this option later under Preferences > Privacy.) - - - Date: Tue, 8 Dec 2009 18:43:32 -0800 Subject: EXT-2572 - Bottom text on bottom line in nearby chat is clipped --- indra/llui/lltextbase.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2a9515171a..e0503a0844 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2080,6 +2080,8 @@ void LLTextBase::updateRects() } mContentsRect.mTop += mVPad; + // subtract a pixel off the bottom to deal with rounding errors in measuring font height + mContentsRect.mBottom -= 1; S32 delta_pos = -mContentsRect.mBottom; // move line segments to fit new document rect -- cgit v1.2.3 From ffca4ec568e019edf330069921136c5ec362e672 Mon Sep 17 00:00:00 2001 From: Erica Date: Wed, 9 Dec 2009 06:06:37 -0800 Subject: Accordions in appearance panel don't use full space, removed borders in inventory panel, standardized button sizes, changed login according to feedback --- indra/newview/skins/default/xui/en/panel_login.xml | 80 +++-- .../skins/default/xui/en/panel_main_inventory.xml | 34 ++- .../default/xui/en/panel_outfits_inventory.xml | 42 +-- .../skins/default/xui/en/sidepanel_appearance.xml | 330 ++++++++++----------- .../skins/default/xui/en/sidepanel_inventory.xml | 23 +- 5 files changed, 262 insertions(+), 247 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index efe26d3887..8b5c149f0d 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -49,7 +49,7 @@ name="first_name_text" top="20" width="150"> - Name: + First name: + + Last name: + -