FIRE-2177 Make Autorespond, Away, Busy a check in menu again in stead of changing labels

Selo 2012-02-26 22:54:59 +01:00
parent c26a5156eb
commit a5dc32107c
3 changed files with 113 additions and 54 deletions

View File

@ -1328,10 +1328,11 @@ void LLAgent::setAFK()
setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP);
LL_INFOS("AFK") << "Setting Away" << LL_ENDL;
gAwayTimer.start();
if (gAFKMenu)
{
gAFKMenu->setLabel(LLTrans::getString("AvatarSetNotAway"));
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gAFKMenu)
//{
// gAFKMenu->setLabel(LLTrans::getString("AvatarSetNotAway"));
//}
// <AO> Gsit on away, antigrief protection
if (gSavedSettings.getBOOL("AvatarSitOnAway") == TRUE)
@ -1359,10 +1360,11 @@ void LLAgent::clearAFK()
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP);
clearControlFlags(AGENT_CONTROL_AWAY);
LL_INFOS("AFK") << "Clearing Away" << LL_ENDL;
if (gAFKMenu)
{
gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway"));
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gAFKMenu)
//{
// gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway"));
//}
// <AO> if we sat while away, stand back up on clear
if (gSavedSettings.getBOOL("AvatarSitOnAway") == TRUE)
@ -1390,10 +1392,11 @@ void LLAgent::setBusy()
{
sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_START);
mIsBusy = TRUE;
if (gBusyMenu)
{
gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy"));
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gBusyMenu)
//{
// gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy"));
//}
LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(true);
}
@ -1404,10 +1407,11 @@ void LLAgent::clearBusy()
{
mIsBusy = FALSE;
sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP);
if (gBusyMenu)
{
gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy"));
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gBusyMenu)
//{
// gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy"));
//}
LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(false);
}
@ -1443,17 +1447,18 @@ void LLAgent::selectAutorespond(BOOL selected)
llinfos << "Setting autorespond mode to " << selected << llendl;
mIsAutorespond = selected;
gSavedPerAccountSettings.setBOOL("FSAutorespondMode",selected);
if (gAutorespondMenu)
{
if (selected)
{
gAutorespondMenu->setLabel(LLTrans::getString("AvatarSetNotAutorespond"));
}
else
{
gAutorespondMenu->setLabel(LLTrans::getString("AvatarSetAutorespond"));
}
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gAutorespondMenu)
//{
// if (selected)
// {
// gAutorespondMenu->setLabel(LLTrans::getString("AvatarSetNotAutorespond"));
// }
// else
// {
// gAutorespondMenu->setLabel(LLTrans::getString("AvatarSetAutorespond"));
// }
//}
}
//-----------------------------------------------------------------------------
@ -1488,17 +1493,18 @@ void LLAgent::selectAutorespondNonFriends(BOOL selected)
llinfos << "Setting autorespond non-friends mode to " << selected << llendl;
mIsAutorespondNonFriends = selected;
gSavedPerAccountSettings.setBOOL("FSAutorespondNonFriendsMode",selected);
if (gAutorespondNonFriendsMenu)
{
if (selected)
{
gAutorespondNonFriendsMenu->setLabel(LLTrans::getString("AvatarSetNotAutorespondNonFriends"));
}
else
{
gAutorespondNonFriendsMenu->setLabel(LLTrans::getString("AvatarSetAutorespondNonFriends"));
}
}
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
//if (gAutorespondNonFriendsMenu)
//{
// if (selected)
// {
// gAutorespondNonFriendsMenu->setLabel(LLTrans::getString("AvatarSetNotAutorespondNonFriends"));
// }
// else
// {
// gAutorespondNonFriendsMenu->setLabel(LLTrans::getString("AvatarSetAutorespondNonFriends"));
// }
//}
}
//-----------------------------------------------------------------------------

View File

@ -6168,6 +6168,15 @@ class LLWorldSetAway : public view_listener_t
return true;
}
};
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
class LLWorldGetAway : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = gAgent.getAFK();
return new_value;
}
};
class LLWorldSetBusy : public view_listener_t
{
@ -6186,6 +6195,16 @@ class LLWorldSetBusy : public view_listener_t
}
};
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
class LLWorldGetBusy : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = gAgent.getBusy();
return new_value;
}
};
class LLWorldSetAutorespond : public view_listener_t
{
@ -6204,6 +6223,17 @@ class LLWorldSetAutorespond : public view_listener_t
}
};
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
class LLWorldGetAutorespond : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = gAgent.getAutorespond();
return new_value;
}
};
class LLWorldSetAutorespondNonFriends : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -6221,6 +6251,16 @@ class LLWorldSetAutorespondNonFriends : public view_listener_t
}
};
// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity]
class LLWorldGetAutorespondNonFriends : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = gAgent.getAutorespondNonFriends();
return new_value;
}
};
class LLWorldCreateLandmark : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -9342,9 +9382,13 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldSetHomeLocation(), "World.SetHomeLocation");
view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome");
view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway");
view_listener_t::addMenu(new LLWorldGetAway(), "World.GetAway"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldSetBusy(), "World.SetBusy");
view_listener_t::addMenu(new LLWorldGetBusy(), "World.GetBusy"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldSetAutorespond(), "World.SetAutorespond");
view_listener_t::addMenu(new LLWorldGetAutorespond(), "World.GetAutorespond"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldSetAutorespondNonFriends(), "World.SetAutorespondNonFriends");
view_listener_t::addMenu(new LLWorldGetAutorespondNonFriends(), "World.GetAutorespondNonFriends"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark");
view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation");

View File

@ -369,30 +369,39 @@
label="Online Status"
name="Status"
tear_off="true">
<menu_item_call
label="Away"
<menu_item_check
label="Away"
name="Set Away">
<menu_item_call.on_click
<menu_item_check.on_check
function="World.GetAway" />
<menu_item_check.on_click
function="World.SetAway" />
</menu_item_call>
<menu_item_call
</menu_item_check>
<menu_item_check
label="Autorespond"
name="Set Autorespond">
<menu_item_call.on_click
<menu_item_check.on_check
function="World.GetAutorespond"/>
<menu_item_check.on_click
function="World.SetAutorespond"/>
</menu_item_call>
<menu_item_call
</menu_item_check>
<menu_item_check
label="Autorespond to non-friends"
name="Set Autorespond to non-friends">
<menu_item_call.on_click
<menu_item_check.on_check
function="World.GetAutorespondNonFriends"/>
<menu_item_check.on_click
function="World.SetAutorespondNonFriends"/>
</menu_item_call>
<menu_item_call
label="Unavailable"
name="Set Busy">
<menu_item_call.on_click
function="World.SetBusy"/>
</menu_item_call>
</menu_item_check>
<menu_item_check
label="Unavailable"
name="Set Busy">
<menu_item_check.on_check
function="World.GetBusy"/>
<menu_item_check.on_click
function="World.SetBusy"/>
</menu_item_check>
</menu>
<menu_item_separator/>