Going back to the previous instance ethod calling mode, fixing chat bar getting focus when it's already open
parent
009a3aa102
commit
f37ea05c2a
|
|
@ -117,7 +117,7 @@ LLNearbyChatControl::~LLNearbyChatControl()
|
|||
|
||||
void LLNearbyChatControl::onCommit()
|
||||
{
|
||||
LLNearbyChat::getInstance()->sendChat(getConvertedText(),CHAT_TYPE_NORMAL);
|
||||
LLNearbyChat::instance().sendChat(getConvertedText(),CHAT_TYPE_NORMAL);
|
||||
setText(LLStringExplicit(""));
|
||||
|
||||
if(getName()=="default_chat_bar")
|
||||
|
|
@ -131,7 +131,7 @@ void LLNearbyChatControl::onCommit()
|
|||
{
|
||||
setVisible(FALSE);
|
||||
getParent()->setVisible(FALSE);
|
||||
gSavedSettings.setBOOL("MainChatbarVisible",FALSE);
|
||||
LLNearbyChat::instance().showDefaultChatBar(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,14 +76,18 @@ LLNearbyChat::LLNearbyChat() :
|
|||
mDefaultChatBar(NULL),
|
||||
mFocusedInputEditor(NULL)
|
||||
{
|
||||
gSavedSettings.getControl("MainChatbarVisible")->getSignal()->connect(boost::bind(&LLNearbyChat::showDefaultChatBar, this));
|
||||
|
||||
gSavedSettings.getControl("MainChatbarVisible")->getSignal()->connect(boost::bind(&LLNearbyChat::onDefaultChatBarButtonClicked, this));
|
||||
}
|
||||
|
||||
LLNearbyChat::~LLNearbyChat()
|
||||
{
|
||||
}
|
||||
|
||||
void LLNearbyChat::onDefaultChatBarButtonClicked()
|
||||
{
|
||||
showDefaultChatBar(gSavedSettings.getBOOL("MainChatbarVisible"));
|
||||
}
|
||||
|
||||
//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel)
|
||||
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-0.2.2a
|
||||
void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel)
|
||||
|
|
@ -449,12 +453,13 @@ void LLNearbyChat::registerChatBar(LLNearbyChatControl* chatBar)
|
|||
}
|
||||
|
||||
// unhide the default nearby chat bar on request (pressing Enter or a letter key)
|
||||
void LLNearbyChat::showDefaultChatBar() const
|
||||
void LLNearbyChat::showDefaultChatBar(BOOL visible) const
|
||||
{
|
||||
if(!mDefaultChatBar)
|
||||
return;
|
||||
|
||||
BOOL visible=gSavedSettings.getBOOL("MainChatbarVisible");
|
||||
// change settings control to signal button state
|
||||
gSavedSettings.setBOOL("MainChatbarVisible",visible);
|
||||
|
||||
mDefaultChatBar->getParent()->setVisible(visible);
|
||||
mDefaultChatBar->setVisible(visible);
|
||||
|
|
|
|||
|
|
@ -46,9 +46,11 @@ private:
|
|||
static S32 sLastSpecialChatChannel;
|
||||
LLNearbyChatControl* mDefaultChatBar;
|
||||
|
||||
void onDefaultChatBarButtonClicked();
|
||||
|
||||
public:
|
||||
void registerChatBar(LLNearbyChatControl* chatBar);
|
||||
void showDefaultChatBar() const;
|
||||
void showDefaultChatBar(BOOL visible) const;
|
||||
|
||||
void sendChat(LLWString text,EChatType type);
|
||||
LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ void start_chat( EKeystate s )
|
|||
// start chat
|
||||
// <FS:Zi> Remove floating chat bar
|
||||
// LLNearbyChatBar::startChat(NULL);
|
||||
gSavedSettings.setBOOL("MainChatbarVisible",TRUE);
|
||||
LLNearbyChat::instance().showDefaultChatBar(TRUE);
|
||||
// </FS:Zi>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2609,7 +2609,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
|
|||
// LLNearbyChatBar::getInstance()->startChat(NULL);
|
||||
// return TRUE;
|
||||
// }
|
||||
gSavedSettings.setBOOL("MainChatbarVisible",TRUE);
|
||||
LLNearbyChat::instance().showDefaultChatBar(TRUE);
|
||||
return TRUE;
|
||||
// </FS:Zi>
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue