From be1c9a867440e4306348887ce07c88ba6cd31241 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Wed, 6 Oct 2010 16:45:45 -0700 Subject: PLAT-40 Fix changing the lang code for polish from 'da' to 'pl' reviewed by brad --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index d1cd335783..d5712f80cf 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -52,7 +52,7 @@ LangString LanguageCode ${LANG_JAPANESE} "ja" LangString LanguageCode ${LANG_ITALIAN} "it" LangString LanguageCode ${LANG_KOREAN} "ko" LangString LanguageCode ${LANG_DUTCH} "nl" -LangString LanguageCode ${LANG_POLISH} "da" +LangString LanguageCode ${LANG_POLISH} "pl" LangString LanguageCode ${LANG_PORTUGUESEBR} "pt" LangString LanguageCode ${LANG_SIMPCHINESE} "zh" -- cgit v1.2.3 From 54da19fdcfa3edadbc58a1f55a3503082e66f16e Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 22 Oct 2010 02:08:26 +0300 Subject: STORM-426 FIXED Menu button no longer looked pressed while its menu is displayed by another control. - LLMenuGL in menu button replaced by LLToggleableMenu that handles visibility change upon clicks inside specific button rect. - Added visibility change signal to LLToggleableMenu to update menu button pressed state. - Added using menu handle in LLMenuButton. --- indra/llui/llmenubutton.cpp | 100 +++++++++++++-------- indra/llui/llmenubutton.h | 19 ++-- indra/llui/lltoggleablemenu.cpp | 18 ++++ indra/llui/lltoggleablemenu.h | 5 ++ indra/newview/llinspectavatar.cpp | 5 +- indra/newview/llinspectobject.cpp | 3 +- indra/newview/lloutfitslist.cpp | 9 +- indra/newview/llpanellandmarks.cpp | 7 +- indra/newview/llpanellandmarks.h | 5 +- indra/newview/llpanelmaininventory.cpp | 3 +- indra/newview/llpanelmaininventory.h | 3 +- indra/newview/llpaneloutfitedit.cpp | 9 +- indra/newview/llpaneloutfitedit.h | 4 +- indra/newview/llpanelpeople.cpp | 9 +- indra/newview/llpanelteleporthistory.cpp | 3 +- indra/newview/llpanelwearing.cpp | 10 ++- .../default/xui/en/menu_add_wearable_gear.xml | 4 +- .../newview/skins/default/xui/en/menu_cof_gear.xml | 4 +- .../skins/default/xui/en/menu_gesture_gear.xml | 4 +- .../default/xui/en/menu_inspect_avatar_gear.xml | 4 +- .../default/xui/en/menu_inspect_object_gear.xml | 4 +- .../default/xui/en/menu_inspect_self_gear.xml | 4 +- .../default/xui/en/menu_inventory_gear_default.xml | 4 +- .../skins/default/xui/en/menu_outfit_gear.xml | 4 +- .../xui/en/menu_people_friends_view_sort.xml | 5 +- .../xui/en/menu_people_groups_view_sort.xml | 5 +- .../xui/en/menu_people_nearby_view_sort.xml | 5 +- .../xui/en/menu_people_recent_view_sort.xml | 5 +- .../default/xui/en/menu_places_gear_folder.xml | 4 +- .../default/xui/en/menu_places_gear_landmark.xml | 4 +- .../default/xui/en/menu_teleport_history_gear.xml | 4 +- .../skins/default/xui/en/menu_wearing_gear.xml | 4 +- 32 files changed, 175 insertions(+), 105 deletions(-) diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index c1b5efaa72..ac568a83e4 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -29,7 +29,7 @@ #include "llmenubutton.h" // Linden library includes -#include "llmenugl.h" +#include "lltoggleablemenu.h" #include "llstring.h" #include "v4color.h" @@ -44,22 +44,26 @@ LLMenuButton::Params::Params() LLMenuButton::LLMenuButton(const LLMenuButton::Params& p) : LLButton(p), - mMenu(NULL), - mMenuVisibleLastFrame(false), + mIsMenuShown(false), mMenuPosition(MP_BOTTOM_LEFT) { std::string menu_filename = p.menu_filename; if (!menu_filename.empty()) { - mMenu = LLUICtrlFactory::getInstance()->createFromFile(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); - if (!mMenu) + LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); + if (!menu) { llwarns << "Error loading menu_button menu" << llendl; + return; } - } - updateMenuOrigin(); + menu->setVisibilityChangeCallback(boost::bind(&LLMenuButton::onMenuVisibilityChange, this, _2)); + + mMenuHandle = menu->getHandle(); + + updateMenuOrigin(); + } } boost::signals2::connection LLMenuButton::setMouseDownCallback( const mouse_signal_t::slot_type& cb ) @@ -69,34 +73,34 @@ boost::signals2::connection LLMenuButton::setMouseDownCallback( const mouse_sign void LLMenuButton::hideMenu() { - if(!mMenu) return; - mMenu->setVisible(FALSE); + if(mMenuHandle.isDead()) return; + + LLToggleableMenu* menu = dynamic_cast(mMenuHandle.get()); + if (menu) + { + menu->setVisible(FALSE); + } } -void LLMenuButton::setMenu(LLMenuGL* menu, EMenuPosition position /*MP_TOP_LEFT*/) +LLToggleableMenu* LLMenuButton::getMenu() { - mMenu = menu; - mMenuPosition = position; + return dynamic_cast(mMenuHandle.get()); } -void LLMenuButton::draw() +void LLMenuButton::setMenu(LLToggleableMenu* menu, EMenuPosition position /*MP_TOP_LEFT*/) { - //we save this off so next frame when we try to close it by - //button click, and it hides menus before we get to it, we know - mMenuVisibleLastFrame = mMenu && mMenu->getVisible(); - - if (mMenuVisibleLastFrame) - { - setForcePressedState(true); - } + if (!menu) return; - LLButton::draw(); + mMenuHandle = menu->getHandle(); + mMenuPosition = position; - setForcePressedState(false); + menu->setVisibilityChangeCallback(boost::bind(&LLMenuButton::onMenuVisibilityChange, this, _2)); } BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask ) { + if (mMenuHandle.isDead()) return FALSE; + if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key)) { // *HACK: We emit the mouse down signal to fire the callback bound to the @@ -107,9 +111,10 @@ BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask ) return TRUE; } - if (mMenu && mMenu->getVisible() && key == KEY_ESCAPE && mask == MASK_NONE) + LLToggleableMenu* menu = dynamic_cast(mMenuHandle.get()); + if (menu && menu->getVisible() && key == KEY_ESCAPE && mask == MASK_NONE) { - mMenu->setVisible(FALSE); + menu->setVisible(FALSE); return TRUE; } @@ -119,6 +124,7 @@ BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask ) BOOL LLMenuButton::handleMouseDown(S32 x, S32 y, MASK mask) { LLButton::handleMouseDown(x, y, mask); + toggleMenu(); return TRUE; @@ -126,28 +132,38 @@ BOOL LLMenuButton::handleMouseDown(S32 x, S32 y, MASK mask) void LLMenuButton::toggleMenu() { - if(!mMenu) return; + if(mMenuHandle.isDead()) return; + + LLToggleableMenu* menu = dynamic_cast(mMenuHandle.get()); + if (!menu) return; - if (mMenu->getVisible() || mMenuVisibleLastFrame) + // Store the button rectangle to toggle menu visibility if a mouse event + // occurred inside or outside the button rect. + menu->setButtonRect(this); + + if (!menu->toggleVisibility() && mIsMenuShown) { - mMenu->setVisible(FALSE); + setForcePressedState(false); + mIsMenuShown = false; } else { - mMenu->buildDrawLabels(); - mMenu->arrangeAndClear(); - mMenu->updateParent(LLMenuGL::sMenuContainer); + menu->buildDrawLabels(); + menu->arrangeAndClear(); + menu->updateParent(LLMenuGL::sMenuContainer); updateMenuOrigin(); - //mMenu->needsArrange(); //so it recalculates the visible elements - LLMenuGL::showPopup(getParent(), mMenu, mX, mY); + LLMenuGL::showPopup(getParent(), menu, mX, mY); + + setForcePressedState(true); + mIsMenuShown = true; } } void LLMenuButton::updateMenuOrigin() { - if (!mMenu) return; + if (mMenuHandle.isDead()) return; LLRect rect = getRect(); @@ -156,7 +172,7 @@ void LLMenuButton::updateMenuOrigin() case MP_TOP_LEFT: { mX = rect.mLeft; - mY = rect.mTop + mMenu->getRect().getHeight(); + mY = rect.mTop + mMenuHandle.get()->getRect().getHeight(); break; } case MP_BOTTOM_LEFT: @@ -167,3 +183,17 @@ void LLMenuButton::updateMenuOrigin() } } } + +void LLMenuButton::onMenuVisibilityChange(const LLSD& param) +{ + bool new_visibility = param["visibility"].asBoolean(); + bool is_closed_by_button_click = param["closed_by_button_click"].asBoolean(); + + // Reset the button "pressed" state only if the menu is shown by this particular + // menu button (not any other control) and is not being closed by a click on the button. + if (!new_visibility && !is_closed_by_button_click && mIsMenuShown) + { + setForcePressedState(false); + mIsMenuShown = false; + } +} diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 81c3592b16..9e91b9e99d 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -29,7 +29,7 @@ #include "llbutton.h" -class LLMenuGL; +class LLToggleableMenu; class LLMenuButton : public LLButton @@ -52,14 +52,13 @@ public: boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ); - /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); void hideMenu(); - LLMenuGL* getMenu() { return mMenu; } - void setMenu(LLMenuGL* menu, EMenuPosition position = MP_TOP_LEFT); + LLToggleableMenu* getMenu(); + void setMenu(LLToggleableMenu* menu, EMenuPosition position = MP_TOP_LEFT); void setMenuPosition(EMenuPosition position) { mMenuPosition = position; } @@ -70,12 +69,14 @@ protected: void toggleMenu(); void updateMenuOrigin(); + void onMenuVisibilityChange(const LLSD& param); + private: - LLMenuGL* mMenu; - bool mMenuVisibleLastFrame; - EMenuPosition mMenuPosition; - S32 mX; - S32 mY; + LLHandle mMenuHandle; + bool mIsMenuShown; + EMenuPosition mMenuPosition; + S32 mX; + S32 mY; }; diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp index 0eb2dc1387..d29260750f 100644 --- a/indra/llui/lltoggleablemenu.cpp +++ b/indra/llui/lltoggleablemenu.cpp @@ -35,10 +35,22 @@ static LLDefaultChildRegistry::Register r("toggleable_menu"); LLToggleableMenu::LLToggleableMenu(const LLToggleableMenu::Params& p) : LLMenuGL(p), mButtonRect(), + mVisibilityChangeSignal(NULL), mClosedByButtonClick(false) { } +LLToggleableMenu::~LLToggleableMenu() +{ + delete mVisibilityChangeSignal; +} + +boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const commit_signal_t::slot_type& cb) +{ + if (!mVisibilityChangeSignal) mVisibilityChangeSignal = new commit_signal_t(); + return mVisibilityChangeSignal->connect(cb); +} + // virtual void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn) { @@ -49,6 +61,12 @@ void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn) { mClosedByButtonClick = true; } + + if (mVisibilityChangeSignal) + { + (*mVisibilityChangeSignal)(this, + LLSD().with("visibility", curVisibilityIn).with("closed_by_button_click", mClosedByButtonClick)); + } } void LLToggleableMenu::setButtonRect(const LLRect& rect, LLView* current_view) diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h index f036cdfffb..2094bd776f 100644 --- a/indra/llui/lltoggleablemenu.h +++ b/indra/llui/lltoggleablemenu.h @@ -41,6 +41,10 @@ protected: LLToggleableMenu(const Params&); friend class LLUICtrlFactory; public: + ~LLToggleableMenu(); + + boost::signals2::connection setVisibilityChangeCallback( const commit_signal_t::slot_type& cb ); + virtual void handleVisibilityChange (BOOL curVisibilityIn); const LLRect& getButtonRect() const { return mButtonRect; } @@ -57,6 +61,7 @@ public: protected: bool mClosedByButtonClick; LLRect mButtonRect; + commit_signal_t* mVisibilityChangeSignal; }; #endif // LL_LLTOGGLEABLEMENU_H diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 29dcb2c4d3..91ede6d221 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -53,6 +53,7 @@ #include "llfloaterreg.h" #include "llmenubutton.h" #include "lltextbox.h" +#include "lltoggleablemenu.h" #include "lltooltip.h" // positionViewNearMouse() #include "lltrans.h" #include "lluictrl.h" @@ -402,8 +403,8 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data) // if neither the gear menu or self gear menu are open void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask) { - LLMenuGL* gear_menu = getChild("gear_btn")->getMenu(); - LLMenuGL* gear_menu_self = getChild("gear_self_btn")->getMenu(); + LLToggleableMenu* gear_menu = getChild("gear_btn")->getMenu(); + LLToggleableMenu* gear_menu_self = getChild("gear_self_btn")->getMenu(); if ( gear_menu && gear_menu->getVisible() && gear_menu_self && gear_menu_self->getVisible() ) { diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 532ffca4be..ee076f68ea 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -47,6 +47,7 @@ #include "llsafehandle.h" #include "llsidetray.h" #include "lltextbox.h" // for description truncation +#include "lltoggleablemenu.h" #include "lltrans.h" #include "llui.h" // positionViewNearMouse() #include "lluictrl.h" @@ -568,7 +569,7 @@ void LLInspectObject::updateSecureBrowsing() // if the gear menu is not open void LLInspectObject::onMouseLeave(S32 x, S32 y, MASK mask) { - LLMenuGL* gear_menu = getChild("gear_btn")->getMenu(); + LLToggleableMenu* gear_menu = getChild("gear_btn")->getMenu(); if ( gear_menu && gear_menu->getVisible() ) { return; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 33c968bf00..70295259b3 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -42,6 +42,7 @@ #include "llnotificationsutil.h" #include "lloutfitobserver.h" #include "llsidetray.h" +#include "lltoggleablemenu.h" #include "lltransutil.h" #include "llviewermenu.h" #include "llvoavatar.h" @@ -122,7 +123,7 @@ public: enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); - mMenu = LLUICtrlFactory::getInstance()->createFromFile( + mMenu = LLUICtrlFactory::getInstance()->createFromFile( "menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(mMenu); } @@ -137,7 +138,7 @@ public: mMenu->arrangeAndClear(); // update menu height } - LLMenuGL* getMenu() { return mMenu; } + LLToggleableMenu* getMenu() { return mMenu; } private: const LLUUID& getSelectedOutfitID() @@ -251,8 +252,8 @@ private: return true; } - LLOutfitsList* mOutfitList; - LLMenuGL* mMenu; + LLOutfitsList* mOutfitList; + LLToggleableMenu* mMenu; }; ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index e5695f420a..d25b8e0e02 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -51,6 +51,7 @@ #include "llplacesinventorybridge.h" #include "llplacesinventorypanel.h" #include "llsidetray.h" +#include "lltoggleablemenu.h" #include "llviewermenu.h" #include "llviewerregion.h" @@ -706,8 +707,8 @@ void LLLandmarksPanel::initListCommandsHandlers() mCommitCallbackRegistrar.add("Places.LandmarksGear.Folding.Action", boost::bind(&LLLandmarksPanel::onFoldingAction, this, _2)); mEnableCallbackRegistrar.add("Places.LandmarksGear.Check", boost::bind(&LLLandmarksPanel::isActionChecked, this, _2)); mEnableCallbackRegistrar.add("Places.LandmarksGear.Enable", boost::bind(&LLLandmarksPanel::isActionEnabled, this, _2)); - mGearLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_places_gear_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mGearFolderMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_places_gear_folder.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mGearLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_places_gear_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mGearFolderMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_places_gear_folder.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::showActionMenu, this, mMenuAdd, ADD_BUTTON_NAME)); @@ -726,7 +727,7 @@ void LLLandmarksPanel::updateListCommands() void LLLandmarksPanel::onActionsButtonClick() { - LLMenuGL* menu = mGearFolderMenu; + LLToggleableMenu* menu = mGearFolderMenu; LLFolderViewItem* cur_item = NULL; if(mCurrentSelectedList) diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 28c19d3e5f..8dcbca0440 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -41,6 +41,7 @@ class LLAccordionCtrlTab; class LLFolderViewItem; class LLMenuButton; class LLMenuGL; +class LLToggleableMenu; class LLInventoryPanel; class LLPlacesInventoryPanel; @@ -157,8 +158,8 @@ private: LLPlacesInventoryPanel* mMyInventoryPanel; LLPlacesInventoryPanel* mLibraryInventoryPanel; LLMenuButton* mGearButton; - LLMenuGL* mGearLandmarkMenu; - LLMenuGL* mGearFolderMenu; + LLToggleableMenu* mGearLandmarkMenu; + LLToggleableMenu* mGearFolderMenu; LLMenuGL* mMenuAdd; LLPlacesInventoryPanel* mCurrentSelectedList; LLInventoryObserver* mInventoryObserver; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index cc69dbd9d4..904e3dabcc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -46,6 +46,7 @@ #include "llscrollcontainer.h" #include "llsdserialize.h" #include "llspinctrl.h" +#include "lltoggleablemenu.h" #include "lltooldraganddrop.h" #include "llviewermenu.h" #include "llviewertexturelist.h" @@ -915,7 +916,7 @@ void LLPanelMainInventory::initListCommandsHandlers() mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); - mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGearMenuButton->setMenu(mMenuGearDefault); mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index f95a99157d..d136e2d32e 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -42,6 +42,7 @@ class LLTabContainer; class LLFloaterInventoryFinder; class LLMenuButton; class LLMenuGL; +class LLToggleableMenu; class LLFloater; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -143,7 +144,7 @@ protected: void setUploadCostIfNeeded(); private: LLDragAndDropButton* mTrashButton; - LLMenuGL* mMenuGearDefault; + LLToggleableMenu* mMenuGearDefault; LLMenuGL* mMenuAdd; LLMenuButton* mGearMenuButton; diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 5638374178..6394239889 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -62,6 +62,7 @@ #include "llsaveoutfitcombobtn.h" #include "llscrolllistctrl.h" #include "lltextbox.h" +#include "lltoggleablemenu.h" #include "lltrans.h" #include "lluictrlfactory.h" #include "llsdutil.h" @@ -152,13 +153,13 @@ std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex class LLPanelOutfitEditGearMenu { public: - static LLMenuGL* create() + static LLToggleableMenu* create() { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Wearable.Create", boost::bind(onCreate, _2)); - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile( + LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(menu); if (menu) @@ -219,7 +220,7 @@ private: class LLAddWearablesGearMenu : public LLInitClass { public: - static LLMenuGL* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) + static LLToggleableMenu* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -234,7 +235,7 @@ public: enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile( + LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_add_wearable_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 963db84503..fd366e9cbc 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -233,8 +233,8 @@ private: std::vector mListViewItemTypes; LLCOFWearables* mCOFWearables; - LLMenuGL* mGearMenu; - LLMenuGL* mAddWearablesGearMenu; + LLToggleableMenu* mGearMenu; + LLToggleableMenu* mAddWearablesGearMenu; bool mInitialized; std::auto_ptr mSaveComboBtn; LLMenuButton* mWearablesGearMenuBtn; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b79a2d3224..71c812efe2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -35,6 +35,7 @@ #include "lleventtimer.h" #include "llfiltereditor.h" #include "lltabcontainer.h" +#include "lltoggleablemenu.h" #include "lluictrlfactory.h" #include "llpanelpeople.h" @@ -632,28 +633,28 @@ BOOL LLPanelPeople::postBuild() LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); - LLMenuGL* nearby_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_nearby_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLToggleableMenu* nearby_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_nearby_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if(nearby_view_sort) { mNearbyViewSortMenuHandle = nearby_view_sort->getHandle(); mNearbyGearButton->setMenu(nearby_view_sort); } - LLMenuGL* friend_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_friends_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLToggleableMenu* friend_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_friends_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if(friend_view_sort) { mFriendsViewSortMenuHandle = friend_view_sort->getHandle(); mFriendsGearButton->setMenu(friend_view_sort); } - LLMenuGL* group_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_groups_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLToggleableMenu* group_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_groups_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if(group_view_sort) { mGroupsViewSortMenuHandle = group_view_sort->getHandle(); mGroupsGearButton->setMenu(group_view_sort); } - LLMenuGL* recent_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_recent_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLToggleableMenu* recent_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_recent_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if(recent_view_sort) { mRecentViewSortMenuHandle = recent_view_sort->getHandle(); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 766f93e0a5..fff8ccb912 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -41,6 +41,7 @@ #include "llflatlistview.h" #include "llnotificationsutil.h" #include "lltextbox.h" +#include "lltoggleablemenu.h" #include "llviewermenu.h" #include "lllandmarkactions.h" #include "llclipboard.h" @@ -450,7 +451,7 @@ BOOL LLTeleportHistoryPanel::postBuild() mMenuGearButton = getChild("gear_btn"); - LLMenuGL* gear_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());; + LLToggleableMenu* gear_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());; if(gear_menu) { mGearMenuHandle = gear_menu->getHandle(); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3b3d0cdce5..911a9e5dda 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -28,6 +28,8 @@ #include "llpanelwearing.h" +#include "lltoggleablemenu.h" + #include "llappearancemgr.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" @@ -59,12 +61,12 @@ public: enable_registrar.add("Gear.OnEnable", boost::bind(&LLPanelWearing::isActionEnabled, mPanelWearing, _2)); - mMenu = LLUICtrlFactory::getInstance()->createFromFile( + mMenu = LLUICtrlFactory::getInstance()->createFromFile( "menu_wearing_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(mMenu); } - LLMenuGL* getMenu() { return mMenu; } + LLToggleableMenu* getMenu() { return mMenu; } private: @@ -79,8 +81,8 @@ private: } } - LLMenuGL* mMenu; - LLPanelWearing* mPanelWearing; + LLToggleableMenu* mMenu; + LLPanelWearing* mPanelWearing; }; ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml b/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml index 1925d3396f..5033ea9546 100644 --- a/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_cof_gear.xml b/indra/newview/skins/default/xui/en/menu_cof_gear.xml index c2a11a64ec..a6e9a40e31 100644 --- a/indra/newview/skins/default/xui/en/menu_cof_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_cof_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml index 649f0edff7..b08d21e8f4 100644 --- a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml index 334decdf58..58d58a6ca9 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml index 76f68c6d4b..f818ebe2d7 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml index 30c2cde552..50ad3f834e 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index c394700081..679d5bc82e 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 732b8a788d..5fc25b8f0f 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -1,5 +1,5 @@ - @@ -212,4 +212,4 @@ function="Gear.OnVisible" parameter="delete" /> - + diff --git a/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml index 22796f7b68..29eeb93ac1 100644 --- a/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml @@ -1,5 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml index 2efb204ffb..c710fe3b9b 100644 --- a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml @@ -1,5 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml index 69b3831738..f9db64b524 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -1,5 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml index 5c9555db92..0634e3bd3b 100644 --- a/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml @@ -1,5 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 77cc3910fd..6f46165883 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml index 4b8bc8132f..121e7cc07a 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_gear.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_gear.xml index 134b331514..bc7d4fe33b 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_gear.xml @@ -1,5 +1,5 @@ - - + diff --git a/indra/newview/skins/default/xui/en/menu_wearing_gear.xml b/indra/newview/skins/default/xui/en/menu_wearing_gear.xml index 84ab16c709..0ac2c14253 100644 --- a/indra/newview/skins/default/xui/en/menu_wearing_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_wearing_gear.xml @@ -1,5 +1,5 @@ - @@ -20,4 +20,4 @@ function="Gear.OnEnable" parameter="take_off" /> - + -- cgit v1.2.3 From 6f4a21531ae7e5d095034f7315501421dd94d124 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 21 Oct 2010 17:12:24 -0700 Subject: STORM-173 : never enable return object if no object selected --- indra/newview/llviewermenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ccf3df827d..dc7c6f17a9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4160,6 +4160,12 @@ class LLObjectEnableReturn : public view_listener_t { bool handleEvent(const LLSD& userdata) { + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if (!node) + { + // Do not enable if nothing selected + return false; + } #ifdef HACKED_GODLIKE_VIEWER bool new_value = true; #else -- cgit v1.2.3 From 9e8ff9be024edb279ba1e22548ee3fc48214fda5 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 22 Oct 2010 20:14:13 +0300 Subject: STORM-449 FIXED Updated some notification templates for NL locale to display avatar names correctly. --- indra/newview/skins/default/xui/nl/notifications.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/skins/default/xui/nl/notifications.xml b/indra/newview/skins/default/xui/nl/notifications.xml index a282c70364..b4b56a035f 100644 --- a/indra/newview/skins/default/xui/nl/notifications.xml +++ b/indra/newview/skins/default/xui/nl/notifications.xml @@ -2409,10 +2409,10 @@ Wilt u de [SECOND_LIFE] website bezoeken om dit in te stellen? Onderwerp: [SUBJECT], Bericht: [MESSAGE] - [FIRST] [LAST] is Online + [NAME] is Online - [FIRST] [LAST] is Offline + [NAME] is Offline U kunt uzelf niet als vriend toevoegen. @@ -2574,7 +2574,7 @@ Indien u streaming media wilt zien op percelen die dit ondersteunen, dient u naa De objecten die uw eigendom zijn op het geselecteerde perceel zijn geretourneerd naar uw inventaris. - De objecten op het geselecteerde perceel dat het eigendom is van [FIRST] [LAST], zijn geretourneerd naar zijn of haar inventaris. + De objecten op het geselecteerde perceel dat het eigendom is van [NAME], zijn geretourneerd naar zijn of haar inventaris. De objecten op het geselecteerde perceel dat het eigendom is van inwoner '[NAME]', zijn geretourneerd naar hun eigenaar. @@ -2701,7 +2701,7 @@ Probeer het alstublieft opnieuw over enkele ogenblikken. Geen geldig perceel kon gevonden worden. - Een object genaamd [OBJECTFROMNAME], eigendom van [FIRST] [LAST], heeft u een [OBJECTTYPE] genaamd [OBJECTNAME] gegeven. + Een object genaamd <nolink>[OBJECTFROMNAME]</nolink>, eigendom van [NAME_SLURL], heeft u een [OBJECTTYPE] genaamd [ITEM_SLURL] gegeven.