aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterchatterbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterchatterbox.cpp')
-rw-r--r--linden/indra/newview/llfloaterchatterbox.cpp51
1 files changed, 27 insertions, 24 deletions
diff --git a/linden/indra/newview/llfloaterchatterbox.cpp b/linden/indra/newview/llfloaterchatterbox.cpp
index 88e0c5d..1114635 100644
--- a/linden/indra/newview/llfloaterchatterbox.cpp
+++ b/linden/indra/newview/llfloaterchatterbox.cpp
@@ -35,7 +35,7 @@
35#include "llviewerprecompiledheaders.h" 35#include "llviewerprecompiledheaders.h"
36 36
37#include "llfloaterchatterbox.h" 37#include "llfloaterchatterbox.h"
38#include "llvieweruictrlfactory.h" 38#include "lluictrlfactory.h"
39#include "llfloaterchat.h" 39#include "llfloaterchat.h"
40#include "llfloaterfriends.h" 40#include "llfloaterfriends.h"
41#include "llfloatergroups.h" 41#include "llfloatergroups.h"
@@ -53,7 +53,7 @@ LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed)
53 mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL); 53 mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL);
54 // do not automatically open singleton floaters (as result of getInstance()) 54 // do not automatically open singleton floaters (as result of getInstance())
55 BOOL no_open = FALSE; 55 BOOL no_open = FALSE;
56 gUICtrlFactory->buildFloater(this, "floater_my_friends.xml", &getFactoryMap(), no_open); 56 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml", &getFactoryMap(), no_open);
57} 57}
58 58
59LLFloaterMyFriends::~LLFloaterMyFriends() 59LLFloaterMyFriends::~LLFloaterMyFriends()
@@ -62,7 +62,7 @@ LLFloaterMyFriends::~LLFloaterMyFriends()
62 62
63BOOL LLFloaterMyFriends::postBuild() 63BOOL LLFloaterMyFriends::postBuild()
64{ 64{
65 mTabs = LLUICtrlFactory::getTabContainerByName(this, "friends_and_groups"); 65 mTabs = getChild<LLTabContainer>("friends_and_groups");
66 66
67 return TRUE; 67 return TRUE;
68} 68}
@@ -93,7 +93,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) :
93{ 93{
94 mAutoResize = FALSE; 94 mAutoResize = FALSE;
95 95
96 gUICtrlFactory->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); 96 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE);
97 if (gSavedSettings.getBOOL("ContactsTornOff")) 97 if (gSavedSettings.getBOOL("ContactsTornOff"))
98 { 98 {
99 LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); 99 LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0);
@@ -128,33 +128,29 @@ LLFloaterChatterBox::~LLFloaterChatterBox()
128{ 128{
129} 129}
130 130
131BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) 131BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask)
132{ 132{
133 if (getEnabled() 133 if (key == 'W' && mask == MASK_CONTROL)
134 && mask == MASK_CONTROL)
135 { 134 {
136 if (key == 'W') 135 LLFloater* floater = getActiveFloater();
136 // is user closeable and is system closeable
137 if (floater && floater->canClose())
137 { 138 {
138 LLFloater* floater = getActiveFloater(); 139 if (floater->isCloseable())
139 // is user closeable and is system closeable
140 if (floater && floater->canClose())
141 { 140 {
142 if (floater->isCloseable()) 141 floater->close();
143 { 142 }
144 floater->close(); 143 else
145 } 144 {
146 else 145 // close chatterbox window if frontmost tab is reserved, non-closeable tab
147 { 146 // such as contacts or near me
148 // close chatterbox window if frontmost tab is reserved, non-closeable tab 147 close();
149 // such as contacts or near me
150 close();
151 }
152 } 148 }
153 return TRUE;
154 } 149 }
150 return TRUE;
155 } 151 }
156 152
157 return LLMultiFloater::handleKeyHere(key, mask, called_from_parent); 153 return LLMultiFloater::handleKeyHere(key, mask);
158} 154}
159 155
160void LLFloaterChatterBox::draw() 156void LLFloaterChatterBox::draw()
@@ -214,6 +210,13 @@ void LLFloaterChatterBox::onClose(bool app_quitting)
214 gSavedSettings.setBOOL("ShowCommunicate", FALSE); 210 gSavedSettings.setBOOL("ShowCommunicate", FALSE);
215} 211}
216 212
213void LLFloaterChatterBox::setMinimized(BOOL minimized)
214{
215 LLFloater::setMinimized(minimized);
216 // HACK: potentially need to toggle console
217 LLFloaterChat::getInstance()->updateConsoleVisibility();
218}
219
217void LLFloaterChatterBox::removeFloater(LLFloater* floaterp) 220void LLFloaterChatterBox::removeFloater(LLFloater* floaterp)
218{ 221{
219 if (floaterp->getName() == "chat floater") 222 if (floaterp->getName() == "chat floater")
@@ -247,7 +250,7 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp,
247 { 250 {
248 mTabContainer->unlockTabs(); 251 mTabContainer->unlockTabs();
249 // add chat history as second tab if contact window is present, first tab otherwise 252 // add chat history as second tab if contact window is present, first tab otherwise
250 if (getChildByName("floater_my_friends", TRUE)) 253 if (getChildView("floater_my_friends"))
251 { 254 {
252 // assuming contacts window is first tab, select it 255 // assuming contacts window is first tab, select it
253 mTabContainer->selectFirstTab(); 256 mTabContainer->selectFirstTab();