summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-10-25 14:14:46 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-10-25 14:14:46 -0700
commit8448e3b86e9ed94a29a6d1e0bdc8b8f78ff84091 (patch)
treea27fb7b097797e0f8be95f5af526b6313dcdb359 /indra/newview/llimview.cpp
parent8e4c3dc14f3c5e8220f7b88bceaa5d1ccbb0a2f0 (diff)
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.
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp52
1 files changed, 32 insertions, 20 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index c751394455..ed4bb727cd 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1679,16 +1679,44 @@ BOOL LLCallDialog::postBuild()
{
if (!LLDockableFloater::postBuild() || !gToolBarView)
return FALSE;
+
+ dockToToolbarButton("speak");
+
+ return TRUE;
+}
- LLView *anchor_panel = gToolBarView->findChildView("speak");
- LLDockControl::DocAt dock_pos = getDockControlPos();
- setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos));
+void LLCallDialog::dockToToolbarButton(const std::string& toolbarButtonName)
+{
+ LLDockControl::DocAt dock_pos = getDockControlPos(toolbarButtonName);
+ LLView *anchor_panel = gToolBarView->findChildView(toolbarButtonName);
setUseTongue(anchor_panel);
- return TRUE;
+ setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos));
}
+LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarButtonName)
+{
+ LLCommandId command_id(toolbarButtonName);
+ S32 toolbar_loc = gToolBarView->hasCommand(command_id);
+
+ LLDockControl::DocAt doc_at = LLDockControl::TOP;
+
+ switch (toolbar_loc)
+ {
+ case LLToolBarView::TOOLBAR_LEFT:
+ doc_at = LLDockControl::RIGHT;
+ break;
+
+ case LLToolBarView::TOOLBAR_RIGHT:
+ doc_at = LLDockControl::LEFT;
+ break;
+ }
+
+ return doc_at;
+}
+
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLOutgoingCallDialog
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1752,22 +1780,6 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id)
}
}
-LLDockControl::DocAt LLCallDialog::getDockControlPos()
-{
- LLToolBar* tool_bar = NULL;
-
- if((tool_bar = gToolBarView->getChild<LLToolBar>("toolbar_left")) && tool_bar->hasChild("speak", true))
- {
- return LLDockControl::RIGHT; // Speak button in the left toolbar so the call floater should be to the right of the speak button
- }
- else if((tool_bar = gToolBarView->getChild<LLToolBar>("toolbar_right")) && tool_bar->hasChild("speak", true))
- {
- return LLDockControl::LEFT; // Speak button in the right toolbar so the call floater should be to the left of the speak button
- }
-
- return LLDockControl::TOP;
-}
-
bool LLCallDialog::lifetimeHasExpired()
{
if (mLifetimeTimer.getStarted())