From dfa5ade487e82eb7c853edccf2ccfeddcf1f0732 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 15 Jan 2010 11:10:49 -0800 Subject: Remove crufty and unused volume up/down controls --- indra/newview/llpanelprimmediacontrols.cpp | 16 ---------------- indra/newview/llpanelprimmediacontrols.h | 2 -- 2 files changed, 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 4f539f404d..2dc3a62637 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -160,8 +160,6 @@ BOOL LLPanelPrimMediaControls::postBuild() mSkipBackCtrl = getChild("skip_back"); mVolumeCtrl = getChild("media_volume"); mMuteBtn = getChild("media_mute_button"); - mVolumeUpCtrl = getChild("volume_up"); - mVolumeDownCtrl = getChild("volume_down"); mVolumeSliderCtrl = getChild("volume_slider"); mWhitelistIcon = getChild("media_whitelist_flag"); mSecureLockIcon = getChild("media_secure_lock_flag"); @@ -339,8 +337,6 @@ void LLPanelPrimMediaControls::updateShape() mMediaAddressCtrl->setVisible(has_focus && !mini_controls); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); mVolumeCtrl->setVisible(false); - mVolumeUpCtrl->setVisible(false); - mVolumeDownCtrl->setVisible(false); mWhitelistIcon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false); // Disable zoom if HUD @@ -373,8 +369,6 @@ void LLPanelPrimMediaControls::updateShape() mSkipBackCtrl->setEnabled(has_focus && !mini_controls); mVolumeCtrl->setVisible(has_focus); - mVolumeUpCtrl->setVisible(has_focus); - mVolumeDownCtrl->setVisible(has_focus); mVolumeCtrl->setEnabled(has_focus); mVolumeSliderCtrl->setEnabled(has_focus && shouldVolumeSliderBeVisible()); mVolumeSliderCtrl->setVisible(has_focus && shouldVolumeSliderBeVisible()); @@ -417,21 +411,15 @@ void LLPanelPrimMediaControls::updateShape() // video vloume if(volume <= 0.0) { - mVolumeUpCtrl->setEnabled(TRUE); - mVolumeDownCtrl->setEnabled(FALSE); mMuteBtn->setToggleState(true); } else if (volume >= 1.0) { - mVolumeUpCtrl->setEnabled(FALSE); - mVolumeDownCtrl->setEnabled(TRUE); mMuteBtn->setToggleState(false); } else { mMuteBtn->setToggleState(false); - mVolumeUpCtrl->setEnabled(TRUE); - mVolumeDownCtrl->setEnabled(TRUE); } switch(result) @@ -476,12 +464,8 @@ void LLPanelPrimMediaControls::updateShape() mSkipBackCtrl->setEnabled(FALSE); mVolumeCtrl->setVisible(FALSE); - mVolumeUpCtrl->setVisible(FALSE); - mVolumeDownCtrl->setVisible(FALSE); mVolumeSliderCtrl->setVisible(FALSE); mVolumeCtrl->setEnabled(FALSE); - mVolumeUpCtrl->setEnabled(FALSE); - mVolumeDownCtrl->setEnabled(FALSE); mVolumeSliderCtrl->setEnabled(FALSE); if (mMediaPanelScroll) diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index 419f033628..743cec70a1 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -156,8 +156,6 @@ private: LLUICtrl *mMediaPlaySliderCtrl; LLUICtrl *mVolumeCtrl; LLButton *mMuteBtn; - LLUICtrl *mVolumeUpCtrl; - LLUICtrl *mVolumeDownCtrl; LLSliderCtrl *mVolumeSliderCtrl; LLIconCtrl *mWhitelistIcon; LLIconCtrl *mSecureLockIcon; -- cgit v1.2.3 From 988cc62d3026680362b76e017a441f40b9cedc6d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 15 Jan 2010 19:25:42 +0000 Subject: EXT-4340: Fixed llviewerhelputil_test.cpp on Linux. The gcc compiler will strip out the stubbed isGodlike() method under an optimized build. There's no way to stop this without either putting the definition in another cpp file, which is hard to do with our unit test infrastructure, or disabling gcc's inlining of the method. So I did the latter, using __attribute__ ((noinline). --- indra/newview/tests/llviewerhelputil_test.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index d7dd199722..297d98ad8d 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -83,6 +83,9 @@ class LLAgent public: LLAgent() {} ~LLAgent() {} +#ifdef __GNUC__ + __attribute__ ((noinline)) +#endif BOOL isGodlike() const { return FALSE; } private: int dummy; -- cgit v1.2.3 From fd24dcee14433e739e751becc3f6bc306b34f1c3 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 15 Jan 2010 19:27:19 +0000 Subject: EXT-4340: Re-enable the llviewerhelputil test. --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8d1eeb7ee3..958b9521fa 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1769,8 +1769,8 @@ if (LL_TESTS) lldateutil.cpp llmediadataclient.cpp lllogininstance.cpp + llviewerhelputil.cpp ) -# DISABLED TEST: llviewerhelputil.cpp /* hard to mock LLAgent dependency */ ################################################## # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS -- cgit v1.2.3 From b0b68903734cbfbfcf9bfcb7d47cf766a9897d0e Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 15 Jan 2010 14:57:00 -0500 Subject: EXT-4253 "unsaved" detection seems buggy Corrected bug where saving an outfit wouldn't update the "unsaved" marker on the UI. Also switched the UI to use a popup dialog to request the name of the outfit being made, as we could not convey everything we needed to on the button alone. Code reviewed by Vir --- indra/newview/llagentwearables.cpp | 16 ++-- indra/newview/llappearancemgr.cpp | 16 ++++ indra/newview/llappearancemgr.h | 1 + indra/newview/llpaneloutfitsinventory.cpp | 92 +++++++++++++++++++++- indra/newview/llpaneloutfitsinventory.h | 4 +- indra/newview/llsidepanelappearance.cpp | 14 ++-- indra/newview/llsidepanelappearance.h | 2 +- .../default/xui/en/floater_outfit_save_as.xml | 59 ++++++++++++++ 8 files changed, 182 insertions(+), 22 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_outfit_save_as.xml (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 10a2dd132a..c21cdf9508 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1364,15 +1364,15 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, } } -class LLAutoRenameFolder: public LLInventoryCallback +class LLShowCreatedOutfit: public LLInventoryCallback { public: - LLAutoRenameFolder(LLUUID& folder_id): + LLShowCreatedOutfit(LLUUID& folder_id): mFolderID(folder_id) { } - virtual ~LLAutoRenameFolder() + virtual ~LLShowCreatedOutfit() { LLSD key; LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); @@ -1382,13 +1382,15 @@ public: { outfit_panel->getRootFolder()->clearSelection(); outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE); - outfit_panel->getRootFolder()->setNeedsAutoRename(TRUE); } LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild("tab_outfits") : 0; if (tab_outfits && !tab_outfits->getDisplayChildren()) { tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren()); } + + LLAppearanceManager::instance().updateIsDirty(); + LLAppearanceManager::instance().updatePanelOutfitName(""); } virtual void fire(const LLUUID&) @@ -1413,10 +1415,10 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) LLFolderType::FT_OUTFIT, new_folder_name); - LLPointer cb = new LLAutoRenameFolder(folder_id); + LLPointer cb = new LLShowCreatedOutfit(folder_id); LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb); - LLAppearanceManager::instance().createBaseOutfitLink(folder_id, NULL); - + LLAppearanceManager::instance().createBaseOutfitLink(folder_id, cb); + return folder_id; } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4d4a89bcd4..748d8bdfbf 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -392,6 +392,21 @@ const LLViewerInventoryItem* LLAppearanceManager::getBaseOutfitLink() return NULL; } +bool LLAppearanceManager::getBaseOutfitName(std::string& name) +{ + const LLViewerInventoryItem* outfit_link = getBaseOutfitLink(); + if(outfit_link) + { + const LLViewerInventoryCategory *cat = outfit_link->getLinkedCategory(); + if (cat) + { + name = cat->getName(); + return true; + } + } + return false; +} + // Update appearance from outfit folder. void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, bool append) { @@ -630,6 +645,7 @@ void LLAppearanceManager::createBaseOutfitLink(const LLUUID& category, LLPointer LLAssetType::AT_LINK_FOLDER, link_waiter); new_outfit_name = catp->getName(); } + updatePanelOutfitName(new_outfit_name); } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b954968998..20745b70e4 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -63,6 +63,7 @@ public: // Finds the folder link to the currently worn outfit const LLViewerInventoryItem *getBaseOutfitLink(); + bool getBaseOutfitName(std::string &name); // Update the displayed outfit name in UI. void updatePanelOutfitName(const std::string& name); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 550fee71bf..c7dc7c0c7c 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llagentwearables.h" +#include "llappearancemgr.h" #include "llbutton.h" #include "llfloaterreg.h" @@ -44,6 +45,8 @@ #include "llinventoryfunctions.h" #include "llinventorypanel.h" #include "lllandmark.h" +#include "lllineeditor.h" +#include "llmodaldialog.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltabcontainer.h" @@ -61,12 +64,75 @@ static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); bool LLPanelOutfitsInventory::sShowDebugEditor = false; +class LLOutfitSaveAsDialog : public LLModalDialog +{ +private: + std::string mItemName; + std::string mTempItemName; + + boost::signals2::signal mSaveAsSignal; + +public: + LLOutfitSaveAsDialog( const LLSD& key ) + : LLModalDialog( key ), + mTempItemName(key.asString()) + { + } + + BOOL postBuild() + { + getChild("Save")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onSave, this )); + getChild("Cancel")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onCancel, this )); + + childSetTextArg("name ed", "[DESC]", mTempItemName); + return TRUE; + } + + void setSaveAsCommit( const boost::signals2::signal::slot_type& cb ) + { + mSaveAsSignal.connect(cb); + } + + virtual void onOpen(const LLSD& key) + { + LLLineEditor* edit = getChild("name ed"); + if (edit) + { + edit->setFocus(TRUE); + edit->selectAll(); + } + } + + void onSave() + { + mItemName = childGetValue("name ed").asString(); + LLStringUtil::trim(mItemName); + if( !mItemName.empty() ) + { + mSaveAsSignal(mItemName); + closeFloater(); // destroys this object + } + } + + void onCancel() + { + closeFloater(); // destroys this object + } +}; + LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mActivePanel(NULL), mParent(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); + + static bool registered_dialog = false; + if (!registered_dialog) + { + LLFloaterReg::add("outfit_save_as", "floater_outfit_save_as.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + registered_dialog = true; + } } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -177,10 +243,28 @@ void LLPanelOutfitsInventory::onEdit() { } -void LLPanelOutfitsInventory::onNew() +void LLPanelOutfitsInventory::onSave() +{ + std::string outfit_name; + + if (!LLAppearanceManager::getInstance()->getBaseOutfitName(outfit_name)) + { + outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); + } + + LLOutfitSaveAsDialog* save_as_dialog = LLFloaterReg::showTypedInstance("outfit_save_as", LLSD(outfit_name), TRUE); + if (save_as_dialog) + { + save_as_dialog->setSaveAsCommit(boost::bind(&LLPanelOutfitsInventory::onSaveCommit, this, _1 )); + } +} + +void LLPanelOutfitsInventory::onSaveCommit(const std::string& outfit_name) { - const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); + LLSD key; + LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); + if (mAppearanceTabs) { mAppearanceTabs->selectTabByName("outfitslist_tab"); @@ -290,7 +374,7 @@ void LLPanelOutfitsInventory::onGearButtonClick() void LLPanelOutfitsInventory::onAddButtonClick() { - onNew(); + onSave(); } void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) @@ -329,7 +413,7 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "new") { - onNew(); + onSave(); } if (command_name == "edit") { diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index b117311775..76110e2a3f 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -59,7 +59,9 @@ public: void onAdd(); void onRemove(); void onEdit(); - void onNew(); + void onSave(); + + void onSaveCommit(const std::string& item_name); void onSelectionChange(const std::deque &items, BOOL user_action); void onSelectorButtonClicked(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 77a370cc3f..43215f86bd 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -87,7 +87,7 @@ void LLWatchForOutfitRenameObserver::changed(U32 mask) mPanel->refreshCurrentOutfitName(); } } - + LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), @@ -255,7 +255,7 @@ void LLSidepanelAppearance::onNewOutfitButtonClicked() { if (!mLookInfo->getVisible()) { - mPanelOutfitsInventory->onNew(); + mPanelOutfitsInventory->onSave(); } } @@ -321,15 +321,11 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) mOutfitDirtyTag->setVisible(LLAppearanceManager::getInstance()->isOutfitDirty()); if (name == "") { - const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink(); - if (outfit_link) + std::string outfit_name; + if (LLAppearanceManager::getInstance()->getBaseOutfitName(outfit_name)) { - const LLViewerInventoryCategory *cat = outfit_link->getLinkedCategory(); - if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT) - { - mCurrentLookName->setText(cat->getName()); + mCurrentLookName->setText(outfit_name); return; - } } mCurrentLookName->setText(getString("No Outfit")); mOpenOutfitBtn->setEnabled(FALSE); diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 9524b0ece9..aa2e67fd16 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -61,6 +61,7 @@ public: void fetchInventory(); void inventoryFetched(); void updateVerbs(); + void onNewOutfitButtonClicked(); private: void onFilterEdit(const std::string& search_string); @@ -68,7 +69,6 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); void onEditButtonClicked(); - void onNewOutfitButtonClicked(); void onBackButtonClicked(); void onEditWearBackClicked(); void toggleLookInfoPanel(BOOL visible); diff --git a/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml new file mode 100644 index 0000000000..c3d84de9a7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml @@ -0,0 +1,59 @@ + + +