diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 401 |
1 files changed, 123 insertions, 278 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1ab10b2f27..eb676d3188 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -81,20 +81,19 @@ #include "lldrawpooltree.h" #include "llface.h" #include "llfirstuse.h" +#include "llfirsttimetipmanager.h" #include "llfloater.h" #include "llfloaterabout.h" #include "llfloaterbuycurrency.h" #include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" #include "llfloateravatartextures.h" -#include "llfloaterbeacons.h" #include "llfloaterbuildoptions.h" #include "llfloaterbump.h" #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" -#include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" #include "llfloaterdaycycle.h" @@ -133,7 +132,8 @@ #include "llfloaterworldmap.h" #include "llfloatermemleak.h" #include "llfasttimerview.h" -#include "llfriendactions.h" +#include "llavataractions.h" +#include "lllandmarkactions.h" #include "llmemoryview.h" #include "llgivemoney.h" #include "llgroupmgr.h" @@ -146,7 +146,7 @@ #include "llimagetga.h" #include "llinventorybridge.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llfloaterinventory.h" #include "llkeyboard.h" #include "llpanellogin.h" #include "llmenucommands.h" @@ -161,6 +161,7 @@ #include "llresmgr.h" #include "llrootview.h" #include "llselectmgr.h" +#include "llsidetray.h" #include "llsky.h" #include "llstatusbar.h" #include "llstatview.h" @@ -184,7 +185,7 @@ #include "llviewercamera.h" #include "llviewergenericmessage.h" #include "llviewergesture.h" -#include "llviewerimagelist.h" // gImageList +#include "llviewertexturelist.h" // gTextureList #include "llviewerinventory.h" #include "llviewermenufile.h" // init_menu_file() #include "llviewermessage.h" @@ -500,30 +501,30 @@ void init_menus() /// /// Pie menus /// - gPieSelf = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_self.xml", gMenuHolder); + gPieSelf = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_self.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); // TomY TODO: what shall we do about these? gDetachScreenPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Detach HUD", true); gDetachPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Detach", true); - gPieAvatar = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_avatar.xml", gMenuHolder); + gPieAvatar = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_avatar.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - gPieObject = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_object.xml", gMenuHolder); + gPieObject = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_object.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gAttachScreenPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Attach HUD"); gAttachPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Attach"); gPieRate = gMenuHolder->getChild<LLContextMenu>("Rate Menu"); - gPieAttachment = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_attachment.xml", gMenuHolder); + gPieAttachment = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_attachment.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - gPieLand = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_land.xml", gMenuHolder); + gPieLand = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_land.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); /// /// set up the colors /// LLColor4 color; - LLColor4 context_menu_color = gSavedSkinSettings.getColor("MenuPopupBgColor"); + LLColor4 context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor"); gPieSelf->setBackgroundColor( context_menu_color ); gPieAvatar->setBackgroundColor( context_menu_color ); @@ -532,19 +533,19 @@ void init_menus() gPieLand->setBackgroundColor( context_menu_color ); - color = gSavedSkinSettings.getColor( "MenuPopupBgColor" ); + color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" ); gPopupMenuView->setBackgroundColor( color ); // If we are not in production, use a different color to make it apparent. if (LLViewerLogin::getInstance()->isInProductionGrid()) { - color = gSavedSkinSettings.getColor( "MenuBarBgColor" ); + color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); } else { - color = gSavedSkinSettings.getColor( "MenuNonProductionBgColor" ); + color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); } - gMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_viewer.xml", gMenuHolder); + gMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_viewer.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); gMenuBarView->setBackgroundColor( color ); @@ -575,7 +576,7 @@ void init_menus() // Let land based option enable when parcel changes gMenuParcelObserver = new LLMenuParcelObserver(); - gLoginMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_login.xml", gMenuHolder); + gLoginMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_login.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gLoginMenuBarView->arrangeAndClear(); LLRect menuBarRect = gLoginMenuBarView->getRect(); gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom)); @@ -612,11 +613,6 @@ class LLAdvancedToggleConsole : public view_listener_t toggle_visibility( (void*)gDebugView->mMemoryView ); } #endif - else if ("notifications" == console_type) - { - //LLFloaterNotificationConsole::showInstance(); - LLFloaterReg::showInstance("notifications_console"); - } return true; } }; @@ -1117,30 +1113,6 @@ class LLAdvancedCheckFrameTest : public view_listener_t }; - // -///////////////////////////// -//// HIDE SELECTED OBJECTS // -///////////////////////////// -// -// -//class LLAdvancedToggleHideSelectedObjects : public view_listener_t -//{ -// bool handleEvent(const LLSD& userdata) -// { -// LLSelectMgr::sHideSelectedObjects = !(LLSelectMgr::sHideSelectedObjects); -// return true; -// } -//}; - // -//class LLAdvancedCheckHideSelectedObjects : public view_listener_t -//{ -// bool handleEvent(const LLSD& userdata) -// { -// bool new_value = gHideSelectedObjects; -// return new_value; -// } -//}; - /////////////////////////// // SELECTED TEXTURE INFO // /////////////////////////// @@ -1185,7 +1157,7 @@ class LLAdvancedToggleDisableTextures : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLViewerImage::sDontLoadVolumeTextures = !LLViewerImage::sDontLoadVolumeTextures; + LLViewerTexture::sDontLoadVolumeTextures = !LLViewerTexture::sDontLoadVolumeTextures; return true; } }; @@ -1194,7 +1166,7 @@ class LLAdvancedCheckDisableTextures : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = LLViewerImage::sDontLoadVolumeTextures; // <-- make this using LLCacheControl + bool new_value = LLViewerTexture::sDontLoadVolumeTextures; // <-- make this using LLCacheControl return new_value; } }; @@ -1506,16 +1478,6 @@ class LLAdvancedCheckDebugWindowProc : public view_listener_t // ------------------------------XUI MENU --------------------------- - -class LLAdvancedShowFontTest : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterFontTest::show(NULL); - return true; - } -}; - ////////////////////// // LOAD UI FROM XML // ////////////////////// @@ -1547,6 +1509,15 @@ class LLAdvancedSaveUIToXML : public view_listener_t }; +class LLAdvancedSendTestIms : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLIMModel::instance().testMessages(); + return true; +} +}; + /////////////// // XUI NAMES // @@ -1987,18 +1958,6 @@ class LLAdvancedDumpAvatarLocalTextures : public view_listener_t } }; -//////////////////////////////// -// Memory Leaking Simulation // -//////////////////////////////// -class LLAdvancedMemoryLeakingSimulation : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterMemLeak::show(NULL); - return true; - } -}; - #endif ///////////////// @@ -2147,7 +2106,6 @@ class LLAdvancedShowDebugSettings : public view_listener_t { bool handleEvent(const LLSD& userdata) { - // LLFloaterSettingsDebug::showInstance(userdata); LLFloaterReg::showInstance("settings_debug",userdata); return true; } @@ -2414,14 +2372,6 @@ class LLAdminHandleRegionDumpTempAssetData: public view_listener_t } }; //Admin (Top Level) -class LLAdminShowGodTools: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterGodTools::showInstance(LLSD()); - return true; - } -}; class LLAdminOnSaveState: public view_listener_t { @@ -2581,7 +2531,7 @@ class LLObjectEnableTouch : public view_listener_t // label.assign("Touch"); // } //} - +/* bool handle_object_open() { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -2598,7 +2548,7 @@ class LLObjectOpen : public view_listener_t return handle_object_open(); } }; - +*/ class LLObjectEnableOpen : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -2715,16 +2665,6 @@ class LLObjectEdit : public view_listener_t } }; -class LLObjectInspect : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterInspect::show(); - return true; - } -}; - - //--------------------------------------------------------------------------- // Land pie menu //--------------------------------------------------------------------------- @@ -3109,7 +3049,7 @@ class LLAvatarDebug : public view_listener_t strings.push_back(avatar->getID().asString()); LLUUID invoice; send_generic_message("dumptempassetdata", strings, invoice); - LLFloaterAvatarTextures::show( avatar->getID() ); + LLFloaterReg::showInstance( "avatar_tetures", LLSD(avatar->getID()) ); } return true; } @@ -3500,7 +3440,7 @@ class LLSelfStandUp : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + gAgent.standUp(); return true; } }; @@ -3509,11 +3449,31 @@ class LLSelfEnableStandUp : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; + bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->isSitting(); return new_value; } }; +class LLSelfFriends : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + // Open "Friends" tab of the "People" panel in side tray. + LLSideTray::getInstance()->showPanel("panel_people", "friends_panel"); + return true; + } +}; + +class LLSelfGroups : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + // Open "Groups" tab of the "People" panel in side tray. + LLSideTray::getInstance()->showPanel("panel_people", "groups_panel"); + return true; + } +}; + BOOL check_admin_override(void*) { return gAgent.getAdminOverride(); @@ -3647,14 +3607,9 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat, } */ -BOOL is_agent_friend(const LLUUID& agent_id) -{ - return (LLAvatarTracker::instance().getBuddyInfo(agent_id) != NULL); -} - BOOL is_agent_mappable(const LLUUID& agent_id) { - return (is_agent_friend(agent_id) && + return (LLAvatarActions::isFriend(agent_id) && LLAvatarTracker::instance().getBuddyInfo(agent_id)->isOnline() && LLAvatarTracker::instance().getBuddyInfo(agent_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) ); @@ -3667,7 +3622,7 @@ class LLAvatarEnableAddFriend : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - bool new_value = avatar && !is_agent_friend(avatar->getID()); + bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); return new_value; } }; @@ -3691,7 +3646,7 @@ void request_friendship(const LLUUID& dest_id) } if (!fullname.empty()) { - LLFriendActions::requestFriendshipDialog(dest_id, fullname); + LLAvatarActions::requestFriendshipDialog(dest_id, fullname); } else { @@ -3722,7 +3677,7 @@ bool handle_sit_or_stand() if (sitting_on_selection()) { - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + gAgent.standUp(); return true; } @@ -3768,7 +3723,7 @@ class LLLandSit : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + gAgent.standUp(); LLViewerParcelMgr::getInstance()->deselectLand(); LLVector3d posGlobal = LLToolPie::getInstance()->getPick().mPosGlobal; @@ -4382,7 +4337,7 @@ void handle_take() } // check library - if(gInventory.isObjectDescendentOf(category_id, gInventoryLibraryRoot)) + if(gInventory.isObjectDescendentOf(category_id, gInventory.getLibraryRootFolderID())) { category_id.setNull(); } @@ -4676,7 +4631,7 @@ BOOL sitting_on_selection() return FALSE; } - return (avatar->mIsSitting && avatar->getRoot() == root_object); + return (avatar->isSitting() && avatar->getRoot() == root_object); } class LLToolsSaveToInventory : public view_listener_t @@ -5271,6 +5226,9 @@ class LLWorldAlwaysRun : public view_listener_t // tell the simulator. gAgent.sendWalkRun(gAgent.getAlwaysRun()); + // Update Movement Controls according to AlwaysRun mode + LLFloaterMove::setAlwaysRunMode(gAgent.getAlwaysRun()); + return true; } }; @@ -5317,29 +5275,14 @@ class LLWorldSetBusy : public view_listener_t } }; -bool can_create_landmark() -{ - BOOL can = FALSE; - - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (agent_parcel) -{ - - if (agent_parcel->getAllowLandmark() - || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) - { - can = TRUE; - } - } - - return can; -} - class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterReg::showInstance("add_landmark"); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + + // Floater "Add Landmark" functionality moved to Side Tray + //LLFloaterReg::showInstance("add_landmark"); return true; } }; @@ -5394,8 +5337,7 @@ void invite_to_group(const LLUUID& dest_id) LLViewerObject* dest = gObjectList.findObject(dest_id); if(dest && dest->isAvatar()) { - LLFloaterGroupPicker* widget; - widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); if (widget) { widget->center(); @@ -5423,7 +5365,7 @@ class LLAvatarAddFriend : public view_listener_t bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar && !is_agent_friend(avatar->getID())) + if(avatar && !LLAvatarActions::isFriend(avatar->getID())) { request_friendship(avatar->getID()); } @@ -5597,11 +5539,7 @@ class LLShowFloater : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string floater_name = userdata.asString(); - if (floater_name == "gestures") - { - LLFloaterGesture::toggleVisibility(); - } - else if (floater_name == "appearance") + if (floater_name == "appearance") { if (gAgentWearables.areWearablesLoaded()) { @@ -5612,35 +5550,6 @@ class LLShowFloater : public view_listener_t { LLToolBar::toggle(NULL); } - else if (floater_name == "mute list") - { - LLFloaterReg::toggleInstance("mute"); - } - else if (floater_name == "camera controls") - { - LLFloaterCamera::toggleInstance(); - } - else if (floater_name == "movement controls") - { - LLFloaterMove::toggleInstance(); - } - else if (floater_name == "my land") - { - LLFloaterLandHoldings::show(NULL); - } - else if (floater_name == "about land") - { - if (LLViewerParcelMgr::getInstance()->selectionEmpty()) - { - LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); - } - - LLFloaterLand::showInstance(); - } - else if (floater_name == "about region") - { - LLFloaterRegionInfo::showInstance(); - } else if (floater_name == "buy land") { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) @@ -5650,10 +5559,6 @@ class LLShowFloater : public view_listener_t LLViewerParcelMgr::getInstance()->startBuyLand(); } - else if (floater_name == "grid options") - { - LLFloaterReg::showInstance("build_options"); - } else if (floater_name == "script errors") { LLFloaterScriptDebug::show(LLUUID::null); @@ -5662,48 +5567,16 @@ class LLShowFloater : public view_listener_t { gViewerHtmlHelp.show(); } - else if (floater_name == "help tutorial") - { - LLFloaterHUD::showHUD(); - } else if (floater_name == "complaint reporter") { // Prevent menu from appearing in screen shot. gMenuHolder->hideMenus(); LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } - else if (floater_name == "mean events") - { - if (!gNoRender) - { - //LLFloaterBump::showInstance(); - LLFloaterReg::showInstance("bumps"); - } - } - else if (floater_name == "lag meter") - { - LLFloaterReg::showInstance("lagmeter"); - } else if (floater_name == "buy currency") { LLFloaterBuyCurrency::buyCurrency(); } - else if (floater_name == "about") - { - LLFloaterReg::showInstance("sl_about"); - } - else if (floater_name == "active speakers") - { - LLFloaterActiveSpeakers::toggleInstance(LLSD()); - } - else if (floater_name == "beacons") - { - LLFloaterBeacons::toggleInstance(LLSD()); - } - else if (floater_name == "perm prefs") - { - LLFloaterPerms::toggleInstance(LLSD()); - } else { LLFloaterReg::toggleInstance(floater_name); @@ -5722,30 +5595,6 @@ class LLFloaterVisible : public view_listener_t { new_value = LLToolBar::visible(NULL); } - else if (floater_name == "mute list") - { - new_value = LLFloaterReg::instanceVisible("mute"); - } - else if (floater_name == "camera controls") - { - new_value = LLFloaterCamera::instanceVisible(); - } - else if (floater_name == "movement controls") - { - new_value = LLFloaterMove::instanceVisible(); - } - else if (floater_name == "stat bar") - { - new_value = gSavedSettings.getBOOL("ShowDebugStats"); - } - else if (floater_name == "active speakers") - { - new_value = LLFloaterActiveSpeakers::instanceVisible(LLSD()); - } - else if (floater_name == "beacons") - { - new_value = LLFloaterBeacons::instanceVisible(LLSD()); - } else { new_value = LLFloaterReg::instanceVisible(floater_name); @@ -5852,7 +5701,7 @@ class LLShowAgentProfile : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(agent_id); if (avatar) { - LLFriendActions::showProfile(avatar->getID()); + LLAvatarActions::showProfile(avatar->getID()); } return true; } @@ -6440,8 +6289,8 @@ class LLToolsSelectedScriptAction : public view_listener_t msg = "RunningNot"; } LLUUID id; id.generate(); - LLFloater* floater = LLFloaterReg::getInstance(name, LLSD(id)); - LLFloaterScriptQueue* queue = dynamic_cast<LLFloaterScriptQueue*>(floater); + + LLFloaterScriptQueue* queue =LLFloaterReg::getTypedInstance<LLFloaterScriptQueue>(name, LLSD(id)); if (queue) { queue->setMono(mono); @@ -6450,7 +6299,7 @@ class LLToolsSelectedScriptAction : public view_listener_t else { llwarns << "Failed to generate LLFloaterScriptQueue with action: " << action << llendl; - delete floater; + delete queue; } return true; } @@ -6477,7 +6326,7 @@ void handle_selected_texture_info(void*) { if (!node->isTESelected(i)) continue; - LLViewerImage* img = node->getObject()->getTEImage(i); + LLViewerTexture* img = node->getObject()->getTEImage(i); LLUUID image_id = img->getID(); faces_per_texture[image_id].push_back(i); } @@ -6487,7 +6336,7 @@ void handle_selected_texture_info(void*) { LLUUID image_id = it->first; U8 te = it->second[0]; - LLViewerImage* img = node->getObject()->getTEImage(te); + LLViewerTexture* img = node->getObject()->getTEImage(te); S32 height = img->getHeight(); S32 width = img->getWidth(); S32 components = img->getComponents(); @@ -6807,9 +6656,7 @@ class LLWorldEnableCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = can_create_landmark(); - - return new_value; + return !LLLandmarkActions::landmarkAlreadyExists(); } }; @@ -6959,7 +6806,7 @@ void handle_debug_avatar_textures(void*) LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) { - LLFloaterAvatarTextures::show(objectp->getID()); + LLFloaterReg::showInstance( "avatar_tetures", LLSD(objectp->getID()) ); } } @@ -7016,7 +6863,7 @@ void handle_grab_texture(void* data) gInventory.updateItem(item); gInventory.notifyObservers(); - LLInventoryView* view = LLInventoryView::getActiveInventory(); + LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); // Show the preview panel for textures to let // user know that the image is now in inventory. @@ -7026,7 +6873,7 @@ void handle_grab_texture(void* data) view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); view->getPanel()->openSelected(); - //LLInventoryView::dumpSelectionInformation((void*)view); + //LLFloaterInventory::dumpSelectionInformation((void*)view); // restore keyboard focus gFocusMgr.setKeyboardFocus(focus_ctrl); } @@ -7214,8 +7061,8 @@ void handle_load_from_xml(void*) if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) { std::string filename = picker.getFirstFile(); - LLFloater* floater = new LLFloater(); - LLUICtrlFactory::getInstance()->buildFloater(floater, filename); + LLFloater* floater = new LLFloater(LLSD()); + LLUICtrlFactory::getInstance()->buildFloater(floater, filename, NULL); } } @@ -7261,10 +7108,7 @@ void handle_buy_currency_test(void*) llinfos << "buy currency url " << url << llendl; - LLFloaterHtmlCurrency* floater = LLFloaterHtmlCurrency::showInstance(url); - // Needed so we can use secondlife:///app/floater/self/close SLURLs - floater->setTrusted(true); - floater->center(); + LLFloaterReg::showInstance("buy_currency_html", LLSD(url)); } void handle_rebake_textures(void*) @@ -7521,47 +7365,47 @@ class LLEditEnableTakeOff : public view_listener_t bool new_value = false; if (clothing == "shirt") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_SHIRT); + new_value = LLAgentWearables::selfHasWearable(WT_SHIRT); } if (clothing == "pants") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_PANTS); + new_value = LLAgentWearables::selfHasWearable(WT_PANTS); } if (clothing == "shoes") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_SHOES); + new_value = LLAgentWearables::selfHasWearable(WT_SHOES); } if (clothing == "socks") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_SOCKS); + new_value = LLAgentWearables::selfHasWearable(WT_SOCKS); } if (clothing == "jacket") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_JACKET); + new_value = LLAgentWearables::selfHasWearable(WT_JACKET); } if (clothing == "gloves") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_GLOVES); + new_value = LLAgentWearables::selfHasWearable(WT_GLOVES); } if (clothing == "undershirt") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_UNDERSHIRT); + new_value = LLAgentWearables::selfHasWearable(WT_UNDERSHIRT); } if (clothing == "underpants") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_UNDERPANTS); + new_value = LLAgentWearables::selfHasWearable(WT_UNDERPANTS); } if (clothing == "skirt") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_SKIRT); + new_value = LLAgentWearables::selfHasWearable(WT_SKIRT); } if (clothing == "alpha") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_ALPHA); + new_value = LLAgentWearables::selfHasWearable(WT_ALPHA); } if (clothing == "tattoo") { - new_value = LLAgentWearables::selfHasWearable((void *)WT_TATTOO); + new_value = LLAgentWearables::selfHasWearable(WT_TATTOO); } return new_value; } @@ -7664,16 +7508,7 @@ class LLWorldEnvSettings : public view_listener_t if (tod == "editor") { // if not there or is hidden, show it - if( !LLFloaterEnvSettings::isOpen() || - !LLFloaterEnvSettings::instance()->getVisible()) { - LLFloaterEnvSettings::show(); - - // otherwise, close it button acts like a toggle - } - else - { - LLFloaterEnvSettings::instance()->closeFloater(); - } + LLFloaterReg::toggleInstance("env_settings"); return true; } @@ -7735,17 +7570,7 @@ class LLWorldWaterSettings : public view_listener_t { bool handleEvent(const LLSD& userdata) { - // if not there or is hidden, show it - if( !LLFloaterWater::isOpen() || - !LLFloaterWater::instance()->getVisible()) { - LLFloaterWater::show(); - - // otherwise, close it button acts like a toggle - } - else - { - LLFloaterWater::instance()->closeFloater(); - } + LLFloaterReg::toggleInstance("env_water"); return true; } }; @@ -7755,7 +7580,7 @@ class LLWorldPostProcess : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterPostProcess::show(); + LLFloaterReg::showInstance("env_post_process"); return true; } }; @@ -7765,12 +7590,28 @@ class LLWorldDayCycle : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterDayCycle::show(); + LLFloaterReg::showInstance("env_day_cycle"); return true; } }; +/// Show First Time Tips calbacks +class LLHelpCheckShowFirstTimeTip : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return LLFirstTimeTipsManager::tipsEnabled(); + } +}; +class LLHelpShowFirstTimeTip : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFirstTimeTipsManager::enabledTip(!userdata.asBoolean()); + return true; + } +}; void initialize_menus() { @@ -7875,6 +7716,9 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); + view_listener_t::addMenu(new LLHelpCheckShowFirstTimeTip(), "Help.CheckShowFirstTimeTip"); + view_listener_t::addMenu(new LLHelpShowFirstTimeTip(), "Help.ShowQuickTips"); + // Tools menu view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); @@ -7983,11 +7827,12 @@ void initialize_menus() // Advanced > XUI - view_listener_t::addMenu(new LLAdvancedShowFontTest(), "Advanced.ShowFontTest"); + commit.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance())); view_listener_t::addMenu(new LLAdvancedLoadUIFromXML(), "Advanced.LoadUIFromXML"); view_listener_t::addMenu(new LLAdvancedSaveUIToXML(), "Advanced.SaveUIToXML"); view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); + view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs"); // Advanced > Character > Grab Baked Texture view_listener_t::addMenu(new LLAdvancedGrabBakedTexture(), "Advanced.GrabBakedTexture"); @@ -8023,7 +7868,6 @@ void initialize_menus() #ifndef LL_RELEASE_FOR_DOWNLOAD view_listener_t::addMenu(new LLAdvancedDebugAvatarTextures(), "Advanced.DebugAvatarTextures"); view_listener_t::addMenu(new LLAdvancedDumpAvatarLocalTextures(), "Advanced.DumpAvatarLocalTextures"); - view_listener_t::addMenu(new LLAdvancedMemoryLeakingSimulation(), "Advanced.MemoryLeakingSimulation"); #endif // Advanced > Network view_listener_t::addMenu(new LLAdvancedEnableMessageLog(), "Advanced.EnableMessageLog"); @@ -8071,7 +7915,6 @@ void initialize_menus() // Admin >Region view_listener_t::addMenu(new LLAdminHandleRegionDumpTempAssetData(), "Admin.HandleRegionDumpTempAssetData"); // Admin top level - view_listener_t::addMenu(new LLAdminShowGodTools(), "Admin.ShowGodTools"); view_listener_t::addMenu(new LLAdminOnSaveState(), "Admin.OnSaveState"); // Self pie menu @@ -8081,6 +7924,10 @@ void initialize_menus() view_listener_t::addMenu(new LLSelfEnableStandUp(), "Self.EnableStandUp"); view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); + // we don't use boost::bind directly to delay side tray construction + view_listener_t::addMenu(new LLSelfFriends(), "Self.Friends"); + view_listener_t::addMenu(new LLSelfGroups(), "Self.Groups"); + // Avatar pie menu view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); @@ -8099,7 +7946,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject"); // Object pie menu - view_listener_t::addMenu(new LLObjectOpen(), "Object.Open"); view_listener_t::addMenu(new LLObjectBuild(), "Object.Build"); view_listener_t::addMenu(new LLObjectTouch(), "Object.Touch"); view_listener_t::addMenu(new LLObjectSitOrStand(), "Object.SitOrStand"); @@ -8110,7 +7956,6 @@ void initialize_menus() view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); view_listener_t::addMenu(new LLObjectBuy(), "Object.Buy"); view_listener_t::addMenu(new LLObjectEdit(), "Object.Edit"); - view_listener_t::addMenu(new LLObjectInspect(), "Object.Inspect"); view_listener_t::addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); |