diff options
Diffstat (limited to 'indra/newview')
30 files changed, 291 insertions, 665 deletions
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 881bc22144..296d992b34 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -187,10 +187,8 @@ icon="Command_Profile_Icon" label_ref="Command_Profile_Label" tooltip_ref="Command_Profile_Tooltip" - execute_function="Floater.ToolbarToggle" - execute_parameters="my_profile" - is_running_function="Floater.IsOpen" - is_running_parameters="my_profile" + execute_function="Avatar.ToggleMyProfile" + is_running_function="Avatar.IsMyProfileOpen" /> <command name="search" available_in_toybox="true" @@ -219,6 +217,8 @@ tooltip_ref="Command_Speak_Tooltip" execute_function="Agent.ToggleMicrophone" execute_parameters="speak" + execute_stop_function="" + execute_stop_parameters="speak" is_enabled_function="Agent.IsActionAllowed" is_enabled_parameters="speak" is_running_function="Agent.IsMicrophoneOn" diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b14c02a5d6..b54f622986 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -316,12 +316,13 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa // PROFILES: open in webkit window const bool show_chrome = false; static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); - LLFloaterWebContent::create(LLFloaterWebContent::Params(). - url(url). - id(agent_id.asString()). - show_chrome(show_chrome). - window_class("profile"). - preferred_media_size(profile_rect)); + LLFloaterWebContent::Params p; + p.url(url). + id(agent_id.asString()). + show_chrome(show_chrome). + window_class("profile"). + preferred_media_size(profile_rect); + LLFloaterReg::showInstance("profile", p); } // static @@ -342,6 +343,12 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) return browser && browser->isShown(); } +//static +LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) +{ + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", LLSD().with("id", id))); + return browser; +} //static void LLAvatarActions::hideProfile(const LLUUID& id) diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index fbfd815f41..748b7cb3d1 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -35,7 +35,7 @@ #include <vector> class LLInventoryPanel; - +class LLFloater; /** * Friend-related actions (add, remove, offer teleport, etc) @@ -96,6 +96,7 @@ public: static void showProfile(const LLUUID& id); static void hideProfile(const LLUUID& id); static bool profileVisible(const LLUUID& id); + static LLFloater* getProfileFloater(const LLUUID& id); /** * Show avatar on world map. diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 4c6ddc8be7..cc2a189b76 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -37,9 +37,9 @@ #include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "llavatarlist.h" -#include "llbottomtray.h" #include "lldraghandle.h" #include "llimfloater.h" +#include "llimview.h" #include "llfloaterreg.h" #include "llparticipantlist.h" #include "llspeakers.h" diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index ea78cd53b7..7282f7a8be 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -28,7 +28,7 @@ #ifndef LL_LLCALLFLOATER_H #define LL_LLCALLFLOATER_H -#include "lltransientdockablefloater.h" +#include "llfloater.h" #include "llvoicechannel.h" #include "llvoiceclient.h" @@ -262,9 +262,6 @@ private: */ static LLVoiceChannel* sCurrentVoiceChannel; - /* virtual */ - LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } - boost::signals2::connection mVoiceChannelStateChangeConnection; }; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6dcfa95a0e..98de418878 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -31,6 +31,7 @@ #include "llfocusmgr.h" #include "llinventory.h" #include "lllandmarkactions.h" +#include "lltoolbarview.h" #include "lltrans.h" #include "lluictrlfactory.h" #include "llmenugl.h" @@ -54,6 +55,7 @@ static LLDefaultChildRegistry::Register<LLFavoritesBarCtrl> r("favorites_bar"); const S32 DROP_DOWN_MENU_WIDTH = 250; +const S32 DROP_DOWN_MENU_TOP_PAD = 13; /** * Helper for LLFavoriteLandmarkButton and LLFavoriteLandmarkMenuItem. @@ -893,84 +895,155 @@ void LLFavoritesBarCtrl::showDropDownMenu() { if (mOverflowMenuHandle.isDead()) { - LLToggleableMenu::Params menu_p; - menu_p.name("favorites menu"); - menu_p.can_tear_off(false); - menu_p.visible(false); - menu_p.scrollable(true); - menu_p.max_scrollable_items = 10; - menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; - - LLToggleableMenu* menu = LLUICtrlFactory::create<LLFavoriteLandmarkToggleableMenu>(menu_p); - mOverflowMenuHandle = menu->getHandle(); + createOverflowMenu(); } LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); + if (menu && menu->toggleVisibility()) + { + if (mUpdateDropDownItems) + { + updateMenuItems(menu); + } + + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + menu->setButtonRect(mMoreTextBox->getRect(), this); + positionAndShowMenu(menu); + } +} + +void LLFavoritesBarCtrl::createOverflowMenu() +{ + LLToggleableMenu::Params menu_p; + menu_p.name("favorites menu"); + menu_p.can_tear_off(false); + menu_p.visible(false); + menu_p.scrollable(true); + menu_p.max_scrollable_items = 10; + menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; + + LLToggleableMenu* menu = LLUICtrlFactory::create<LLFavoriteLandmarkToggleableMenu>(menu_p); + mOverflowMenuHandle = menu->getHandle(); +} - if (menu) +void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) +{ + menu->empty(); + + U32 widest_item = 0; + + for (S32 i = mFirstDropDownItem; i < mItems.count(); i++) { - if (!menu->toggleVisibility()) - return; + LLViewerInventoryItem* item = mItems.get(i); + const std::string& item_name = item->getName(); - U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); - if (mUpdateDropDownItems) + LLFavoriteLandmarkMenuItem::Params item_params; + item_params.name(item_name); + item_params.label(item_name); + item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + + LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create<LLFavoriteLandmarkMenuItem>(item_params); + menu_item->initFavoritesBarPointer(this); + menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->setLandmarkID(item->getUUID()); + + fitLabelWidth(menu_item); + + widest_item = llmax(widest_item, menu_item->getNominalWidth()); + + menu->addChild(menu_item); + } + + addOpenLandmarksMenuItem(menu); + mUpdateDropDownItems = false; +} + +void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item) +{ + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); + std::string item_name = menu_item->getName(); + + // Check whether item name wider than menu + if (menu_item->getNominalWidth() > max_width) + { + S32 chars_total = item_name.length(); + S32 chars_fitted = 1; + menu_item->setLabel(LLStringExplicit("")); + S32 label_space = max_width - menu_item->getFont()->getWidth("...") - + menu_item->getNominalWidth();// This returns width of menu item with empty label (pad pixels) + + while (chars_fitted < chars_total + && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) { - menu->empty(); + chars_fitted++; + } + chars_fitted--; // Rolling back one char, that doesn't fit - U32 widest_item = 0; + menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); + } +} - for (S32 i = mFirstDropDownItem; i < mItems.count(); i++) - { - LLViewerInventoryItem* item = mItems.get(i); - const std::string& item_name = item->getName(); - - LLFavoriteLandmarkMenuItem::Params item_params; - item_params.name(item_name); - item_params.label(item_name); - - item_params.on_click.function(boost::bind( - &LLFavoritesBarCtrl::onButtonClick, this, - item->getUUID())); - LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create<LLFavoriteLandmarkMenuItem>(item_params); - menu_item->initFavoritesBarPointer(this); - menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4)); - menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); - menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); - menu_item->setLandmarkID(item->getUUID()); - - // Check whether item name wider than menu - if (menu_item->getNominalWidth() > max_width) - { - S32 chars_total = item_name.length(); - S32 chars_fitted = 1; - menu_item->setLabel(LLStringExplicit("")); - S32 label_space = max_width - menu_item->getFont()->getWidth("...") - - menu_item->getNominalWidth();// This returns width of menu item with empty label (pad pixels) - - while (chars_fitted < chars_total - && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) - { - chars_fitted++; - } - chars_fitted--; // Rolling back one char, that doesn't fit +void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu) +{ + std::string label_untrans = "Open landmarks"; + std::string label_transl; + bool translated = LLTrans::findString(label_transl, label_untrans); + + LLMenuItemCallGL::Params item_params; + item_params.name("open_my_landmarks"); + item_params.label(translated ? label_transl: label_untrans); + item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", LLSD())); + LLMenuItemCallGL* menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + + fitLabelWidth(menu_item); + + LLMenuItemSeparatorGL::Params sep_params; + sep_params.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor"); + sep_params.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor"); + sep_params.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor"); + sep_params.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor"); + LLMenuItemSeparatorGL* separator = LLUICtrlFactory::create<LLMenuItemSeparatorGL>(sep_params); + + menu->addChild(separator); + menu->addChild(menu_item); +} - menu_item->setLabel(item_name.substr(0, chars_fitted) - + "..."); - } - widest_item = llmax(widest_item, menu_item->getNominalWidth()); +void LLFavoritesBarCtrl::positionAndShowMenu(LLToggleableMenu* menu) +{ + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); - menu->addChild(menu_item); - } - mUpdateDropDownItems = false; + S32 menu_x = getRect().getWidth() - max_width; + S32 menu_y = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD; + + // the menu should be offset of the right edge of the window + // so it's no covered by buttons in the right-side toolbar. + LLToolBar* right_toolbar = gToolBarView->getChild<LLToolBar>("toolbar_right"); + if (right_toolbar && right_toolbar->hasButtons()) + { + S32 toolbar_top = 0; + + if (LLView* top_border_panel = right_toolbar->getChild<LLView>("button_panel")) + { + toolbar_top = top_border_panel->calcScreenRect().mTop; } - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); + // Calculating the bottom (in screen coord) of the drop down menu + S32 menu_top = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD; + S32 menu_bottom = menu_top - menu->getRect().getHeight(); + S32 menu_bottom_screen = 0; - menu->setButtonRect(mMoreTextBox->getRect(), this); + localPointToScreen(0, menu_bottom, &menu_top, &menu_bottom_screen); - LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0); + if (menu_bottom_screen < toolbar_top) + { + menu_x -= right_toolbar->getRect().getWidth(); + } } + + LLMenuGL::showPopup(this, menu, menu_x, menu_y); } void LLFavoritesBarCtrl::onButtonClick(LLUUID item_id) diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index a41795a080..1b11d6196e 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -34,6 +34,9 @@ #include "llinventoryobserver.h" #include "llinventorymodel.h" +class LLMenuItemCallGL; +class LLToggleableMenu; + class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver { public: @@ -132,6 +135,17 @@ private: // finds an item by it's UUID in the items array LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); + void createOverflowMenu(); + + void updateMenuItems(LLToggleableMenu* menu); + + // Fits menu item label width with favorites menu width + void fitLabelWidth(LLMenuItemCallGL* menu_item); + + void addOpenLandmarksMenuItem(LLToggleableMenu* menu); + + void positionAndShowMenu(LLToggleableMenu* menu); + BOOL mShowDragMarker; LLUICtrl* mLandingTab; LLUICtrl* mLastTab; diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 1dfa904a19..b4658b1edb 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -36,7 +36,6 @@ #include "lljoystickbutton.h" #include "llviewercontrol.h" #include "llviewercamera.h" -#include "llbottomtray.h" #include "lltoolmgr.h" #include "lltoolfocus.h" #include "llslider.h" @@ -314,12 +313,6 @@ void LLFloaterCamera::onOpen(const LLSD& key) { LLFirstUse::viewPopup(); - LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("camera_btn"); - - setDockControl(new LLDockControl( - anchor_panel, this, - getDockTongue(), LLDockControl::TOP)); - mZoom->onOpen(key); // Returns to previous mode, see EXT-2727(View tool should remember state). @@ -343,15 +336,12 @@ void LLFloaterCamera::onClose(bool app_quitting) if (mCurrMode == CAMERA_CTRL_MODE_PAN) mPrevMode = CAMERA_CTRL_MODE_PAN; - // HACK: Should always close as docked to prevent toggleInstance without calling onOpen. - if ( !isDocked() ) - setDocked(true); switchMode(CAMERA_CTRL_MODE_PAN); mClosed = TRUE; } LLFloaterCamera::LLFloaterCamera(const LLSD& val) -: LLTransientDockableFloater(NULL, true, val), +: LLFloater(val), mClosed(FALSE), mCurrMode(CAMERA_CTRL_MODE_PAN), mPrevMode(CAMERA_CTRL_MODE_PAN) @@ -379,7 +369,7 @@ BOOL LLFloaterCamera::postBuild() // ensure that appearance mode is handled while building. See EXT-7796. handleAvatarEditingAppearance(sAppearanceEditing); - return LLDockableFloater::postBuild(); + return TRUE; } void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel) diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 424191ef26..4572932853 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -27,7 +27,7 @@ #ifndef LLFLOATERCAMERA_H #define LLFLOATERCAMERA_H -#include "lltransientdockablefloater.h" +#include "llfloater.h" #include "lliconctrl.h" #include "lltextbox.h" #include "llflatlistview.h" @@ -45,8 +45,7 @@ enum ECameraControlMode CAMERA_CTRL_MODE_PRESETS }; -class LLFloaterCamera - : public LLTransientDockableFloater +class LLFloaterCamera : public LLFloater { friend class LLFloaterReg; diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index 3012638d44..fd9c37ae73 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -39,6 +39,7 @@ #include "llurlhistory.h" #include "llmediactrl.h" #include "llviewermedia.h" +#include "llviewerhelp.h" LLFloaterHelpBrowser::LLFloaterHelpBrowser(const LLSD& key) @@ -74,6 +75,17 @@ void LLFloaterHelpBrowser::buildURLHistory() void LLFloaterHelpBrowser::onOpen(const LLSD& key) { gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); + + std::string topic = key.asString(); + + if (topic == "__local") + { + mBrowser->navigateToLocalPage( "help-offline" , "index.html" ); + } + else + { + mBrowser->navigateTo(LLViewerHelp::instance().getURL(topic)); + } } //virtual @@ -148,8 +160,3 @@ void LLFloaterHelpBrowser::openMedia(const std::string& media_url) mBrowser->navigateTo(media_url, "text/html"); setCurrentURL(media_url); } - -void LLFloaterHelpBrowser::navigateToLocalPage( const std::string& subdir, const std::string& filename_in ) -{ - mBrowser->navigateToLocalPage(subdir, filename_in); -} diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index afe0f4df69..80b0ecc06b 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -48,8 +48,6 @@ class LLFloaterHelpBrowser : /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); void openMedia(const std::string& media_url); - - void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); private: void buildURLHistory(); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 2c9a736aff..c76aeb0498 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -88,20 +88,6 @@ BOOL LLFloaterWebContent::postBuild() return TRUE; } -bool LLFloaterWebContent::matchesKey(const LLSD& key) -{ - LLUUID id = key["id"]; - if (id.notNull()) - { - return id == mKey["id"].asUUID(); - } - else - { - return key["target"].asString() == mKey["target"].asString(); - } -} - - void LLFloaterWebContent::initializeURLHistory() { // start with an empty list @@ -123,6 +109,20 @@ void LLFloaterWebContent::initializeURLHistory() } } +bool LLFloaterWebContent::matchesKey(const LLSD& key) +{ + Params p(mKey); + Params other_p(key); + if (!other_p.target().empty() && other_p.target() != "_blank") + { + return other_p.target() == p.target(); + } + else + { + return other_p.id() == p.id(); + } +} + //static LLFloater* LLFloaterWebContent::create( Params p) { @@ -139,14 +139,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - - LLSD sd; - sd["target"] = p.target; - if(LLFloaterReg::findInstance(p.window_class, sd) != NULL) - { - // There's already a web browser for this tag, so we won't be opening a new window. - } - else if(browser_window_limit != 0) + if(browser_window_limit != 0) { // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. @@ -166,7 +159,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } } - return LLFloaterReg::showInstance(p.window_class, p); + return new LLFloaterWebContent(p); } //static diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0bdeb114f5..1f1e49726d 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1122,16 +1122,7 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) lldebugs << "No gFloaterView for onPopuup()" << llendl; }; - // (for now) open web content floater if that's our parent, otherwise, open the current media floater - // (this will change soon) - if ( floater_name == "web_content" ) - { - LLWeb::loadWebURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); - } - else - { - LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); - } + LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); } else { diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index a29526777a..2af01d06c1 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -37,7 +37,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "llvoavatarself.h" // to check gAgentAvatarp->isSitting() -#include "llbottomtray.h" #include "llbutton.h" #include "llfirstuse.h" #include "llfloaterreg.h" @@ -46,7 +45,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llviewercontrol.h" -#include "llselectmgr.h" +#include "llselectmgr.h" +#include "lltoolbarview.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "lltooltip.h" @@ -59,15 +59,13 @@ const F32 MOVE_BUTTON_DELAY = 0.0f; const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed const F32 NUDGE_TIME = 0.25f; // in seconds -const std::string BOTTOM_TRAY_BUTTON_NAME = "movement_btn"; - // // Member functions // // protected LLFloaterMove::LLFloaterMove(const LLSD& key) -: LLTransientDockableFloater(NULL, true, key), +: LLFloater(key), mForwardButton(NULL), mBackwardButton(NULL), mTurnLeftButton(NULL), @@ -94,8 +92,6 @@ BOOL LLFloaterMove::postBuild() { updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) - LLDockableFloater::postBuild(); - // Code that implements floater buttons toggling when user moves via keyboard is located in LLAgent::propagate() mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); @@ -153,10 +149,10 @@ BOOL LLFloaterMove::postBuild() // virtual void LLFloaterMove::setVisible(BOOL visible) { - // Do nothing with Stand/Stop Flying panel in excessive calls of this method (from LLTransientFloaterMgr?). + // Do nothing with Stand/Stop Flying panel in excessive calls of this method. if (getVisible() == visible) { - LLTransientDockableFloater::setVisible(visible); + LLFloater::setVisible(visible); return; } @@ -175,7 +171,7 @@ void LLFloaterMove::setVisible(BOOL visible) LLPanelStandStopFlying::getInstance()->reparent(NULL); } - LLTransientDockableFloater::setVisible(visible); + LLFloater::setVisible(visible); } // static @@ -439,30 +435,6 @@ void LLFloaterMove::setModeTitle(const EMovementMode mode) setTitle(title); } -/** - * Updates position of the floater to be center aligned with Move button. - */ -void LLFloaterMove::updatePosition() -{ - LLBottomTray* tray = LLBottomTray::getInstance(); - if (!tray) return; - - LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME); - - if (movement_btn) - { - //align centers of a button and a floater - S32 x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2; - - S32 y = 0; - if (!mModeActionsPanel->getVisible()) - { - y = mModeActionsPanel->getRect().getHeight(); - } - setOrigin(x, y); - } -} - //static void LLFloaterMove::sUpdateFlyingStatus() { @@ -497,8 +469,6 @@ void LLFloaterMove::enableInstance(BOOL bEnable) void LLFloaterMove::onOpen(const LLSD& key) { - LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("movement_btn"); - if (gAgent.getFlying()) { setFlyingMode(TRUE); @@ -511,19 +481,9 @@ void LLFloaterMove::onOpen(const LLSD& key) showModeButtons(FALSE); } - setDockControl(new LLDockControl( - anchor_panel, this, - getDockTongue(), LLDockControl::TOP)); - sUpdateFlyingStatus(); } -//virtual -void LLFloaterMove::setDocked(bool docked, bool pop_on_undock/* = true*/) -{ - LLTransientDockableFloater::setDocked(docked, pop_on_undock); -} - void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) { llassert_always(mModeControlButtonMap.end() != mModeControlButtonMap.find(mode)); @@ -734,23 +694,27 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick() */ void LLPanelStandStopFlying::updatePosition() { - LLBottomTray* tray = LLBottomTray::getInstance(); - if (!tray || mAttached) return; - - LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME); + if (mAttached) return; S32 x = 0; - if (movement_btn) + S32 y = 0; + + if(LLView* root = getRootView()) { - // Align centers of the button and the panel. - x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2; + x = root->calcScreenRect().getCenterX() - getRect().getWidth()/2; } - else + + if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom")) { - x = tray->calcScreenRect().getCenterX() - getRect().getWidth()/2; + y = toolbar_bottom->getRect().getHeight(); } + + if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container")) + { + panel_ssf_container->setOrigin(0, y); + } + setOrigin(x, 0); } - // EOF diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index 1b87864651..744dd866d4 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -28,7 +28,7 @@ #define LL_LLMOVEVIEW_H // Library includes -#include "lltransientdockablefloater.h" +#include "llfloater.h" class LLButton; class LLJoystickAgentTurn; @@ -38,7 +38,7 @@ class LLJoystickAgentSlide; // Classes // class LLFloaterMove -: public LLTransientDockableFloater +: public LLFloater { LOG_CLASS(LLFloaterMove); friend class LLFloaterReg; @@ -58,7 +58,6 @@ public: static void setSittingMode(BOOL bSitting); static void enableInstance(BOOL bEnable); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); static void sUpdateFlyingStatus(); @@ -87,7 +86,6 @@ private: void initModeButtonMap(); void setModeButtonToggleState(const EMovementMode mode); void updateButtonsWithMovementMode(const EMovementMode newMode); - void updatePosition(); void showModeButtons(BOOL bShow); public: diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 9eaa64a124..67d745248f 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -34,6 +34,7 @@ #include "lliconctrl.h" #include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" +#include "lllogchat.h" #include "llresizebar.h" #include "llresizehandle.h" #include "llmenugl.h" @@ -50,7 +51,6 @@ #include "lldraghandle.h" -#include "llbottomtray.h" #include "llnearbychatbar.h" #include "llfloaterreg.h" #include "lltrans.h" diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index caa20b767c..3073a19d83 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -34,7 +34,6 @@ #include "llfirstuse.h" #include "llnearbychatbar.h" -#include "llbottomtray.h" #include "llagent.h" #include "llgesturemgr.h" #include "llmultigesture.h" @@ -58,8 +57,6 @@ const S32 EXPANDED_HEIGHT = 300; // legacy callback glue void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -static LLDefaultChildRegistry::Register<LLGestureComboList> r("gesture_combo_list"); - struct LLChatTypeTrigger { std::string name; EChatType type; @@ -70,351 +67,6 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; -//ext-7367 -//Problem: gesture list control (actually LLScrollListCtrl) didn't actually process mouse wheel message. -// introduce new gesture list subclass to "eat" mouse wheel messages (and probably some other messages) -class LLGestureScrollListCtrl: public LLScrollListCtrl -{ -protected: - friend class LLUICtrlFactory; - LLGestureScrollListCtrl(const LLScrollListCtrl::Params& params) - :LLScrollListCtrl(params) - { - } -public: - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) - { - LLScrollListCtrl::handleScrollWheel( x, y, clicks ); - return TRUE; - } - //See EXT-6598 - //Mouse hover over separator will result in not processing tooltip message - //So eat this message - BOOL handleToolTip(S32 x, S32 y, MASK mask) - { - LLScrollListCtrl::handleToolTip( x, y, mask ); - return TRUE; - } -}; - -LLGestureComboList::Params::Params() -: combo_button("combo_button"), - combo_list("combo_list"), - get_more("get_more", true), - view_all("view_all", true) -{ -} - -LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) -: LLUICtrl(p), - mLabel(p.label), - mViewAllItemIndex(-1), - mGetMoreItemIndex(-1), - mShowViewAll(p.view_all), - mShowGetMore(p.get_more) -{ - LLBottomtrayButton::Params button_params = p.combo_button; - button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); - - mButton = LLUICtrlFactory::create<LLBottomtrayButton>(button_params); - mButton->reshape(getRect().getWidth(),getRect().getHeight()); - mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this)); - - addChild(mButton); - - LLGestureScrollListCtrl::Params params(p.combo_list); - - params.name("GestureComboList"); - params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2)); - params.visible(false); - params.commit_on_keyboard_movement(false); - - mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params); - addChild(mList); - - //****************************Gesture Part********************************/ - - setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this)); - - // now register us as observer since we have a place to put the results - LLGestureMgr::instance().addObserver(this); - - // refresh list from current active gestures - refreshGestures(); - - setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this)); -} - -BOOL LLGestureComboList::handleKeyHere(KEY key, MASK mask) -{ - BOOL handled = FALSE; - - if (key == KEY_ESCAPE && mask == MASK_NONE ) - { - hideList(); - handled = TRUE; - } - else - { - handled = mList->handleKeyHere(key, mask); - } - - return handled; -} - -void LLGestureComboList::draw() -{ - LLUICtrl::draw(); - - if(mButton->getToggleState()) - { - showList(); - } -} - -void LLGestureComboList::showList() -{ - LLRect rect = mList->getRect(); - LLRect button_rect = mButton->getRect(); - - // Calculating amount of space between the navigation bar and gestures combo - LLNavigationBar* nb = LLNavigationBar::getInstance(); - - S32 x, nb_bottom; - nb->localPointToOtherView(0, 0, &x, &nb_bottom, this); - - S32 max_height = nb_bottom - button_rect.mTop; - mList->calcColumnWidths(); - rect.setOriginAndSize(button_rect.mLeft, button_rect.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); - - mList->setRect(rect); - mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); - - gFocusMgr.setKeyboardFocus(this); - - // Show the list and push the button down - mButton->setToggleState(TRUE); - mList->setVisible(TRUE); - sendChildToFront(mList); - LLUI::addPopup(mList); -} - -void LLGestureComboList::onButtonCommit() -{ - if (!mList->getVisible()) - { - // highlight the last selected item from the original selection before potentially selecting a new item - // as visual cue to original value of combo box - LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); - if (last_selected_item) - { - mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); - } - - if (mList->getItemCount() != 0) - { - showList(); - } - } - else - { - hideList(); - } -} - -void LLGestureComboList::hideList() -{ - if (mList->getVisible()) - { - mButton->setToggleState(FALSE); - mList->setVisible(FALSE); - mList->mouseOverHighlightNthItem(-1); - LLUI::removePopup(mList); - gFocusMgr.setKeyboardFocus(NULL); - } -} - -S32 LLGestureComboList::getCurrentIndex() const -{ - LLScrollListItem* item = mList->getFirstSelected(); - if( item ) - { - return mList->getItemIndex( item ); - } - return -1; -} - -void LLGestureComboList::onItemSelected(const LLSD& data) -{ - const std::string name = mList->getSelectedItemLabel(); - - S32 cur_id = getCurrentIndex(); - mLastSelectedIndex = cur_id; - if (cur_id != mList->getItemCount()-1 && cur_id != -1) - { - mButton->setLabel(name); - } - - // hiding the list reasserts the old value stored in the text editor/dropdown button - hideList(); - - // commit does the reverse, asserting the value in the list - onCommit(); -} - -void LLGestureComboList::sortByName(bool ascending) -{ - mList->sortOnce(0, ascending); -} - -LLSD LLGestureComboList::getValue() const -{ - LLScrollListItem* item = mList->getFirstSelected(); - if( item ) - { - return item->getValue(); - } - else - { - return LLSD(); - } -} - -void LLGestureComboList::refreshGestures() -{ - //store current selection so we can maintain it - LLSD cur_gesture = getValue(); - - mList->selectFirstItem(); - mList->clearRows(); - mGestures.clear(); - - LLGestureMgr::item_map_t::const_iterator it; - const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures(); - LLSD::Integer idx(0); - for (it = active_gestures.begin(); it != active_gestures.end(); ++it) - { - LLMultiGesture* gesture = (*it).second; - if (gesture) - { - mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); - mGestures.push_back(gesture); - idx++; - } - } - - sortByName(); - - // store indices for Get More and View All items (idx is the index followed by the last added Gesture) - if (mShowGetMore) - { - mGetMoreItemIndex = idx; - mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex)); - } - if (mShowViewAll) - { - mViewAllItemIndex = idx + 1; - mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); - } - - // Insert label after sorting, at top, with separator below it - mList->addSeparator(ADD_TOP); - mList->addSimpleElement(mLabel, ADD_TOP); - - if (cur_gesture.isDefined()) - { - mList->selectByValue(cur_gesture); - - } - else - { - mList->selectFirstItem(); - } - - LLCtrlListInterface* gestures = getListInterface(); - LLMultiGesture* gesture = NULL; - - if (gestures) - { - S32 sel_index = gestures->getFirstSelectedIndex(); - if (sel_index != 0) - { - S32 index = gestures->getSelectedValue().asInteger(); - if (index<0 || index >= (S32)mGestures.size()) - { - llwarns << "out of range gesture access" << llendl; - } - else - { - gesture = mGestures.at(index); - } - } - } - - if(gesture && LLGestureMgr::instance().isGesturePlaying(gesture)) - { - return; - } - - mButton->setLabel(mLabel); -} - -void LLGestureComboList::onCommitGesture() -{ - LLCtrlListInterface* gestures = getListInterface(); - if (gestures) - { - S32 sel_index = gestures->getFirstSelectedIndex(); - if (sel_index == 0) - { - return; - } - - S32 index = gestures->getSelectedValue().asInteger(); - - if (mViewAllItemIndex == index) - { - // The same behavior as Ctrl+G. EXT-823 - LLFloaterReg::toggleInstance("gestures"); - gestures->selectFirstItem(); - return; - } - - if (mGetMoreItemIndex == index) - { - LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL")); - return; - } - - if (index<0 || index >= (S32)mGestures.size()) - { - llwarns << "out of range gesture index" << llendl; - } - else - { - LLMultiGesture* gesture = mGestures.at(index); - if(gesture) - { - LLGestureMgr::instance().playGesture(gesture); - if(!gesture->mReplaceText.empty()) - { - LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE); - } - } - } - } -} - -LLGestureComboList::~LLGestureComboList() -{ - LLGestureMgr::instance().removeObserver(this); -} - -LLCtrlListInterface* LLGestureComboList::getListInterface() -{ - return mList; -} - LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) : LLFloater(key), mChatBox(NULL) @@ -839,11 +491,6 @@ void LLNearbyChatBar::startChat(const char* line) // static void LLNearbyChatBar::stopChat() { - LLBottomTray *bt = LLBottomTray::getInstance(); - - if (!bt) - return; - LLNearbyChatBar* cb = LLNearbyChatBar::getInstance(); if (!cb) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 0415f12a0d..a6fd6e5665 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -27,73 +27,15 @@ #ifndef LL_LLNEARBYCHATBAR_H #define LL_LLNEARBYCHATBAR_H -#include "llpanel.h" +#include "llfloater.h" #include "llcombobox.h" #include "llgesturemgr.h" #include "llchat.h" #include "llvoiceclient.h" #include "lloutputmonitorctrl.h" #include "llspeakers.h" -#include "llbottomtray.h" - -class LLGestureComboList - : public LLGestureManagerObserver - , public LLUICtrl -{ -public: - struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> - { - Optional<LLBottomtrayButton::Params> combo_button; - Optional<LLScrollListCtrl::Params> combo_list; - Optional<bool> get_more, - view_all; - - Params(); - }; - -protected: - - friend class LLUICtrlFactory; - LLGestureComboList(const Params&); - std::vector<LLMultiGesture*> mGestures; - std::string mLabel; - bool mShowViewAll; - bool mShowGetMore; - LLSD::Integer mViewAllItemIndex; - LLSD::Integer mGetMoreItemIndex; - -public: - - ~LLGestureComboList(); - - LLCtrlListInterface* getListInterface(); - virtual void showList(); - virtual void hideList(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - - virtual void draw(); - - S32 getCurrentIndex() const; - void onItemSelected(const LLSD& data); - void sortByName(bool ascending = true); - void refreshGestures(); - void onCommitGesture(); - void onButtonCommit(); - virtual LLSD getValue() const; - - // LLGestureManagerObserver trigger - virtual void changed() { refreshGestures(); } - -private: - - LLButton* mButton; - LLScrollListCtrl* mList; - S32 mLastSelectedIndex; -}; - -class LLNearbyChatBar -: public LLFloater +class LLNearbyChatBar : public LLFloater { public: // constructor for inline chat-bars (e.g. hosted in chat history window) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index fd5c3362bb..27390fca78 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -72,7 +72,7 @@ public: std::string agent_name = params[0]; llinfos << "Profile, agent_name " << agent_name << llendl; std::string url = getProfileURL(agent_name); - LLWeb::loadWebURLInternal(url); + LLWeb::loadURLInternal(url); return true; } diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 164a1c0ca6..8ae9328f6d 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -448,4 +448,4 @@ void LLToolBarView::onEndDrag() gToolBarView->mDragToolbar->addCommand(gToolBarView->mDragCommand,gToolBarView->mDragRank); } stopDragTool(); -}
\ No newline at end of file +} diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 619d74e7ac..3463eec5d8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -288,7 +288,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); - LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterUIPreviewUtil::registerFloater(); @@ -301,7 +301,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>); - LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); LLFloaterWindowSizeUtil::registerFloater(); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 3a3d4f3881..d1120b6269 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -69,15 +69,12 @@ LLHelpHandler gHelpHandler; ////////////////////////////// // implement LLHelp interface -void LLViewerHelp::showTopic(const std::string &topic) +std::string LLViewerHelp::getURL(const std::string &topic) { // allow overriding the help server with a local help file if( gSavedSettings.getBOOL("HelpUseLocal") ) { - showHelp(); - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); - return; + return "__local"; } // if the help topic is empty, use the default topic @@ -99,11 +96,12 @@ void LLViewerHelp::showTopic(const std::string &topic) } } - // work out the URL for this topic and display it - showHelp(); - - std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic ); - setRawURL(helpURL); + return LLViewerHelpUtil::buildHelpURL( help_topic ); +} + +void LLViewerHelp::showTopic(const std::string& topic) +{ + LLFloaterReg::showInstance("help_browser", topic); } std::string LLViewerHelp::defaultTopic() @@ -146,23 +144,4 @@ std::string LLViewerHelp::getTopicFromFocus() return defaultTopic(); } -// static -void LLViewerHelp::showHelp() -{ - LLFloaterReg::showInstance("help_browser"); -} - -// static -void LLViewerHelp::setRawURL(std::string url) -{ - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - if (helpbrowser) - { - helpbrowser->openMedia(url); - } - else - { - llwarns << "Eep, help_browser floater not found" << llendl; - } -} diff --git a/indra/newview/llviewerhelp.h b/indra/newview/llviewerhelp.h index 7612986227..a983012e2e 100644 --- a/indra/newview/llviewerhelp.h +++ b/indra/newview/llviewerhelp.h @@ -45,6 +45,8 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> /// display the specified help topic in the help viewer /*virtual*/ void showTopic(const std::string &topic); + std::string getURL(const std::string& topic); + // return topic derived from viewer UI focus, else default topic std::string getTopicFromFocus(); @@ -56,10 +58,6 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> // return topic to use for the top-level help, invoked by F1 /*virtual*/ std::string f1HelpTopic(); - - private: - static void showHelp(); // make sure help UI is visible & raised - static void setRawURL(std::string url); // send URL to help UI }; #endif // header guard diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fbfde711a9..bc0f38dd77 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5370,6 +5370,34 @@ class LLAvatarAddFriend : public view_listener_t } }; + +class LLAvatarToggleMyProfile : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID()); + if (LLFloater::isMinimized(instance)) + { + instance->setMinimized(FALSE); + instance->setFocus(TRUE); + } + else if (!LLFloater::isShown(instance)) + { + LLAvatarActions::showProfile(gAgent.getID()); + } + else if (!instance->hasFocus() && !instance->getIsChrome()) + { + instance->setFocus(TRUE); + } + else + { + instance->closeFloater(); + } + return true; + } +}; + + class LLAvatarAddContact : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7229,7 +7257,7 @@ void handle_web_browser_test(const LLSD& param) void handle_web_content_test(const LLSD& param) { std::string url = param.asString(); - LLWeb::loadWebURLInternal(url); + LLWeb::loadURLInternal(url); } void handle_buy_currency_test(void*) @@ -8165,6 +8193,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); + view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); + enable.add("Avatar.IsMyProfileOpen", boost::bind(&LLAvatarActions::profileVisible, gAgent.getID())); view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2)); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 6f7115ff6d..7bc5453688 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -125,7 +125,9 @@ void LLWeb::loadURLInternal(const std::string &url, const std::string& target, c // Explicitly open a Web URL using the Web content floater void LLWeb::loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { - LLFloaterWebContent::create(LLFloaterWebContent::Params().url(url).target(target).id(uuid)); + LLFloaterWebContent::Params p; + p.url(url).target(target).id(uuid); + LLFloaterReg::showInstance("web_content", p); } // static diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index dc5958e57f..376abc0ece 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -46,21 +46,19 @@ public: static void loadURL(const std::string& url, const std::string& target, const std::string& uuid = LLStringUtil::null); static void loadURL(const std::string& url) { loadURL(url, LLStringUtil::null); } /// Load the given url in the user's preferred web browser - static void loadURL(const char* url, const std::string& target) { loadURL( ll_safe_string(url), target); } - static void loadURL(const char* url) { loadURL( ll_safe_string(url), LLStringUtil::null ); } + static void loadURL(const char* url, const std::string& target = LLStringUtil::null) { loadURL( ll_safe_string(url), target); } /// Load the given url in the Second Life internal web browser static void loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); - static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null); } + static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null, LLStringUtil::null);} /// Load the given url in the operating system's web browser, async if we want to return immediately /// before browser has spawned - static void loadURLExternal(const std::string& url) { loadURLExternal(url, LLStringUtil::null); }; + static void loadURLExternal(const std::string& url) {loadURLExternal(url, LLStringUtil::null);} static void loadURLExternal(const std::string& url, const std::string& uuid); static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null); // Explicitly open a Web URL using the Web content floater vs. the more general media browser static void loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); - static void loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid); - static void loadWebURLInternal(const std::string &url) { loadWebURLInternal(url, LLStringUtil::null, LLStringUtil::null); } + static void loadWebURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null); /// Returns escaped url (eg, " " to "%20") - used by all loadURL methods static std::string escapeURL(const std::string& url); diff --git a/indra/newview/skins/default/textures/toolbar_icons/picks.png b/indra/newview/skins/default/textures/toolbar_icons/picks.png Binary files differindex 4499bf562b..befda04b42 100644 --- a/indra/newview/skins/default/textures/toolbar_icons/picks.png +++ b/indra/newview/skins/default/textures/toolbar_icons/picks.png diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index da2be18db6..125ca81cde 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -1,9 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - can_dock="true" can_minimize="true" - can_close="false" + can_close="true" follows="bottom" height="164" layout="topleft" @@ -11,7 +10,6 @@ help_topic="camera_floater" save_rect="true" save_visibility="true" - save_dock_state="true" single_instance="true" width="228"> <floater.string diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 21c9eb7437..bf9eeb6d26 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -60,9 +60,9 @@ layout="topleft" auto_resize="true" user_resize="true" - min_width="340" + min_width="480" name="navigation_layout_panel" - width="340"> + width="480"> <panel background_visible="false" follows="left|top|right" @@ -71,7 +71,7 @@ layout="topleft" left="0" name="navigation_panel" - width="340"> + width="480"> <pull_button follows="left|top" direction="down" @@ -118,7 +118,7 @@ mouse_opaque="false" name="location_combo" top_delta="0" - width="215"> + width="355"> <combo_list mouse_wheel_opaque="true"/> </location_input> @@ -149,9 +149,9 @@ layout="topleft" auto_resize="true" user_resize="true" - min_width="335" + min_width="315" name="favorites_layout_panel" - width="335"> + width="315"> <favorites_bar follows="left|right|top" font="SansSerifSmall" @@ -161,7 +161,7 @@ name="favorite" image_drag_indication="Accordion_ArrowOpened_Off" tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!" - width="331"> + width="311"> <label follows="left|top" height="15" @@ -177,14 +177,12 @@ <!-- More button actually is a text box. --> <more_button follows="left|bottom" - font.name="SansSerifSmall" - font.style="UNDERLINE" name=">>" tab_stop="false" tool_tip="Show more of My Favorites" top="15" width="50"> - More... + More ▼ </more_button> </favorites_bar> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index d12dda88be..f19cfa19f2 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2051,6 +2051,8 @@ Returns a string with the requested data about the region <string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string> <string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string> + <string name="Open landmarks">Open landmarks</string> + <!-- use value="" because they have preceding spaces --> <string name="no_transfer" value=" (no transfer)" /> <string name="no_modify" value=" (no modify)" /> |