Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
b92ca367
Commit
b92ca367
authored
14 years ago
by
Tofu Linden
Browse files
Options
Downloads
Plain Diff
merge storm-192
parents
9b0da85a
5fac8e4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llnearbychathandler.cpp
+67
-8
67 additions, 8 deletions
indra/newview/llnearbychathandler.cpp
with
67 additions
and
8 deletions
indra/newview/llnearbychathandler.cpp
+
67
−
8
View file @
b92ca367
...
...
@@ -64,7 +64,7 @@ class LLNearbyChatScreenChannel: public LLScreenChannelBase
typedef
boost
::
function
<
LLToastPanelBase
*
(
void
)
>
create_toast_panel_callback_t
;
void
setCreatePanelCallback
(
create_toast_panel_callback_t
value
)
{
m_create_toast_panel_callback_t
=
value
;}
void
onToastDestroyed
(
LLToast
*
toast
);
void
onToastDestroyed
(
LLToast
*
toast
,
bool
app_quitting
);
void
onToastFade
(
LLToast
*
toast
);
void
reshape
(
S32
width
,
S32
height
,
BOOL
called_from_parent
);
...
...
@@ -96,6 +96,7 @@ class LLNearbyChatScreenChannel: public LLScreenChannelBase
}
protected
:
void
deactivateToast
(
LLToast
*
toast
);
void
addToToastPool
(
LLToast
*
toast
)
{
toast
->
setVisible
(
FALSE
);
...
...
@@ -116,14 +117,65 @@ class LLNearbyChatScreenChannel: public LLScreenChannelBase
bool
mStopProcessing
;
};
//-----------------------------------------------------------------------------------------------
// LLNearbyChatToast
//-----------------------------------------------------------------------------------------------
// We're deriving from LLToast to be able to override onClose()
// in order to handle closing nearby chat toasts properly.
class
LLNearbyChatToast
:
public
LLToast
{
LOG_CLASS
(
LLNearbyChatToast
);
public:
LLNearbyChatToast
(
const
LLToast
::
Params
&
p
,
LLNearbyChatScreenChannel
*
nc_channelp
)
:
LLToast
(
p
),
mNearbyChatScreenChannelp
(
nc_channelp
)
{
}
/*virtual*/
void
onClose
(
bool
app_quitting
);
private
:
LLNearbyChatScreenChannel
*
mNearbyChatScreenChannelp
;
};
//-----------------------------------------------------------------------------------------------
// LLNearbyChatScreenChannel
//-----------------------------------------------------------------------------------------------
void
LLNearbyChatScreenChannel
::
deactivateToast
(
LLToast
*
toast
)
{
std
::
vector
<
LLToast
*>::
iterator
pos
=
std
::
find
(
m_active_toasts
.
begin
(),
m_active_toasts
.
end
(),
toast
);
if
(
pos
==
m_active_toasts
.
end
())
{
llassert
(
pos
==
m_active_toasts
.
end
());
return
;
}
m_active_toasts
.
erase
(
pos
);
}
void
LLNearbyChatScreenChannel
::
createOverflowToast
(
S32
bottom
,
F32
timer
)
{
//we don't need overflow toast in nearby chat
}
void
LLNearbyChatScreenChannel
::
onToastDestroyed
(
LLToast
*
toast
)
void
LLNearbyChatScreenChannel
::
onToastDestroyed
(
LLToast
*
toast
,
bool
app_quitting
)
{
mStopProcessing
=
true
;
if
(
app_quitting
)
{
// Viewer is quitting.
// Immediately stop processing chat messages (EXT-1419).
mStopProcessing
=
true
;
}
else
{
// The toast is being closed by user (STORM-192).
// Remove it from the list of active toasts to prevent
// further references to the invalid pointer.
deactivateToast
(
toast
);
}
}
void
LLNearbyChatScreenChannel
::
onToastFade
(
LLToast
*
toast
)
...
...
@@ -132,9 +184,7 @@ void LLNearbyChatScreenChannel::onToastFade(LLToast* toast)
if
(
!
toast
)
return
;
std
::
vector
<
LLToast
*>::
iterator
pos
=
std
::
find
(
m_active_toasts
.
begin
(),
m_active_toasts
.
end
(),
toast
);
if
(
pos
!=
m_active_toasts
.
end
())
m_active_toasts
.
erase
(
pos
);
deactivateToast
(
toast
);
addToToastPool
(
toast
);
...
...
@@ -153,11 +203,10 @@ bool LLNearbyChatScreenChannel::createPoolToast()
p
.
lifetime_secs
=
gSavedSettings
.
getS32
(
"NearbyToastLifeTime"
);
p
.
fading_time_secs
=
gSavedSettings
.
getS32
(
"NearbyToastFadingTime"
);
LLToast
*
toast
=
new
LLToast
(
p
);
LLToast
*
toast
=
new
LL
NearbyChat
Toast
(
p
,
this
);
toast
->
setOnFadeCallback
(
boost
::
bind
(
&
LLNearbyChatScreenChannel
::
onToastFade
,
this
,
_1
));
toast
->
setOnToastDestroyedCallback
(
boost
::
bind
(
&
LLNearbyChatScreenChannel
::
onToastDestroyed
,
this
,
_1
));
m_toast_pool
.
push_back
(
toast
);
return
true
;
...
...
@@ -452,4 +501,14 @@ void LLNearbyChatHandler::onDeleteToast(LLToast* toast)
}
//-----------------------------------------------------------------------------------------------
// LLNearbyChatToast
//-----------------------------------------------------------------------------------------------
// virtual
void
LLNearbyChatToast
::
onClose
(
bool
app_quitting
)
{
mNearbyChatScreenChannelp
->
onToastDestroyed
(
this
,
app_quitting
);
}
// EOF
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment