From 0297f55c6d4be505fe6831a593ed2630d565e14a Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 21 Oct 2011 17:26:47 +0200 Subject: EXP-1416 FIXED "Speak" and "Voice controls" buttons added as control views in LLTransientFloaterMgr to prevent hiding the transient IM floater. --- indra/llui/lltoolbar.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 515605200e..b0a072c00e 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -112,6 +112,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mStartDragItemCallback(NULL), mHandleDragItemCallback(NULL), mHandleDropCallback(NULL), + mButtonAddSignal(NULL), mDragAndDropTarget(false) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; @@ -121,6 +122,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) LLToolBar::~LLToolBar() { delete mPopupMenuHandle.get(); + delete mButtonAddSignal; } void LLToolBar::createContextMenu() @@ -212,7 +214,6 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) mButtonPanel->addChild(button); mButtonMap.insert(std::make_pair(commandId.uuid(), button)); - // Insert the command and button in the right place in their respective lists if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE)) { @@ -236,6 +237,11 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) mButtons.insert(it_button,button); } + if (mButtonAddSignal) + { + (*mButtonAddSignal)(button); + } + mNeedsLayout = true; return true; @@ -898,6 +904,12 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) return button; } +boost::signals2::connection LLToolBar::setButtonAddCallback(const button_add_signal_t::slot_type& cb) +{ + if (!mButtonAddSignal) mButtonAddSignal = new button_add_signal_t(); + return mButtonAddSignal->connect(cb); +} + BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, -- cgit v1.2.3 From 8d6e7fa02c0d5cd18f91ac6862079ff4fa0719d4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 24 Oct 2011 16:49:00 -0700 Subject: * Fixed destination guide floater to display on login based on per account "DisplayDestinationsOnInitialRun" setting or initial agent SL login. * Added toolbar enumeration for toolbar view so queries for commands can now indicate where the command currently is on the left, right or bottom toolbars. * Updated toybox toolbar button tooltips to indicate where the command currently resides in the view. * Added unused function to allow toolbar buttons to be changed to flash indefinitely. Reviewed by Richard. --- indra/llui/lltoolbar.cpp | 61 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 16 deletions(-) (limited to 'indra/llui/lltoolbar.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index b0a072c00e..97dc1e3316 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -113,6 +113,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mHandleDragItemCallback(NULL), mHandleDropCallback(NULL), mButtonAddSignal(NULL), + mButtonEnterSignal(NULL), mDragAndDropTarget(false) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; @@ -123,6 +124,7 @@ LLToolBar::~LLToolBar() { delete mPopupMenuHandle.get(); delete mButtonAddSignal; + delete mButtonEnterSignal; } void LLToolBar::createContextMenu() @@ -358,6 +360,23 @@ bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) return (command_button != NULL); } +bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) +{ + LLButton * command_button = NULL; + + if (commandId != LLCommandId::null) + { + command_id_map::iterator it = mButtonMap.find(commandId.uuid()); + if (it != mButtonMap.end()) + { + command_button = it->second; + command_button->setFlashing(flash ? TRUE : FALSE); + } + } + + return (command_button != NULL); +} + BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) { LLRect button_panel_rect; @@ -876,8 +895,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) button->setCommitCallback(executeParam); } - - + // Set up "is running" query callback const std::string& isRunningFunction = commandp->isRunningFunctionName(); if (isRunningFunction.length() > 0) { @@ -904,12 +922,18 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) return button; } -boost::signals2::connection LLToolBar::setButtonAddCallback(const button_add_signal_t::slot_type& cb) +boost::signals2::connection LLToolBar::setButtonAddCallback(const button_signal_t::slot_type& cb) { - if (!mButtonAddSignal) mButtonAddSignal = new button_add_signal_t(); + if (!mButtonAddSignal) mButtonAddSignal = new button_signal_t(); return mButtonAddSignal->connect(cb); } +boost::signals2::connection LLToolBar::setButtonEnterCallback(const button_signal_t::slot_type& cb) +{ + if (!mButtonEnterSignal) mButtonEnterSignal = new button_signal_t(); + return mButtonEnterSignal->connect(cb); +} + BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -981,8 +1005,6 @@ LLToolBarButton::LLToolBarButton(const Params& p) mOriginalImageOverlayColor(p.image_overlay_color), mOriginalImageOverlaySelectedColor(p.image_overlay_selected_color) { - mButtonFlashRate = 0.0; - mButtonFlashCount = 0; } LLToolBarButton::~LLToolBarButton() @@ -1024,6 +1046,7 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) { handled = LLButton::handleHover(x, y, mask); } + return handled; } @@ -1036,6 +1059,12 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask) { mNeedsHighlight = TRUE; } + + LLToolBar* parent_toolbar = getParentByType(); + if (parent_toolbar && parent_toolbar->mButtonEnterSignal) + { + (*(parent_toolbar->mButtonEnterSignal))(this); + } } void LLToolBarButton::onMouseCaptureLost() @@ -1084,25 +1113,25 @@ void LLToolBarButton::setEnabled(BOOL enabled) } } - const std::string LLToolBarButton::getToolTip() const { std::string tooltip; + if (labelIsTruncated() || getCurrentLabel().empty()) { - return LLTrans::getString(LLCommandManager::instance().getCommand(mId)->labelRef()) + " -- " + LLView::getToolTip(); + tooltip = LLTrans::getString(LLCommandManager::instance().getCommand(mId)->labelRef()) + " -- " + LLView::getToolTip(); } else { - return LLView::getToolTip(); + tooltip = LLView::getToolTip(); } -} - - - - - - + LLToolBar* parent_toolbar = getParentByType(); + if (parent_toolbar && parent_toolbar->mButtonTooltipSuffix.length() > 0) + { + tooltip = tooltip + "\n(" + parent_toolbar->mButtonTooltipSuffix + ")"; + } + return tooltip; +} -- cgit v1.2.3 From 8448e3b86e9ed94a29a6d1e0bdc8b8f78ff84091 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 25 Oct 2011 14:14:46 -0700 Subject: EXP-1398 FIX -- Viewer Crash when moving Speak button from bottom toolbar to side toolbar with call request dialog active on Mac * Added "on button removed" callback for toolbars. * Changed docking on incoming and outgoing call floaters to be undocked when "speak" button removed. Reviewed by Leyla. --- indra/llui/lltoolbar.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'indra/llui/lltoolbar.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 97dc1e3316..ea11750e38 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -114,6 +114,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mHandleDropCallback(NULL), mButtonAddSignal(NULL), mButtonEnterSignal(NULL), + mButtonLeaveSignal(NULL), + mButtonRemoveSignal(NULL), mDragAndDropTarget(false) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; @@ -125,6 +127,8 @@ LLToolBar::~LLToolBar() delete mPopupMenuHandle.get(); delete mButtonAddSignal; delete mButtonEnterSignal; + delete mButtonLeaveSignal; + delete mButtonRemoveSignal; } void LLToolBar::createContextMenu() @@ -272,6 +276,11 @@ int LLToolBar::removeCommand(const LLCommandId& commandId) ++rank; } + if (mButtonRemoveSignal) + { + (*mButtonRemoveSignal)(*it_button); + } + // Delete the button and erase the command and button records delete (*it_button); mButtonCommands.erase(it_command); @@ -922,16 +931,34 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) return button; } +boost::signals2::connection connectSignal(LLToolBar::button_signal_t*& signal, const LLToolBar::button_signal_t::slot_type& cb) +{ + if (!signal) + { + signal = new LLToolBar::button_signal_t(); + } + + return signal->connect(cb); +} + boost::signals2::connection LLToolBar::setButtonAddCallback(const button_signal_t::slot_type& cb) { - if (!mButtonAddSignal) mButtonAddSignal = new button_signal_t(); - return mButtonAddSignal->connect(cb); + return connectSignal(mButtonAddSignal, cb); } boost::signals2::connection LLToolBar::setButtonEnterCallback(const button_signal_t::slot_type& cb) { - if (!mButtonEnterSignal) mButtonEnterSignal = new button_signal_t(); - return mButtonEnterSignal->connect(cb); + return connectSignal(mButtonEnterSignal, cb); +} + +boost::signals2::connection LLToolBar::setButtonLeaveCallback(const button_signal_t::slot_type& cb) +{ + return connectSignal(mButtonLeaveSignal, cb); +} + +boost::signals2::connection LLToolBar::setButtonRemoveCallback(const button_signal_t::slot_type& cb) +{ + return connectSignal(mButtonRemoveSignal, cb); } BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, @@ -1067,6 +1094,17 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask) } } +void LLToolBarButton::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLButton::onMouseLeave(x, y, mask); + + LLToolBar* parent_toolbar = getParentByType(); + if (parent_toolbar && parent_toolbar->mButtonLeaveSignal) + { + (*(parent_toolbar->mButtonLeaveSignal))(this); + } +} + void LLToolBarButton::onMouseCaptureLost() { mIsDragged = false; -- cgit v1.2.3 From a5f3c70eeff4aeeb3c5fd463bed5be7cfb2cf60e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 25 Oct 2011 15:52:08 -0700 Subject: EXP-1469 FIX -- Changing toolbar from "icons only" to "icons with text" while incoming/outgoing call floater is open causes crash on mac * Updated LLToolBar to call remove and add on all buttons when rebuilding the toolbar. --- indra/llui/lltoolbar.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/llui/lltoolbar.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index ea11750e38..2d96bf2fc6 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -824,6 +824,11 @@ void LLToolBar::createButtons() { BOOST_FOREACH(LLToolBarButton* button, mButtons) { + if (mButtonRemoveSignal) + { + (*mButtonRemoveSignal)(button); + } + delete button; } mButtons.clear(); @@ -835,6 +840,11 @@ void LLToolBar::createButtons() mButtons.push_back(button); mButtonPanel->addChild(button); mButtonMap.insert(std::make_pair(command_id.uuid(), button)); + + if (mButtonAddSignal) + { + (*mButtonAddSignal)(button); + } } mNeedsLayout = true; } -- cgit v1.2.3 From a64f7e1c7b6c60e2f43b75d150cf5e4ee5a5afcd Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 25 Oct 2011 17:32:40 -0700 Subject: EXP-1468 Incoming/outgoing call floater tongue position doesn't follow floater --- indra/llui/lltoolbar.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index ea11750e38..19dc688504 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -243,13 +243,16 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) mButtons.insert(it_button,button); } + mNeedsLayout = true; + + updateLayoutAsNeeded(); + + if (mButtonAddSignal) { (*mButtonAddSignal)(button); } - mNeedsLayout = true; - return true; } -- cgit v1.2.3