Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-uwp
Commits
e46fd0d9
Commit
e46fd0d9
authored
Oct 30, 2016
by
Nicolas Jager
Browse files
internal : simplification for CallStatus in the UI
Change-Id: I00bc4c6b774818a4cd52baaa92433a80fb060b69 Tuleap: #1282
parent
d8e22fd1
Changes
6
Show whitespace changes
Inline
Side-by-side
Globals.h
View file @
e46fd0d9
...
...
@@ -3,12 +3,10 @@ namespace RingClientUWP
/* public enumerations. */
public
enum
class
CallStatus
{
NONE
,
INCOMING_RINGING
,
OUTGOING_RINGING
,
SEARCHING
,
RINGING
,
CONNECTING
,
IN_PROGRESS
,
PAUSED
,
ENDED
,
TERMINATING
};
...
...
MainPage.xaml.cpp
View file @
e46fd0d9
...
...
@@ -250,7 +250,7 @@ void RingClientUWP::MainPage::OnstateChange(Platform::String ^callId, RingClient
switch
(
state
)
{
/* send the user to the peer's message text page */
case
CallStatus
::
ENDED
:
case
CallStatus
::
NONE
:
{
if
(
item
)
OnsummonMessageTextPage
();
...
...
@@ -372,7 +372,7 @@ MainPage::BeginExtendedExecution()
sessionRevokedToken
=
(
newSession
->
Revoked
+=
ref
new
TypedEventHandler
<
Object
^
,
ExtendedExecutionRevokedEventArgs
^>
(
this
,
&
MainPage
::
SessionRevoked
));
return
create_task
(
newSession
->
RequestExtensionAsync
())
.
then
([
=
](
ExtendedExecutionResult
result
){
.
then
([
=
](
ExtendedExecutionResult
result
)
{
try
{
switch
(
result
)
{
...
...
RingD.cpp
View file @
e46fd0d9
...
...
@@ -391,7 +391,7 @@ RingClientUWP::RingD::startDaemon()
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
incomingCall
(
accountId2
,
callId2
,
from2
);
stateChange
(
callId2
,
CallStatus
::
INCOMING_
RINGING
,
0
);
stateChange
(
callId2
,
CallStatus
::
RINGING
,
0
);
auto
contact
=
ContactsViewModel
::
instance
->
findContactByName
(
from2
);
auto
item
=
SmartPanelItemsViewModel
::
instance
->
findItem
(
contact
);
...
...
@@ -413,7 +413,7 @@ RingClientUWP::RingD::startDaemon()
auto
state3
=
translateCallStatus
(
state2
);
if
(
state3
==
CallStatus
::
ENDED
)
if
(
state3
==
CallStatus
::
NONE
)
DRing
::
hangUp
(
callId
);
// solve a bug in the daemon API.
...
...
@@ -840,19 +840,13 @@ RingD::dequeueTasks()
RingClientUWP
::
CallStatus
RingClientUWP
::
RingD
::
translateCallStatus
(
String
^
state
)
{
if
(
state
==
"INCOMING"
)
return
CallStatus
::
INCOMING_
RINGING
;
return
CallStatus
::
RINGING
;
if
(
state
==
"CURRENT"
)
return
CallStatus
::
IN_PROGRESS
;
if
(
state
==
"OVER"
)
return
CallStatus
::
ENDED
;
if
(
state
==
"RINGING"
)
return
CallStatus
::
OUTGOING_RINGING
;
if
(
state
==
"CONNECTING"
)
return
CallStatus
::
SEARCHING
;
if
(
state
==
"CONNECTING"
||
state
==
"RINGING"
)
return
CallStatus
::
CONNECTING
;
return
CallStatus
::
NONE
;
...
...
SmartPanel.xaml.cpp
View file @
e46fd0d9
...
...
@@ -113,7 +113,6 @@ SmartPanel::SmartPanel()
switch
(
state
)
{
case
CallStatus
::
NONE
:
case
CallStatus
::
ENDED
:
{
item
->
_callId
=
""
;
break
;
...
...
@@ -532,7 +531,7 @@ Object ^ RingClientUWP::Views::IncomingVisibility::Convert(Object ^ value, Windo
{
auto
state
=
static_cast
<
CallStatus
>
(
value
);
if
(
state
==
CallStatus
::
INCOMING_
RINGING
)
if
(
state
==
CallStatus
::
RINGING
)
return
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
else
return
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
...
...
@@ -551,7 +550,7 @@ Object ^ RingClientUWP::Views::OutGoingVisibility::Convert(Object ^ value, Windo
{
auto
state
=
static_cast
<
CallStatus
>
(
value
);
if
(
state
==
CallStatus
::
SEARCH
ING
||
state
==
CallStatus
::
OUTGOING_
RINGING
)
if
(
state
==
CallStatus
::
CONNECT
ING
||
state
==
CallStatus
::
RINGING
)
return
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
else
return
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
...
...
@@ -569,7 +568,7 @@ Object ^ RingClientUWP::Views::HasAnActiveCall::Convert(Object ^ value, Windows:
{
auto
state
=
static_cast
<
CallStatus
>
(
value
);
if
(
state
==
CallStatus
::
NONE
||
state
==
CallStatus
::
ENDED
)
if
(
state
==
CallStatus
::
NONE
)
return
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
else
return
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
...
...
SmartPanelItem.cpp
View file @
e46fd0d9
...
...
@@ -51,6 +51,6 @@ SmartPanelItem::NotifyPropertyChanged(String^ propertyName)
void
RingClientUWP
::
Controls
::
SmartPanelItem
::
OncallPlaced
(
Platform
::
String
^
callId
)
{
if
(
_callId
==
callId
)
{
_callStatus
=
CallStatus
::
SEARCH
ING
;
_callStatus
=
CallStatus
::
CONNECT
ING
;
}
}
VideoPage.xaml.cpp
View file @
e46fd0d9
...
...
@@ -120,7 +120,7 @@ VideoPage::VideoPage()
RingD
::
instance
->
stateChange
+=
ref
new
StateChange
([
&
](
String
^
callId
,
CallStatus
state
,
int
code
)
{
if
(
state
==
CallStatus
::
ENDED
)
{
if
(
state
==
CallStatus
::
NONE
)
{
Video
::
VideoManager
::
instance
->
rendererManager
()
->
raiseClearRenderTarget
();
}
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment