In-Group feature request: Ability to have chats torn off, by default.

Best viewed without space changes... or maybe it doesn't matter any more.
Debug setting OtherChatsTornOff added.
Added Open new IMs in separate floaters checkbox to  Adv. Chat.
Moved Show group name in chat to the right column on top of Adv. Chat panel.

So how's this work?
Two ways.. 1. The user opens a chat; 2. A chat is started from another party to the user.
In 1, we open the chat in a separate floater and focus the floater.
In 2, we check if there is a floater currently in focus before opening the chat
if so, we minimize the floater, setting focus back to whatever floater the user was focused on;
if not, we leave the new chat floater open and focused.

Note that this will NOT alter the default behavior at all, we can't be having that.
This commit is contained in:
Lirusaito
2012-12-31 17:06:30 -05:00
parent ba57bb1396
commit 4ec6f853d8
7 changed files with 60 additions and 6 deletions

View File

@@ -749,6 +749,17 @@ Found in Advanced->Rendering->Info Displays</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>OtherChatsTornOff</key>
<map>
<key>Comment</key>
<string>When true, chats other than local chat open torn off of the Communicate window.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>MarketImporterUpdateFreq</key>
<map>
<key>Comment</key>

View File

@@ -336,6 +336,7 @@ void LLPrefsAscentChat::refreshValues()
mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects");
mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs");
mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog");
mOtherChatsTornOff = gSavedSettings.getBOOL("OtherChatsTornOff");
std::string format = gSavedSettings.getString("ShortTimeFormat");
if (format.find("%p") == -1)
@@ -542,6 +543,7 @@ void LLPrefsAscentChat::cancel()
gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects);
gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs);
gSavedSettings.setBOOL("SecondsInLog", mSecondsInLog);
gSavedSettings.setBOOL("OtherChatsTornOff", mOtherChatsTornOff);
std::string short_date, long_date, short_time, long_time, timestamp;

View File

@@ -77,6 +77,7 @@ protected:
U32 tempDateFormat;
BOOL mSecondsInChatAndIMs;
BOOL mSecondsInLog;
BOOL mOtherChatsTornOff;
BOOL mIMResponseAnyone;
BOOL mIMResponseFriends;

View File

@@ -855,6 +855,8 @@ void LLPanelFriends::onClickIM(void* user_data)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if(!tear_off) gIMMgr->setFloaterOpen(TRUE);
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
@@ -862,13 +864,11 @@ void LLPanelFriends::onClickIM(void* user_data)
std::string fullname;
if(info && gCacheName->getFullName(agent_id, fullname))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id);
}
}
else
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
make_ui_sound("UISndStartIM");

View File

@@ -386,7 +386,9 @@ void LLPanelGroups::startIM()
LLGroupData group_data;
if (gAgent.getGroupData(group_id, group_data))
{
gIMMgr->setFloaterOpen(TRUE);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (!tear_off)
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(
group_data.mName,
IM_SESSION_GROUP_START,

View File

@@ -747,7 +747,18 @@ LLUUID LLIMMgr::addSession(
{
noteMutedUsers(floater, ids);
}
LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if(tear_off)
{
// removal sets up relationship for re-attach
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater);
// reparent to floater view
gFloaterView->addChild(floater);
gFloaterView->bringToFront(floater);
}
else
LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
}
else
{
@@ -1119,6 +1130,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (tear_off)
{
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
gFloaterView->addChild(floater); // reparent to floater view
LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
floater->open(); // make the new chat floater appear
if (focused_floater != NULL) // there was a focused floater
{
floater->setMinimized(true); // so minimize this one, for now
focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
}
}
mFloaters.insert(floater->getHandle());
return floater;
}
@@ -1145,6 +1169,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (tear_off)
{
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
gFloaterView->addChild(floater); // reparent to floater view
LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
floater->open(); // make the new chat floater appear
if (focused_floater != NULL) // there was a focused floater
{
floater->setMinimized(true); // so minimize this one, for now
focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
}
}
mFloaters.insert(floater->getHandle());
return floater;
}

View File

@@ -6,12 +6,11 @@
<text bottom="-15" left="15" name="objects_link_text_box">IMs:</text>
<check_box bottom_delta="-25" left="10" follows="top" initial_value="false" control_name="WoLfVerticalIMTabs"
label="Use Vertical IMs (Requires a restart)" name="use_vertical_ims_check"/>
<check_box bottom_delta="-20" follows="top" control_name="OtherChatsTornOff" label="Open new IMs in separate floaters" name="chats_torn_off"/>
<check_box bottom_delta="-20" follows="left|top" initial_value="false" control_name="AscentInstantMessageAnnounceIncoming"
label="Announce incoming instant messages" tool_tip="Opens an IM window when someone starts typing an IM to you. This gives you a heads up that someone is IMing you before they hit enter." name="quickstart_im_check"/>
<check_box bottom_delta="-20" follows="left|top" control_name="AscentHideTypingNotification" initial_value="false"
label="Don't send '[name] is typing...' in IMs" tool_tip="IM partners will not see '______ is typing...' when you're responding." name="hide_typing_check"/>
<check_box bottom_delta="-20" follows="left|top" control_name="OptionShowGroupNameInChatIM" initial_value="false"
label="Show group name in chat" tool_tip="The name of the group will also be displayed if the IM is from group chat." name="append_group_name_check"/>
<!-- Left/Right Column split
<view_border bevel_style="none" border_thickness="1" bottom_delta="0" follows="top|left" height="75"
left="235" name="CmdDivisor" width="0"/>
@@ -21,6 +20,8 @@
label="Play the typing sound for local chat" tool_tip="Silences the chatting type sound, making it quieter for things like performances." name="play_typing_sound_check"/>
<check_box bottom_delta="-20" follows="left|top" control_name="HideNotificationsInChat" initial_value="false"
label="Do not echo/log notifications in chat" name="hide_notifications_in_chat_check"/>
<check_box bottom_delta="-20" follows="left|top" control_name="OptionShowGroupNameInChatIM" initial_value="false"
label="Show group name in chat" tool_tip="The name of the group will also be displayed if the IM is from group chat." name="append_group_name_check"/>
<check_box bottom="-120" left="10" control_name="AscentAllowMUpose" initial_value="false"
label="Allow MU pose method." tool_tip="Allows the use of both /me and : to perform emotes." name="allow_mu_pose_check"/>
<check_box bottom_delta="-20" follows="left|top" control_name="AscentAutoCloseOOC"