diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 114 |
1 files changed, 96 insertions, 18 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3b0adcf7f4..4a95ff3264 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -57,6 +57,7 @@ #include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" +#include "llfloaterabout.h" #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" #include "llbuycurrencyhtml.h" @@ -88,6 +89,7 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" +#include "llmarketplacefunctions.h" #include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llparcel.h" @@ -98,6 +100,7 @@ #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" +#include "lltoolbarview.h" #include "lltoolcomp.h" #include "lltoolmgr.h" #include "lltoolpie.h" @@ -386,6 +389,66 @@ void set_underclothes_menu_options() } } +void set_merchant_SLM_menu() +{ + // DD-170 : SLM Alpha and Beta program : for the moment, we always show the SLM menu and + // tools so that all merchants can try out the UI, even if not migrated. + // *TODO : Keep SLM UI hidden for non migrated merchant in released viewer + + //if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) + //{ + // Merchant not migrated: show only the old Merchant Outbox menu + // gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(TRUE); + //} + //else + //{ + // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool + gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(TRUE); + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), true); + //} +} + +void set_merchant_outbox_menu(U32 status, const LLSD& content) +{ + // If the merchant is fully migrated, the API is disabled (503) and we won't show the old menu item. + // In all other cases, we show it. + if (status != MarketplaceErrorCodes::IMPORT_SERVER_API_DISABLED) + { + gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(TRUE); + } +} + +void check_merchant_status() +{ + if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth")) + { + // Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status() + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED); + + // Hide SLM related menu item + gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE); + + // Also disable the toolbar button for Marketplace Listings + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), false); + + // Launch an SLM test connection to get the merchant status + LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu)); + + // Do the Merchant Outbox init only once per session + if (LLMarketplaceInventoryImporter::instance().getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) + { + // Hide merchant outbox related menu item + gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE); + + // Launch a Merchant Outbox test connection to get the migration status + LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2)); + LLMarketplaceInventoryImporter::instance().initialize(); + } + } +} + void init_menus() { // Initialize actions @@ -978,10 +1041,6 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY; } - else if ("shame" == info_display) - { - return LLPipeline::RENDER_DEBUG_SHAME; - } else if ("texture area" == info_display) { return LLPipeline::RENDER_DEBUG_TEXTURE_AREA; @@ -1010,9 +1069,9 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_COMPOSITION; } - else if ("attachment bytes" == info_display) + else if ("avatardrawinfo" == info_display) { - return LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES; + return (LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO); } else if ("glow" == info_display) { @@ -1048,6 +1107,7 @@ U32 info_display_from_string(std::string info_display) } else { + LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL; return 0; } }; @@ -2077,6 +2137,22 @@ class LLAdvancedCheckShowObjectUpdates : public view_listener_t +/////////////////////// +// CHECK FOR UPDATES // +/////////////////////// + + + +class LLAdvancedCheckViewerUpdates : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterAboutUtil::checkUpdatesAndNotify(); + return true; + } +}; + + //////////////////// // COMPRESS IMAGE // //////////////////// @@ -2695,6 +2771,7 @@ void handle_object_edit() if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) { + LLFloaterTools::sPreviousFocusOnAvatar = true; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) @@ -2834,6 +2911,8 @@ BOOL enable_object_build(void*) bool enable_object_edit() { + if (!isAgentAvatarValid()) return false; + // *HACK: The new "prelude" Help Islands have a build sandbox area, // so users need the Edit and Create pie menu options when they are // there. Eventually this needs to be replaced with code that only @@ -2994,11 +3073,11 @@ class LLAvatarCheckImpostorMode : public view_listener_t switch (mode) { case 0: - return (avatar->getVisualMuteSettings() == LLVOAvatar::VISUAL_MUTE_NOT_SET); + return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_RENDER_NORMALLY); case 1: - return (avatar->getVisualMuteSettings() == LLVOAvatar::ALWAYS_VISUAL_MUTE); + return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_DO_NOT_RENDER); case 2: - return (avatar->getVisualMuteSettings() == LLVOAvatar::NEVER_VISUAL_MUTE); + return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_ALWAYS_RENDER); default: return false; } @@ -3020,19 +3099,18 @@ class LLAvatarSetImpostorMode : public view_listener_t switch (mode) { case 0: - avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + avatar->setVisualMuteSettings(LLVOAvatar::AV_RENDER_NORMALLY); break; case 1: - avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE); + avatar->setVisualMuteSettings(LLVOAvatar::AV_DO_NOT_RENDER); break; case 2: - avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); + avatar->setVisualMuteSettings(LLVOAvatar::AV_ALWAYS_RENDER); break; default: return false; } - avatar->forceUpdateVisualMuteSettings(); LLVOAvatar::cullAvatarsByPixelArea(); return true; } // handleEvent() @@ -6632,7 +6710,7 @@ class LLAttachmentDetachFromPoint : public view_listener_t LLViewerObject *attached_object = (*iter); ids_to_remove.push_back(attached_object->getAttachmentItemID()); } - } + } if (!ids_to_remove.empty()) { LLAppearanceMgr::instance().removeItemsFromAvatar(ids_to_remove); @@ -7077,11 +7155,10 @@ void handle_selected_texture_info(void*) { msg.append( llformat("%d ", (S32)(it->second[i]))); } - - LLSD args; - args["MESSAGE"] = msg; - LLNotificationsUtil::add("SystemMessage", args); } + LLSD args; + args["MESSAGE"] = msg; + LLNotificationsUtil::add("SystemMessage", args); } } @@ -8857,6 +8934,7 @@ void initialize_menus() // Advanced (toplevel) view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); + view_listener_t::addMenu(new LLAdvancedCheckViewerUpdates(), "Advanced.CheckViewerUpdates"); view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); |