diff --git a/indra/newview/fsfloaterteleporthistory.cpp b/indra/newview/fsfloaterteleporthistory.cpp index 1cd6930645..f9ec067f38 100644 --- a/indra/newview/fsfloaterteleporthistory.cpp +++ b/indra/newview/fsfloaterteleporthistory.cpp @@ -33,6 +33,7 @@ #include "llpanelteleporthistory.h" #include "llbutton.h" #include "llfiltereditor.h" +#include "llmenubutton.h" FSFloaterTeleportHistory::FSFloaterTeleportHistory(const LLSD& seed) : LLFloater(seed), @@ -53,14 +54,6 @@ BOOL FSFloaterTeleportHistory::postBuild() { mHistoryPanel->setIsStandAlone(true); - mHistoryPanel->mTeleportBtn = getChild("teleport_btn"); - mHistoryPanel->mShowOnMapBtn = getChild("map_btn"); - mHistoryPanel->mShowProfile = getChild("profile_btn"); - - mHistoryPanel->mTeleportBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onTeleport, mHistoryPanel)); - mHistoryPanel->mShowProfile->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowProfile, mHistoryPanel)); - mHistoryPanel->mShowOnMapBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowOnMap, mHistoryPanel)); - mFilterEditor = getChild("Filter"); if (mFilterEditor) { @@ -74,6 +67,12 @@ BOOL FSFloaterTeleportHistory::postBuild() getChildView("history_placeholder")->addChild(mHistoryPanel); mHistoryPanel->onSearchEdit(""); + + mGearMenuButton = getChild("options_gear_btn"); + mGearMenuButton->setMouseDownCallback(boost::bind(&FSFloaterTeleportHistory::onGearMenuClick, this)); + + mSortingMenuButton = getChild("sorting_menu_btn"); + mSortingMenuButton->setMouseDownCallback(boost::bind(&FSFloaterTeleportHistory::onSortingMenuClick, this)); } else { @@ -117,3 +116,13 @@ BOOL FSFloaterTeleportHistory::handleKeyHere(KEY key, MASK mask) return LLFloater::handleKeyHere(key, mask); } + +void FSFloaterTeleportHistory::onGearMenuClick() +{ + mGearMenuButton->setMenu(mHistoryPanel->getSelectionMenu(), LLMenuButton::MP_BOTTOM_LEFT); +} + +void FSFloaterTeleportHistory::onSortingMenuClick() +{ + mSortingMenuButton->setMenu(mHistoryPanel->getSortingMenu(), LLMenuButton::MP_BOTTOM_LEFT); +} diff --git a/indra/newview/fsfloaterteleporthistory.h b/indra/newview/fsfloaterteleporthistory.h index dbdb915719..f75f8d4ba9 100644 --- a/indra/newview/fsfloaterteleporthistory.h +++ b/indra/newview/fsfloaterteleporthistory.h @@ -32,6 +32,7 @@ class LLFilterEditor; class LLTeleportHistoryPanel; +class LLMenuButton; class FSFloaterTeleportHistory : public LLFloater { @@ -47,9 +48,13 @@ public: private: void onFilterEdit(const std::string& search_string, bool force_filter); + void onGearMenuClick(); + void onSortingMenuClick(); LLTeleportHistoryPanel* mHistoryPanel; LLFilterEditor* mFilterEditor; + LLMenuButton* mGearMenuButton; + LLMenuButton* mSortingMenuButton; }; #endif // FS_FLOATERTELEPORTHISTORY_H diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index f79729fc43..89efaab906 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1307,39 +1307,30 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe void LLEnvironment::setManualEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) { LLSettingsBase::Seconds transitionTime(static_cast(gSavedSettings.getF32("FSEnvironmentManualTransitionTime"))); - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, transitionTime, env_version); + setEnvironment(env, assetId, transitionTime, env_version); } // void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) { - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, env_version); -} - -void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition, S32 env_version) -{ - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, transition, env_version); + setEnvironment(env, assetId, TRANSITION_DEFAULT, env_version); } void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version) { LLSettingsVOBase::getSettingsAsset(assetId, - [this, env, daylength, dayoffset, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { - onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, transition, status, env_version); + onSetEnvAssetLoaded(env, asset_id, settings, transition, status, env_version); }); } void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version) @@ -1818,7 +1809,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI LL_WARNS("ENVIRONMENT") << "No DayCycle specified - setting default" << LL_ENDL; if (LLGridManager::getInstance()->isInSecondLife()) { - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } // @@ -1828,7 +1819,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI { LL_WARNS("ENVIRONMENT") << "Invalid day cycle for region" << LL_ENDL; clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } else @@ -3078,17 +3069,15 @@ bool LLEnvironment::loadFromSettings() if (env_data.has("day_id")) { - LLSettingsDay::Seconds length = LLSettingsDay::Seconds(env_data["day_length"].asInteger()); - LLSettingsDay::Seconds offset = LLSettingsDay::Seconds(env_data["day_offset"].asInteger()); LLUUID assetId = env_data["day_id"].asUUID(); LLSettingsVOBase::getSettingsAsset(assetId, - [this, length, offset, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { // Day should be always applied first, // otherwise it will override sky or water that was set earlier // so wait for asset to load before applying sky/water - onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, length, offset, TRANSITION_DEFAULT, status, NO_VERSION); + onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, TRANSITION_DEFAULT, status, NO_VERSION); bool valid = false, has_assets = false; loadSkyWaterFromSettings(env_data, valid, has_assets); if (!has_assets && valid) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 70c6b96608..21ca9db50c 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -144,7 +144,6 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t()), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); } - void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, S32 env_version = NO_VERSION); // FIRE-29926 - Allow configurable transition times @@ -459,7 +458,7 @@ private: void onAgentPositionHasChanged(const LLVector3 &localpos); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsBase::Seconds transition, S32 status, S32 env_version); void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes); void handleEnvironmentPushClear(LLUUID experience_id, LLSD &message, F32 transition); diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 939089e22a..fe99e60e06 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -992,7 +992,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.size(); j++) { - last_new_button = createButton(mItems[j], button_params, last_right_edge); + last_new_button = createButton(mItems[j], button_params, j == 0? last_right_edge + 4 : last_right_edge); if (!last_new_button) { break; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3fa4f67158..a408e4af11 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4534,7 +4534,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); - if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) + if (model->findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE) == mUUID) + { + items.push_back(std::string("Reset Favorites folder")); + } + else if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) { items.push_back(std::string("Set Favorites folder")); } @@ -7838,8 +7842,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action return; LLUUID asset_id = item->getAssetUUID(); // FIRE-30701 - Allow crossfade time to apply when using EEP from inventory. - //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_FAST); - //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_INSTANT); + //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, asset_id); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 297f7246cd..521ba32e05 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -193,6 +193,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); mCommitCallbackRegistrar.add("Inventory.SetFavoritesFolder", boost::bind(&LLInventoryPanel::setFavoritesFolder, this, _2)); + mCommitCallbackRegistrar.add("Inventory.ResetFavoritesFolder", boost::bind(&LLInventoryPanel::resetFavoritesFolder, this, _2)); mCommitCallbackRegistrar.add("Inventory.CustomAction", boost::bind(&LLInventoryPanel::onCustomAction, this, _2)); // Prevent warning "No callback found for: 'Inventory.CustomAction' in control: Find Links" } @@ -1618,6 +1619,11 @@ void LLInventoryPanel::setFavoritesFolder(const LLSD& userdata) gSavedPerAccountSettings.setString("FavoritesFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); } +void LLInventoryPanel::resetFavoritesFolder(const LLSD& userdata) +{ + gSavedPerAccountSettings.setString("FavoritesFolder", ""); +} + void LLInventoryPanel::purgeSelectedItems() { if (!mFolderRoot.get()) return; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 629c4fe1d6..268073c931 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -228,6 +228,7 @@ public: bool beginIMSession(); void fileUploadLocation(const LLSD& userdata); void setFavoritesFolder(const LLSD& userdata); + void resetFavoritesFolder(const LLSD& userdata); void purgeSelectedItems(); bool attachObject(const LLSD& userdata); static void idle(void* user_data); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index edd2d4e91b..58779e3295 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -59,6 +59,7 @@ #include "llweb.h" #include "llhints.h" +#include "llfloatersidepanelcontainer.h" #include "llinventorymodel.h" #include "lllandmarkactions.h" @@ -312,6 +313,7 @@ void LLNavigationBar::setupPanel() // mBtnBack = getChild("back_btn"); // mBtnForward = getChild("forward_btn"); // mBtnHome = getChild("home_btn"); + // mBtnLandmarks = getChild("landmarks_btn"); // mCmbLocation= getChild("location_combo"); @@ -320,6 +322,7 @@ void LLNavigationBar::setupPanel() mBtnBack = mView->getChild("back_btn"); mBtnForward = mView->getChild("forward_btn"); mBtnHome = mView->getChild("home_btn"); + //mBtnLandmarks = mView->getChild("landmarks_btn"); // We don't use that right now... mCmbLocation = mView->getChild("location_combo"); mSearchComboBox = mView->getChild("search_combo_box"); @@ -350,6 +353,8 @@ void LLNavigationBar::setupPanel() //mBtnHome->setClickedCallback(boost::bind(&LLNavigationBar::onHomeButtonClicked, this)); mBtnHome->setClickedCallback(boost::bind(&LLNavigationBar::onHomeButtonClicked, this, _1)); + //mBtnLandmarks->setClickedCallback(boost::bind(&LLNavigationBar::onLandmarksButtonClicked, this)); // We don't use that right now... + mCmbLocation->setCommitCallback(boost::bind(&LLNavigationBar::onLocationSelection, this)); mSearchComboBox->setCommitCallback(boost::bind(&LLNavigationBar::onSearchCommit, this)); @@ -490,6 +495,12 @@ void LLNavigationBar::onHomeButtonClicked(LLUICtrl* ctrl) gFocusMgr.releaseFocusIfNeeded(ctrl); // [FS:CR] FIRE-12333 } +void LLNavigationBar::onLandmarksButtonClicked() +{ + LLFloaterReg::toggleInstanceOrBringToFront("places"); + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "open_landmark_tab")); +} + void LLNavigationBar::onSearchCommit() { std::string search_query = mSearchComboBox->getSimple(); diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index bf82e270bd..bb5952e9f1 100755 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -137,6 +137,7 @@ private: //void onHomeButtonClicked(); void onForwardButtonClicked(LLUICtrl* ctrl); void onHomeButtonClicked(LLUICtrl* ctrl); + void onLandmarksButtonClicked(); void onLocationSelection(); void onLocationPrearrange(const LLSD& data); void onSearchCommit(); @@ -173,6 +174,7 @@ private: LLPullButton* mBtnBack; LLPullButton* mBtnForward; LLButton* mBtnHome; + LLButton* mBtnLandmarks; LLSearchComboBox* mSearchComboBox; LLLocationInputCtrl* mCmbLocation; // No size calculations in code please. XUI handles it all now with visibility_control diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 20e7fc6b83..b655f78129 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -42,7 +42,6 @@ #include "llagentui.h" #include "llavataractions.h" #include "llcallbacklist.h" -#include "lldndbutton.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "llfolderviewitem.h" @@ -65,11 +64,7 @@ // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLPanelInjector t_landmarks("panel_landmarks"); -static const std::string OPTIONS_BUTTON_NAME = "options_gear_btn"; -static const std::string ADD_BUTTON_NAME = "add_btn"; -//static const std::string ADD_FOLDER_BUTTON_NAME = "add_folder_btn"; // Doesn't exist as of 18-11-2017 -static const std::string TRASH_BUTTON_NAME = "trash_btn"; - +static const std::string TAB_FAVORITES = "tab_favorites"; // helper functions static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::string& string); @@ -200,10 +195,10 @@ LLLandmarksPanel::LLLandmarksPanel() , mMyInventoryPanel(NULL) , mLibraryInventoryPanel(NULL) , mCurrentSelectedList(NULL) - , mListCommands(NULL) - , mGearButton(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) + , mSortingMenu(NULL) + , mAddMenu(NULL) , mMyLandmarksAccordionTab(NULL) // Fix warnings log spam { mInventoryObserver = new LLLandmarksPanelObserver(this); @@ -301,11 +296,6 @@ void LLLandmarksPanel::onShowOnMap() return; } - // Disable the "Map" button because loading landmark can take some time. - // During this time the button is useless. It will be enabled on callback finish - // or upon switching to other item. - mShowOnMapBtn->setEnabled(FALSE); - doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doShowOnMap, this, _1)); } @@ -330,6 +320,12 @@ void LLLandmarksPanel::onTeleport() } } +/*virtual*/ +void LLLandmarksPanel::onRemoveSelected() +{ + onClipboardAction("delete"); +} + // virtual bool LLLandmarksPanel::isSingleItemSelected() { @@ -348,22 +344,42 @@ bool LLLandmarksPanel::isSingleItemSelected() return result; } +// virtual +LLToggleableMenu* LLLandmarksPanel::getSelectionMenu() +{ + LLToggleableMenu* menu = mGearFolderMenu; + + if (mCurrentSelectedList) + { + LLFolderViewModelItemInventory* listenerp = getCurSelectedViewModelItem(); + if (!listenerp) + return menu; + + if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + menu = mGearLandmarkMenu; + } + } + return menu; +} + +// virtual +LLToggleableMenu* LLLandmarksPanel::getSortingMenu() +{ + return mSortingMenu; +} + +// virtual +LLToggleableMenu* LLLandmarksPanel::getCreateMenu() +{ + return mAddMenu; +} + // virtual void LLLandmarksPanel::updateVerbs() { if (!isTabVisible()) return; - - bool landmark_selected = isLandmarkSelected(); - mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport")); - mShowProfile->setEnabled(landmark_selected && isActionEnabled("more_info")); - mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map")); - - // TODO: mantipov: Uncomment when mShareBtn is supported - // Share button should be enabled when neither a folder nor a landmark is selected - //mShareBtn->setEnabled(NULL != current_item); - - updateListCommands(); } void LLLandmarksPanel::onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action) @@ -413,7 +429,7 @@ void LLLandmarksPanel::updateShowFolderState() void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) { - if (selectItemInAccordionTab(mFavoritesInventoryPanel, "tab_favorites", obj_id, take_keyboard_focus)) + if (selectItemInAccordionTab(mFavoritesInventoryPanel, TAB_FAVORITES, obj_id, take_keyboard_focus)) { return; } @@ -561,6 +577,12 @@ void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) } } +void LLLandmarksPanel::resetSelection() +{ + getChild(TAB_FAVORITES)->setDisplayChildren(true); + getChild(TAB_FAVORITES)->showAndFocusHeader(); +} + // virtual void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data) { @@ -611,7 +633,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() initLandmarksPanel(mFavoritesInventoryPanel); mFavoritesInventoryPanel->getFilter().setEmptyLookupMessage("FavoritesNoMatchingItems"); - initAccordion("tab_favorites", mFavoritesInventoryPanel, true); + initAccordion(TAB_FAVORITES, mFavoritesInventoryPanel, true); } void LLLandmarksPanel::initLandmarksInventoryPanel() @@ -730,40 +752,29 @@ void LLLandmarksPanel::deselectOtherThan(const LLPlacesInventoryPanel* inventory if (inventory_list != mFavoritesInventoryPanel) { mFavoritesInventoryPanel->clearSelection(); + mFavoritesInventoryPanel->getRootFolder()->clearSelection(); } if (inventory_list != mLandmarksInventoryPanel) { mLandmarksInventoryPanel->clearSelection(); + mLandmarksInventoryPanel->getRootFolder()->clearSelection(); } if (inventory_list != mMyInventoryPanel) { mMyInventoryPanel->clearSelection(); + mMyInventoryPanel->getRootFolder()->clearSelection(); } if (inventory_list != mLibraryInventoryPanel) { mLibraryInventoryPanel->clearSelection(); + mLibraryInventoryPanel->getRootFolder()->clearSelection(); } } // List Commands Handlers void LLLandmarksPanel::initListCommandsHandlers() { - mListCommands = getChild("bottom_panel"); - - mGearButton = getChild(OPTIONS_BUTTON_NAME); - mGearButton->setMouseDownCallback(boost::bind(&LLLandmarksPanel::onActionsButtonClick, this)); - - mListCommands->childSetAction(TRASH_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onTrashButtonClick, this)); - - LLDragAndDropButton* trash_btn = mListCommands->getChild(TRASH_BUTTON_NAME); - trash_btn->setDragAndDropHandler(boost::bind(&LLLandmarksPanel::handleDragAndDropToTrash, this - , _4 // BOOL drop - , _5 // EDragAndDropType cargo_type - , _6 // void* cargo_data - , _7 // EAcceptance* accept - )); - mCommitCallbackRegistrar.add("Places.LandmarksGear.Add.Action", boost::bind(&LLLandmarksPanel::onAddAction, this, _2)); mCommitCallbackRegistrar.add("Places.LandmarksGear.CopyPaste.Action", boost::bind(&LLLandmarksPanel::onClipboardAction, this, _2)); mCommitCallbackRegistrar.add("Places.LandmarksGear.Custom.Action", boost::bind(&LLLandmarksPanel::onCustomAction, this, _2)); @@ -772,23 +783,15 @@ void LLLandmarksPanel::initListCommandsHandlers() 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()); - mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mSortingMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_places_gear_sorting.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mAddMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGearLandmarkMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2)); mGearFolderMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2)); - mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::showActionMenu, this, mMenuAdd, ADD_BUTTON_NAME)); -} - - -void LLLandmarksPanel::updateListCommands() -{ - //bool add_folder_enabled = isActionEnabled("category"); // Doesn't exist as of 18-11-2017 - bool trash_enabled = isActionEnabled("delete") && (isFolderSelected() || isLandmarkSelected()); - - // keep Options & Add Landmark buttons always enabled - //mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled); // Doesn't exist as of 18-11-2017 - mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled); + // show menus even if all items are disabled + mGearLandmarkMenu->setAlwaysShowMenu(TRUE); + mGearFolderMenu->setAlwaysShowMenu(TRUE); } void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu) @@ -796,43 +799,6 @@ void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu) onMenuVisibilityChange(menu, LLSD().with("visibility", true)); } -void LLLandmarksPanel::onActionsButtonClick() -{ - LLToggleableMenu* menu = mGearFolderMenu; - - if(mCurrentSelectedList) - { - LLFolderViewModelItemInventory* listenerp = getCurSelectedViewModelItem(); - if(!listenerp) - return; - - if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - menu = mGearLandmarkMenu; - } - } - - mGearButton->setMenu(menu); -} - -void LLLandmarksPanel::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) -{ - if (menu) - { - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - menu->arrangeAndClear(); - - LLView* spawning_view = getChild(spawning_view_name); - - S32 menu_x, menu_y; - //show menu in co-ordinates of panel - spawning_view->localPointToOtherView(0, spawning_view->getRect().getHeight(), &menu_x, &menu_y, this); - menu_y += menu->getRect().getHeight(); - LLMenuGL::showPopup(this, menu, menu_x, menu_y); - } -} - void LLLandmarksPanel::onTrashButtonClick() const { onClipboardAction("delete"); @@ -844,7 +810,8 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const LLFolderViewItem* item = getCurSelectedItem(); std::string command_name = userdata.asString(); - if("add_landmark" == command_name) + if("add_landmark" == command_name + || "add_landmark_root" == command_name) { // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) @@ -859,8 +826,8 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const { LLSD args; args["type"] = "create_landmark"; - if (view_model->getInventoryType() - == LLInventoryType::IT_CATEGORY) + if ("add_landmark" == command_name + && view_model->getInventoryType() == LLInventoryType::IT_CATEGORY) { args["dest_folder"] = view_model->getUUID(); } @@ -909,6 +876,17 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const } } } + else if ("category_root" == command_name) + { + //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) + menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), + gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); + + if (mMyLandmarksAccordionTab) + { + mMyLandmarksAccordionTab->changeOpenClose(false); + } + } } void LLLandmarksPanel::onClipboardAction(const LLSD& userdata) const @@ -1114,7 +1092,12 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const return true; } - else if ("category" == command_name) + if ("category_root" == command_name) + { + // Landmarks Accordion + return true; + } + else if("category" == command_name) { // FIRE-29367: Available actions in "Add" button menu in places window are incorrect //// we can add folder only in Landmarks Accordion @@ -1203,6 +1186,16 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC) && current_tabname != "tab_library"; // } + else if ("add_landmark_root" == command_name) + { + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if (landmark) + { + //already exists + return false; + } + return true; + } else if ("share" == command_name) { if (!mCurrentSelectedList) @@ -1459,7 +1452,6 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) LLFloaterReg::showInstance("world_map", "center"); } - mShowOnMapBtn->setEnabled(TRUE); mGearLandmarkMenu->setItemEnabled("show_on_map", TRUE); } diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index e8fb62e0e8..95256f4bb4 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -52,13 +52,23 @@ public: LLLandmarksPanel(); virtual ~LLLandmarksPanel(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onSearchEdit(const std::string& string); - /*virtual*/ void onShowOnMap(); - /*virtual*/ void onShowProfile(); - /*virtual*/ void onTeleport(); - /*virtual*/ void updateVerbs(); - /*virtual*/ bool isSingleItemSelected(); + BOOL postBuild() override; + void onSearchEdit(const std::string& string) override; + void onShowOnMap() override; + void onShowProfile() override; + void onTeleport() override; + void onRemoveSelected() override; + void updateVerbs() override; + bool isSingleItemSelected() override; + + LLToggleableMenu* getSelectionMenu() override; + LLToggleableMenu* getSortingMenu() override; + LLToggleableMenu* getCreateMenu() override; + + /** + * Processes drag-n-drop of the Landmarks and folders into trash button. + */ + bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override; void onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action); void onSelectorButtonClicked(); @@ -84,6 +94,8 @@ public: void doCreatePick(LLLandmark* landmark, const LLUUID &item_id ); + void resetSelection(); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark @@ -108,9 +120,9 @@ protected: void updateSortOrder(LLInventoryPanel* panel, bool byDate); //LLRemoteParcelInfoObserver interface - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - /*virtual*/ void setParcelID(const LLUUID& parcel_id); - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); + void processParcelInfo(const LLParcelData& parcel_data) override; + void setParcelID(const LLUUID& parcel_id) override; + void setErrorStatus(S32 status, const std::string& reason) override; private: void initFavoritesInventoryPanel(); @@ -124,9 +136,6 @@ private: // List Commands Handlers void initListCommandsHandlers(); - void updateListCommands(); - void onActionsButtonClick(); - void showActionMenu(LLMenuGL* menu, std::string spawning_view_name); void onTrashButtonClick() const; void onAddAction(const LLSD& command_name) const; void onClipboardAction(const LLSD& command_name) const; @@ -152,11 +161,6 @@ private: bool canItemBeModified(const std::string& command_name, LLFolderViewItem* item) const; void onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* owner, const LLSD& params); - /** - * Processes drag-n-drop of the Landmarks and folders into trash button. - */ - bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept); - /** * Landmark actions callbacks. Fire when a landmark is loaded from the list. */ @@ -170,14 +174,12 @@ private: LLPlacesInventoryPanel* mLandmarksInventoryPanel; LLPlacesInventoryPanel* mMyInventoryPanel; LLPlacesInventoryPanel* mLibraryInventoryPanel; - LLMenuButton* mGearButton; LLToggleableMenu* mGearLandmarkMenu; LLToggleableMenu* mGearFolderMenu; - LLMenuGL* mMenuAdd; + LLToggleableMenu* mSortingMenu; + LLToggleableMenu* mAddMenu; LLPlacesInventoryPanel* mCurrentSelectedList; LLInventoryObserver* mInventoryObserver; - - LLPanel* mListCommands; typedef std::vector accordion_tabs_t; accordion_tabs_t mAccordionTabs; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 05846054b1..efed821da2 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -53,6 +53,7 @@ #include "llagentpicksinfo.h" #include "llavatarpropertiesprocessor.h" #include "llcommandhandler.h" +#include "lldndbutton.h" #include "llfloaterworldmap.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" @@ -305,8 +306,25 @@ BOOL LLPanelPlaces::postBuild() mOverflowBtn = getChild("overflow_btn"); mOverflowBtn->setMouseDownCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); - mPlaceInfoBtn = getChild("profile_btn"); - mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this)); + mGearMenuButton = getChild("options_gear_btn"); + mGearMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onGearMenuClick, this)); + + mSortingMenuButton = getChild("sorting_menu_btn"); + mSortingMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onSortingMenuClick, this)); + + mAddMenuButton = getChild("add_menu_btn"); + mAddMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onAddMenuClick, this)); + + mRemoveSelectedBtn = getChild("trash_btn"); + mRemoveSelectedBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onRemoveButtonClicked, this)); + + LLDragAndDropButton* trash_btn = (LLDragAndDropButton*)mRemoveSelectedBtn; + trash_btn->setDragAndDropHandler(boost::bind(&LLPanelPlaces::handleDragAndDropToTrash, this + , _4 // BOOL drop + , _5 // EDragAndDropType cargo_type + , _6 // void* cargo_data + , _7 // EAcceptance* accept + )); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Places.OverflowMenu.Action", boost::bind(&LLPanelPlaces::onOverflowMenuItemClicked, this, _2)); @@ -335,6 +353,10 @@ BOOL LLPanelPlaces::postBuild() mTabContainer->setCommitCallback(boost::bind(&LLPanelPlaces::onTabSelected, this)); } + mButtonsContainer = getChild("button_layout_panel"); + mButtonsContainer->setVisible(FALSE); + mFilterContainer = getChild("top_menu_panel"); + mFilterEditor = getChild("Filter"); if (mFilterEditor) { @@ -663,6 +685,12 @@ void LLPanelPlaces::onTabSelected() onFilterEdit(mActivePanel->getFilterSubString(), true); mActivePanel->updateVerbs(); + + // History panel does not support deletion nor creation + // Hide menus + bool supports_create = mActivePanel->getCreateMenu() != NULL; + childSetVisible("add_btn_panel", supports_create); + childSetVisible("trash_btn_panel", supports_create); } void LLPanelPlaces::onTeleportButtonClicked() @@ -940,14 +968,6 @@ void LLPanelPlaces::onOverflowButtonClicked() mOverflowBtn->setMenu(menu, LLMenuButton::MP_TOP_RIGHT); } -void LLPanelPlaces::onProfileButtonClicked() -{ - if (!mActivePanel) - return; - - mActivePanel->onShowProfile(); -} - bool LLPanelPlaces::onOverflowMenuItemEnable(const LLSD& param) { std::string value = param.asString(); @@ -1036,6 +1056,50 @@ void LLPanelPlaces::onBackButtonClicked() updateVerbs(); } +void LLPanelPlaces::onGearMenuClick() +{ + if (mActivePanel) + { + LLToggleableMenu* menu = mActivePanel->getSelectionMenu(); + mGearMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT); + } +} + +void LLPanelPlaces::onSortingMenuClick() +{ + if (mActivePanel) + { + LLToggleableMenu* menu = mActivePanel->getSortingMenu(); + mSortingMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT); + } +} + +void LLPanelPlaces::onAddMenuClick() +{ + if (mActivePanel) + { + LLToggleableMenu* menu = mActivePanel->getCreateMenu(); + mAddMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT); + } +} + +void LLPanelPlaces::onRemoveButtonClicked() +{ + if (mActivePanel) + { + mActivePanel->onRemoveSelected(); + } +} + +bool LLPanelPlaces::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) +{ + if (mActivePanel) + { + return mActivePanel->handleDragAndDropToTrash(drop, cargo_type, cargo_data, accept); + } + return false; +} + void LLPanelPlaces::togglePickPanel(BOOL visible) { if (mPickPanel) @@ -1052,8 +1116,9 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) if (!mPlaceProfile || !mLandmarkInfo) return; - mFilterEditor->setVisible(!visible); mTabContainer->setVisible(!visible); + mButtonsContainer->setVisible(visible); + mFilterContainer->setVisible(!visible); if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || @@ -1069,10 +1134,6 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) // to avoid text blinking. mResetInfoTimer.setTimerExpirySec(PLACE_INFO_UPDATE_INTERVAL); - LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mPlaceProfile->reshape(new_rect.getWidth(), new_rect.getHeight()); - mLandmarkInfo->setVisible(FALSE); } else if (mPlaceInfoType == AGENT_INFO_TYPE) @@ -1093,10 +1154,6 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) if (visible) { mLandmarkInfo->resetLocation(); - - LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mLandmarkInfo->reshape(new_rect.getWidth(), new_rect.getHeight()); } else { @@ -1111,6 +1168,10 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) { landmarks_panel->setItemSelected(mItem->getUUID(), TRUE); } + else + { + landmarks_panel->resetSelection(); + } } } } @@ -1181,8 +1242,6 @@ void LLPanelPlaces::createTabs() LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel(); if (landmarks_panel) { - landmarks_panel->setPanelPlacesButtons(this); - mTabContainer->addTabPanel( LLTabContainer::TabPanelParams(). panel(landmarks_panel). @@ -1193,8 +1252,6 @@ void LLPanelPlaces::createTabs() LLTeleportHistoryPanel* teleport_history_panel = new LLTeleportHistoryPanel(); if (teleport_history_panel) { - teleport_history_panel->setPanelPlacesButtons(this); - mTabContainer->addTabPanel( LLTabContainer::TabPanelParams(). panel(teleport_history_panel). @@ -1206,9 +1263,17 @@ void LLPanelPlaces::createTabs() mActivePanel = dynamic_cast(mTabContainer->getCurrentPanel()); - // Filter applied to show all items. - if (mActivePanel) - mActivePanel->onSearchEdit(mActivePanel->getFilterSubString()); + if (mActivePanel) + { + // Filter applied to show all items. + mActivePanel->onSearchEdit(mActivePanel->getFilterSubString()); + + // History panel does not support deletion nor creation + // Hide menus + bool supports_create = mActivePanel->getCreateMenu() != NULL; + childSetVisible("add_btn_panel", supports_create); + childSetVisible("trash_btn_panel", supports_create); + } mTabsCreated = true; } @@ -1274,15 +1339,12 @@ void LLPanelPlaces::updateVerbs() mSaveBtn->setVisible(isLandmarkEditModeOn); mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); - mPlaceInfoBtn->setVisible(!is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible); bool show_options_btn = is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn; mOverflowBtn->setVisible(show_options_btn); getChild("lp_options")->setVisible(show_options_btn); getChild("lp2")->setVisible(!show_options_btn); - mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); - if (is_place_info_visible) { mShowOnMapBtn->setEnabled(have_3d_pos); diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index c4281cfdf9..24b7605fd6 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -48,6 +48,7 @@ class LLRemoteParcelInfoObserver; class LLTabContainer; class LLToggleableMenu; class LLMenuButton; +class LLLayoutStack; typedef std::pair folder_pair_t; @@ -103,7 +104,12 @@ private: bool onOverflowMenuItemEnable(const LLSD& param); void onCreateLandmarkButtonClicked(const LLUUID& folder_id); void onBackButtonClicked(); - void onProfileButtonClicked(); + void onGearMenuClick(); + void onSortingMenuClick(); + void onAddMenuClick(); + void onRemoveButtonClicked(); + bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept); + void toggleMediaPanel(); void togglePickPanel(BOOL visible); @@ -118,6 +124,8 @@ private: LLFilterEditor* mFilterEditor; LLPanelPlacesTab* mActivePanel; LLTabContainer* mTabContainer; + LLPanel* mButtonsContainer; + LLLayoutStack* mFilterContainer; LLPanelPlaceProfile* mPlaceProfile; LLPanelLandmarkInfo* mLandmarkInfo; @@ -132,7 +140,12 @@ private: LLButton* mCancelBtn; LLButton* mCloseBtn; LLMenuButton* mOverflowBtn; - LLButton* mPlaceInfoBtn; + + // Top menu + LLMenuButton* mGearMenuButton; + LLMenuButton* mSortingMenuButton; + LLMenuButton* mAddMenuButton; + LLButton* mRemoveSelectedBtn; LLPlacesInventoryObserver* mInventoryObserver; LLPlacesParcelObserver* mParcelObserver; diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 9644b7518e..9601ac54a4 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -47,13 +47,6 @@ bool LLPanelPlacesTab::isTabVisible() return true; } -void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel) -{ - mTeleportBtn = panel->getChild("teleport_btn"); - mShowOnMapBtn = panel->getChild("map_btn"); - mShowProfile = panel->getChild("profile_btn"); -} - void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, U64 region_handle, const std::string& url, diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index 367ce46e2e..886f4ce9c0 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -30,6 +30,7 @@ #include "llpanel.h" class LLPanelPlaces; +class LLToggleableMenu; class LLPanelPlacesTab : public LLPanel { @@ -42,11 +43,21 @@ public: virtual void onShowOnMap() = 0; virtual void onShowProfile() = 0; virtual void onTeleport() = 0; + virtual void onRemoveSelected() = 0; virtual bool isSingleItemSelected() = 0; + // returns menu for current selection + virtual LLToggleableMenu* getSelectionMenu() = 0; + virtual LLToggleableMenu* getSortingMenu() = 0; + virtual LLToggleableMenu* getCreateMenu() = 0; + + /** + * Processes drag-n-drop of the Landmarks and folders into trash button. + */ + virtual bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) = 0; + bool isTabVisible(); // Check if parent TabContainer is visible. - void setPanelPlacesButtons(LLPanelPlaces* panel); void onRegionResponse(const LLVector3d& landmark_global_pos, U64 region_handle, const std::string& url, @@ -57,10 +68,6 @@ public: void setFilterSubString(const std::string& string) { sFilterSubString = string; } protected: - LLButton* mTeleportBtn; - LLButton* mShowOnMapBtn; - LLButton* mShowProfile; - // Search string for filtering landmarks and teleport history locations static std::string sFilterSubString; }; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index a920df6fd9..991766384a 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -62,7 +62,7 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; class LLTeleportHistoryFlatItem : public LLPanel { public: - LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, + LLTeleportHistoryFlatItem(S32 index, LLToggleableMenu *menu, const std::string ®ion_name, // Extended TP history // LLDate date, const std::string &hl); LLDate date, const LLVector3& local_pos, const std::string &hl); @@ -98,12 +98,13 @@ public: private: void onProfileBtnClick(); + void showMenu(S32 x, S32 y); LLButton* mProfileBtn; LLTextBox* mTitle; LLTextBox* mTimeTextBox; - LLTeleportHistoryPanel::ContextMenu *mContextMenu; + LLToggleableMenu *mMenu; S32 mIndex; std::string mRegionName; @@ -130,7 +131,7 @@ protected: public: LLTeleportHistoryFlatItem* getFlatItemForPersistentItem ( - LLTeleportHistoryPanel::ContextMenu *context_menu, + LLToggleableMenu *menu, const LLTeleportHistoryPersistentItem& persistent_item, const S32 cur_item_index, const std::string &hl); @@ -148,14 +149,14 @@ private: //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, +LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLToggleableMenu *menu, const std::string ®ion_name, // Extended TP history // LLDate date, const std::string &hl) LLDate date, const LLVector3& local_pos, const std::string &hl) // : LLPanel(), mIndex(index), - mContextMenu(context_menu), + mMenu(menu), mRegionName(region_name), mDate(date), // Extended TP history @@ -163,7 +164,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor // mHighlight(hl) { - buildFromFile( "panel_teleport_history_item.xml"); + buildFromFile("panel_teleport_history_item.xml"); } LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem() @@ -321,10 +322,9 @@ void LLTeleportHistoryFlatItem::onMouseLeave(S32 x, S32 y, MASK mask) // virtual BOOL LLTeleportHistoryFlatItem::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (mContextMenu) - mContextMenu->show(this, mIndex, x, y); - - return LLPanel::handleRightMouseDown(x, y, mask); + LLPanel::handleRightMouseDown(x, y, mask); + showMenu(x, y); + return TRUE; } void LLTeleportHistoryFlatItem::showPlaceInfoPanel(S32 index) @@ -344,13 +344,23 @@ void LLTeleportHistoryFlatItem::onProfileBtnClick() LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); } +void LLTeleportHistoryFlatItem::showMenu(S32 x, S32 y) +{ + mMenu->setButtonRect(this); + mMenu->buildDrawLabels(); + mMenu->arrangeAndClear(); + mMenu->updateParent(LLMenuGL::sMenuContainer); + + LLMenuGL::showPopup(this, mMenu, x, y); +} + //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// LLTeleportHistoryFlatItem* LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( - LLTeleportHistoryPanel::ContextMenu *context_menu, + LLToggleableMenu *menu, const LLTeleportHistoryPersistentItem& persistent_item, const S32 cur_item_index, const std::string &hl) @@ -388,7 +398,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( if ( !item ) { item = new LLTeleportHistoryFlatItem(cur_item_index, - context_menu, + menu, persistent_item.mTitle, persistent_item.mDate, // Extended TP history @@ -435,78 +445,6 @@ void LLTeleportHistoryFlatItemStorage::purge() //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -LLTeleportHistoryPanel::ContextMenu::ContextMenu() : - mMenu(NULL), mIndex(0) -{ -} - -void LLTeleportHistoryPanel::ContextMenu::show(LLView* spawning_view, S32 index, S32 x, S32 y) -{ - if (mMenu) - { - //preventing parent (menu holder) from deleting already "dead" context menus on exit - LLView* parent = mMenu->getParent(); - if (parent) - { - parent->removeChild(mMenu); - } - delete mMenu; - } - - mIndex = index; - mMenu = createMenu(); - - mMenu->show(x, y); - LLMenuGL::showPopup(spawning_view, mMenu, x, y); -} - -LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() -{ - // set up the callbacks for all of the avatar menu items - // (N.B. callbacks don't take const refs as mID is local scope) - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - - registrar.add("TeleportHistory.Action", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onUserAction, this, _2)); - - // create the context menu from the XUI - llassert(LLMenuGL::sMenuContainer != NULL); - return LLUICtrlFactory::getInstance()->createFromFile( - "menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); -} - -void LLTeleportHistoryPanel::ContextMenu::onUserAction(const LLSD& userdata) -{ - std::string command_name = userdata.asString(); - if ("teleport" == command_name) - { - confirmTeleport(mIndex); - } - else if ("view" == command_name) - { - LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); - } - else if ("show_on_map" == command_name) - { - LLTeleportHistoryStorage::getInstance()->showItemOnMap(mIndex); - } - else if ("copy_slurl" == command_name) - { - LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; - LLLandmarkActions::getSLURLfromPosGlobal(globalPos, - boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); - } -} - -//static -void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl) -{ - LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size()); - - LLSD args; - args["SLURL"] = slurl; - - LLNotificationsUtil::add("CopySLURL", args); -} // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLPanelInjector t_teleport_history("panel_teleport_history"); @@ -519,9 +457,10 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel() mHistoryAccordion(NULL), mAccordionTabMenu(NULL), mLastSelectedFlatlList(NULL), - // Separate search filter for standalone TP history - //mLastSelectedItemIndex(-1) mLastSelectedItemIndex(-1), + mGearItemMenu(NULL), + mSortingMenu(NULL), + // Separate search filter for standalone TP history mIsStandAlone(false) // { @@ -535,12 +474,19 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel() LLTeleportHistoryPanel::~LLTeleportHistoryPanel() { LLTeleportHistoryFlatItemStorage::instance().purge(); - if (mGearMenuHandle.get()) mGearMenuHandle.get()->die(); mTeleportHistoryChangedConnection.disconnect(); } BOOL LLTeleportHistoryPanel::postBuild() { + mCommitCallbackRegistrar.add("TeleportHistory.GearMenu.Action", boost::bind(&LLTeleportHistoryPanel::onGearMenuAction, this, _2)); + mEnableCallbackRegistrar.add("TeleportHistory.GearMenu.Enable", boost::bind(&LLTeleportHistoryPanel::isActionEnabled, this, _2)); + + // init menus before list, since menus are passed to list + mGearItemMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_item.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mGearItemMenu->setAlwaysShowMenu(TRUE); // all items can be disabled if nothing is selected, show anyway + mSortingMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mTeleportHistory = LLTeleportHistoryStorage::getInstance(); if (mTeleportHistory) { @@ -592,24 +538,6 @@ BOOL LLTeleportHistoryPanel::postBuild() } } - getChild("bottom_panel")->childSetAction("gear_btn",boost::bind(&LLTeleportHistoryPanel::onGearButtonClicked, this)); - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - - registrar.add("TeleportHistory.ExpandAllFolders", boost::bind(&LLTeleportHistoryPanel::onExpandAllFolders, this)); - registrar.add("TeleportHistory.CollapseAllFolders", boost::bind(&LLTeleportHistoryPanel::onCollapseAllFolders, this)); - registrar.add("TeleportHistory.ClearTeleportHistory", boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistory, this)); - mEnableCallbackRegistrar.add("TeleportHistory.GearMenu.Enable", boost::bind(&LLTeleportHistoryPanel::isActionEnabled, this, _2)); -// mMenuGearButton = getChild("gear_btn"); - -// LLToggleableMenu* gear_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());; - LLMenuGL* gear_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - if(gear_menu) - { - mGearMenuHandle = gear_menu->getHandle(); -// mMenuGearButton->setMenu(gear_menu); - } - return TRUE; } @@ -725,17 +653,26 @@ void LLTeleportHistoryPanel::updateVerbs() if (!mLastSelectedFlatlList) { - mTeleportBtn->setEnabled(false); - mShowProfile->setEnabled(false); - mShowOnMapBtn->setEnabled(false); return; } +} - LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); +// virtual +LLToggleableMenu* LLTeleportHistoryPanel::getSelectionMenu() +{ + return mGearItemMenu; +} - mTeleportBtn->setEnabled(NULL != itemp); - mShowProfile->setEnabled(NULL != itemp); - mShowOnMapBtn->setEnabled(NULL != itemp); +// virtual +LLToggleableMenu* LLTeleportHistoryPanel::getSortingMenu() +{ + return mSortingMenu; +} + +// virtual +LLToggleableMenu* LLTeleportHistoryPanel::getCreateMenu() +{ + return NULL; } void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, LLDate& tab_date) @@ -922,7 +859,7 @@ void LLTeleportHistoryPanel::refresh() { LLTeleportHistoryFlatItem* item = LLTeleportHistoryFlatItemStorage::instance() - .getFlatItemForPersistentItem(&mContextMenu, + .getFlatItemForPersistentItem(mGearItemMenu, items[mCurrentItem], mCurrentItem, filter_string); @@ -1001,7 +938,7 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index) const LLTeleportHistoryStorage::slurl_list_t& history_items = mTeleportHistory->getItems(); LLTeleportHistoryFlatItem* item = LLTeleportHistoryFlatItemStorage::instance() - .getFlatItemForPersistentItem(&mContextMenu, + .getFlatItemForPersistentItem(mGearItemMenu, history_items[history_items.size() - 1], // Most recent item, it was added instead of removed history_items.size(), // index will be decremented inside loop below // Separate search filter for standalone TP history @@ -1177,33 +1114,6 @@ void LLTeleportHistoryPanel::onAccordionTabClose(LLAccordionCtrlTab *tab) mHistoryAccordion->arrange(); } -void LLTeleportHistoryPanel::onExpandAllFolders() -{ - S32 tabs_cnt = mItemContainers.size(); - - for (S32 n = 0; n < tabs_cnt; n++) - { - mItemContainers.at(n)->setDisplayChildren(true); - } - mHistoryAccordion->arrange(); -} - -void LLTeleportHistoryPanel::onCollapseAllFolders() -{ - S32 tabs_cnt = mItemContainers.size(); - - for (S32 n = 0; n < tabs_cnt; n++) - { - mItemContainers.at(n)->setDisplayChildren(false); - } - mHistoryAccordion->arrange(); - - if (mLastSelectedFlatlList) - { - mLastSelectedFlatlList->resetSelection(); - } -} - // [timezone support for teleport history] void LLTeleportHistoryPanel::onTimeZoneChecked(const LLSD& userdata) { @@ -1220,11 +1130,6 @@ bool LLTeleportHistoryPanel::isTimeZoneChecked(const LLSD& userdata) } // -void LLTeleportHistoryPanel::onClearTeleportHistory() -{ - LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); -} - bool LLTeleportHistoryPanel::onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response) { @@ -1256,66 +1161,141 @@ LLFlatListView* LLTeleportHistoryPanel::getFlatListViewFromTab(LLAccordionCtrlTa return NULL; } -void LLTeleportHistoryPanel::onGearButtonClicked() +void LLTeleportHistoryPanel::gotSLURLCallback(const std::string& slurl) { - LLMenuGL* menu = (LLMenuGL*)mGearMenuHandle.get(); - if (!menu) - return; + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl), 0, slurl.size()); - // Shows the menu at the top of the button bar. + LLSD args; + args["SLURL"] = slurl; - // Calculate its coordinates. - LLPanel* bottom_panel = getChild("bottom_panel"); - menu->arrangeAndClear(); - S32 menu_height = menu->getRect().getHeight(); - S32 menu_x = -2; // *HACK: compensates HPAD in showPopup() - S32 menu_y = bottom_panel->getRect().mTop + menu_height; + LLNotificationsUtil::add("CopySLURL", args); +} - // Actually show the menu. - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, menu, menu_x, menu_y); +void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata) +{ + std::string command_name = userdata.asString(); + + if ("expand_all" == command_name) + { + S32 tabs_cnt = mItemContainers.size(); + + for (S32 n = 0; n < tabs_cnt; n++) + { + mItemContainers.at(n)->setDisplayChildren(true); + } + mHistoryAccordion->arrange(); + } + else if ("collapse_all" == command_name) + { + S32 tabs_cnt = mItemContainers.size(); + + for (S32 n = 0; n < tabs_cnt; n++) + { + mItemContainers.at(n)->setDisplayChildren(false); + } + mHistoryAccordion->arrange(); + + if (mLastSelectedFlatlList) + { + mLastSelectedFlatlList->resetSelection(); + } + } + else if ("clear_history" == command_name) + { + LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); + } + + S32 index = -1; + if (mLastSelectedFlatlList) + { + LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); + if (itemp) + { + index = itemp->getIndex(); + } + } + + if ("teleport" == command_name) + { + confirmTeleport(index); + } + else if ("view" == command_name) + { + LLTeleportHistoryFlatItem::showPlaceInfoPanel(index); + } + else if ("show_on_map" == command_name) + { + LLTeleportHistoryStorage::getInstance()->showItemOnMap(index); + } + else if ("copy_slurl" == command_name) + { + LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[index].mGlobalPos; + LLLandmarkActions::getSLURLfromPosGlobal(globalPos, + boost::bind(&LLTeleportHistoryPanel::gotSLURLCallback, _1)); + } } bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const { - S32 tabs_cnt = mItemContainers.size(); + std::string command_name = userdata.asString(); - bool has_expanded_tabs = false; - bool has_collapsed_tabs = false; + if (command_name == "collapse_all" + || command_name == "expand_all") + { + S32 tabs_cnt = mItemContainers.size(); - for (S32 n = 0; n < tabs_cnt; n++) - { - LLAccordionCtrlTab* tab = mItemContainers.at(n); - if (!tab->getVisible()) - continue; + bool has_expanded_tabs = false; + bool has_collapsed_tabs = false; - if (tab->getDisplayChildren()) - { - has_expanded_tabs = true; - } - else - { - has_collapsed_tabs = true; - } + for (S32 n = 0; n < tabs_cnt; n++) + { + LLAccordionCtrlTab* tab = mItemContainers.at(n); + if (!tab->getVisible()) + continue; - if (has_expanded_tabs && has_collapsed_tabs) - { - break; - } - } + if (tab->getDisplayChildren()) + { + has_expanded_tabs = true; + } + else + { + has_collapsed_tabs = true; + } - std::string command_name = userdata.asString(); + if (has_expanded_tabs && has_collapsed_tabs) + { + break; + } + } - if (has_expanded_tabs && command_name == "collapse_all") - { - return true; - } + if (command_name == "collapse_all") + { + return has_expanded_tabs; + } - if (has_collapsed_tabs && command_name == "expand_all") - { - return true; - } + if (command_name == "expand_all") + { + return has_collapsed_tabs; + } + } + + if (command_name == "clear_history") + { + return mTeleportHistory->getItems().size() > 0; + } + + if ("teleport" == command_name + || "view" == command_name + || "show_on_map" == command_name + || "copy_slurl" == command_name) + { + if (!mLastSelectedFlatlList) + { + return false; + } + LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); + return itemp != NULL; + } return false; } diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index 2cafe6e799..c0886e0296 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -45,36 +45,26 @@ class LLTeleportHistoryPanel : public LLPanelPlacesTab friend class FSFloaterTeleportHistory; public: - // *TODO: derive from LLListContextMenu? - class ContextMenu - { - public: - ContextMenu(); - void show(LLView* spawning_view, S32 index, S32 x, S32 y); - - private: - LLContextMenu* createMenu(); - void onUserAction(const LLSD& userdata); - - static void gotSLURLCallback(const std::string& slurl); - - LLContextMenu* mMenu; - S32 mIndex; - }; - LLTeleportHistoryPanel(); virtual ~LLTeleportHistoryPanel(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + BOOL postBuild() override; + void draw() override; - /*virtual*/ void onSearchEdit(const std::string& string); - /*virtual*/ void onShowOnMap(); - /*virtual*/ void onShowProfile(); - /*virtual*/ void onTeleport(); - ///*virtual*/ void onCopySLURL(); - /*virtual*/ void updateVerbs(); - /*virtual*/ bool isSingleItemSelected(); + void onSearchEdit(const std::string& string) override; + void onShowOnMap() override; + void onShowProfile() override; + void onTeleport() override; + ///*virtual*/ void onCopySLURL(); + void onRemoveSelected() override {}; + void updateVerbs() override; + bool isSingleItemSelected() override; + + LLToggleableMenu* getSelectionMenu() override; + LLToggleableMenu* getSortingMenu() override; + LLToggleableMenu* getCreateMenu() override; + + bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override { return false; } // Separate search filter for standalone TP history void setIsStandAlone(bool standalone) { mIsStandAlone = standalone; } @@ -97,14 +87,15 @@ private: void onClearTeleportHistory(); bool onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response); - void refresh(); + void refresh() override; void getNextTab(const LLDate& item_date, S32& curr_tab, LLDate& tab_date); void onTeleportHistoryChange(S32 removed_index); void replaceItem(S32 removed_index); void showTeleportHistory(); void handleItemSelect(LLFlatListView* ); LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *); - void onGearButtonClicked(); + static void gotSLURLCallback(const std::string& slurl); + void onGearMenuAction(const LLSD& userdata); bool isActionEnabled(const LLSD& userdata) const; void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); @@ -125,9 +116,10 @@ private: typedef std::vector item_containers_t; item_containers_t mItemContainers; - ContextMenu mContextMenu; LLContextMenu* mAccordionTabMenu; - LLHandle mGearMenuHandle; + + LLToggleableMenu* mGearItemMenu; + LLToggleableMenu* mSortingMenu; boost::signals2::connection mTeleportHistoryChangedConnection; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 07c02679b5..e74fade1dd 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -10968,8 +10968,8 @@ class LLWorldEnvSettings : public view_listener_t if (event_name == "sunrise") { // FIRE-29926 - allow manually selected environments to have a user defined transition time. - //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_FAST); - //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_INSTANT); + //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); // @@ -10978,8 +10978,8 @@ class LLWorldEnvSettings : public view_listener_t else if (event_name == "noon") { // FIRE-29926 - allow manually selected environments to have a user defined transition time. - //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_FAST); - //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_INSTANT); + //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); // @@ -10988,8 +10988,8 @@ class LLWorldEnvSettings : public view_listener_t else if (event_name == "sunset") { // FIRE-29926 - allow manually selected environments to have a user defined transition time. - //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_FAST); - //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT); + //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); // defocusEnvFloaters(); @@ -10997,8 +10997,8 @@ class LLWorldEnvSettings : public view_listener_t else if (event_name == "midnight") { // FIRE-29926 - allow manually selected environments to have a user defined transition time. - //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_FAST); - //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + //LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_INSTANT); + //LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); // defocusEnvFloaters(); @@ -11006,7 +11006,7 @@ class LLWorldEnvSettings : public view_listener_t else if (event_name == "region") { LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "pause_clouds") diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 9a5d453262..8346268fa4 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -90,7 +90,7 @@ follows="left|top|right|bottom" auto_resize="false" user_resize="false" - height="35" + height="29" visible="true"> + width="240"/> + + + - - - - - - - - -