diff options
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 89d60ad..f9063ce 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -128,7 +128,7 @@ void LLFloaterChat::draw() | |||
128 | 128 | ||
129 | childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel")); | 129 | childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel")); |
130 | 130 | ||
131 | LLChatBar* chat_barp = (LLChatBar*)getChildByName("chat_panel", TRUE); | 131 | LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); |
132 | if (chat_barp) | 132 | if (chat_barp) |
133 | { | 133 | { |
134 | chat_barp->refresh(); | 134 | chat_barp->refresh(); |
@@ -142,7 +142,7 @@ BOOL LLFloaterChat::postBuild() | |||
142 | { | 142 | { |
143 | mPanel = (LLPanelActiveSpeakers*)LLUICtrlFactory::getPanelByName(this, "active_speakers_panel"); | 143 | mPanel = (LLPanelActiveSpeakers*)LLUICtrlFactory::getPanelByName(this, "active_speakers_panel"); |
144 | 144 | ||
145 | LLChatBar* chat_barp = (LLChatBar*)getChildByName("chat_panel", TRUE); | 145 | LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); |
146 | if (chat_barp) | 146 | if (chat_barp) |
147 | { | 147 | { |
148 | chat_barp->setGestureCombo(LLUICtrlFactory::getComboBoxByName(this, "Gesture")); | 148 | chat_barp->setGestureCombo(LLUICtrlFactory::getComboBoxByName(this, "Gesture")); |
@@ -221,8 +221,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | |||
221 | 221 | ||
222 | // could flash the chat button in the status bar here. JC | 222 | // could flash the chat button in the status bar here. JC |
223 | LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); | 223 | LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); |
224 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)chat_floater->getChildByName("Chat History Editor", TRUE); | 224 | LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor"); |
225 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)chat_floater->getChildByName("Chat History Editor with mute", TRUE); | 225 | LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); |
226 | 226 | ||
227 | history_editor->setParseHTML(TRUE); | 227 | history_editor->setParseHTML(TRUE); |
228 | history_editor_with_mute->setParseHTML(TRUE); | 228 | history_editor_with_mute->setParseHTML(TRUE); |
@@ -255,8 +255,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | |||
255 | // static | 255 | // static |
256 | void LLFloaterChat::setHistoryCursorAndScrollToEnd() | 256 | void LLFloaterChat::setHistoryCursorAndScrollToEnd() |
257 | { | 257 | { |
258 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)LLFloaterChat::getInstance(LLSD())->getChildByName("Chat History Editor", TRUE); | 258 | LLViewerTextEditor* history_editor = LLFloaterChat::getInstance(LLSD())->getChild<LLViewerTextEditor>("Chat History Editor"); |
259 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)LLFloaterChat::getInstance(LLSD())->getChildByName("Chat History Editor with mute", TRUE); | 259 | LLViewerTextEditor* history_editor_with_mute = LLFloaterChat::getInstance(LLSD())->getChild<LLViewerTextEditor>("Chat History Editor with mute"); |
260 | 260 | ||
261 | if (history_editor) | 261 | if (history_editor) |
262 | { | 262 | { |
@@ -299,8 +299,8 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) | |||
299 | 299 | ||
300 | //LLCheckBoxCtrl* | 300 | //LLCheckBoxCtrl* |
301 | BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get(); | 301 | BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get(); |
302 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor", TRUE); | 302 | LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor"); |
303 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor with mute", TRUE); | 303 | LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); |
304 | 304 | ||
305 | if (!history_editor || !history_editor_with_mute) | 305 | if (!history_editor || !history_editor_with_mute) |
306 | return; | 306 | return; |
@@ -455,26 +455,35 @@ void* LLFloaterChat::createChatPanel(void* data) | |||
455 | return chatp; | 455 | return chatp; |
456 | } | 456 | } |
457 | 457 | ||
458 | // static | ||
459 | void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) | ||
460 | { | ||
461 | LLFloaterChat* self = (LLFloaterChat*)userdata; | ||
462 | |||
463 | self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); | ||
464 | } | ||
465 | |||
466 | //static | ||
467 | bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) | ||
468 | { | ||
469 | return VisibilityPolicy<LLFloater>::visible(instance, key); | ||
470 | } | ||
471 | |||
458 | //static | 472 | //static |
459 | void LLFloaterChat::hideInstance(const LLSD& id) | 473 | void LLFloaterChat::show(LLFloater* instance, const LLSD& key) |
460 | { | 474 | { |
461 | LLFloaterChat* floaterp = LLFloaterChat::getInstance(LLSD()); | 475 | VisibilityPolicy<LLFloater>::show(instance, key); |
476 | } | ||
462 | 477 | ||
463 | if(floaterp->getHost()) | 478 | //static |
479 | void LLFloaterChat::hide(LLFloater* instance, const LLSD& key) | ||
480 | { | ||
481 | if(instance->getHost()) | ||
464 | { | 482 | { |
465 | LLFloaterChatterBox::hideInstance(LLSD()); | 483 | LLFloaterChatterBox::hideInstance(); |
466 | } | 484 | } |
467 | else | 485 | else |
468 | { | 486 | { |
469 | LLUISingleton<LLFloaterChat>::hideInstance(id); | 487 | VisibilityPolicy<LLFloater>::hide(instance, key); |
470 | } | 488 | } |
471 | } | 489 | } |
472 | |||
473 | // static | ||
474 | void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) | ||
475 | { | ||
476 | LLFloaterChat* self = (LLFloaterChat*)userdata; | ||
477 | |||
478 | self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); | ||
479 | } | ||
480 | |||