Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-client-uwp
Commits
e46fd0d9
Commit
e46fd0d9
authored
Oct 30, 2016
by
Nicolas Jager
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal : simplification for CallStatus in the UI
Change-Id: I00bc4c6b774818a4cd52baaa92433a80fb060b69 Tuleap: #1282
parent
d8e22fd1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
27 deletions
+18
-27
Globals.h
Globals.h
+2
-4
MainPage.xaml.cpp
MainPage.xaml.cpp
+6
-6
RingD.cpp
RingD.cpp
+5
-11
SmartPanel.xaml.cpp
SmartPanel.xaml.cpp
+3
-4
SmartPanelItem.cpp
SmartPanelItem.cpp
+1
-1
VideoPage.xaml.cpp
VideoPage.xaml.cpp
+1
-1
No files found.
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
...
...
@@ -76,11 +76,11 @@ MainPage::MainPage()
Platform
::
Object
^>
(
this
,
&
MainPage
::
DisplayProperties_DpiChanged
));
visibilityChangedEventToken
=
Window
::
Current
->
VisibilityChanged
+=
ref
new
WindowVisibilityChangedEventHandler
(
this
,
&
MainPage
::
Application_VisibilityChanged
);
ref
new
WindowVisibilityChangedEventHandler
(
this
,
&
MainPage
::
Application_VisibilityChanged
);
applicationSuspendingEventToken
=
Application
::
Current
->
Suspending
+=
ref
new
SuspendingEventHandler
(
this
,
&
MainPage
::
Application_Suspending
);
ref
new
SuspendingEventHandler
(
this
,
&
MainPage
::
Application_Suspending
);
applicationResumingEventToken
=
Application
::
Current
->
Resuming
+=
ref
new
EventHandler
<
Object
^>
(
this
,
&
MainPage
::
Application_Resuming
);
ref
new
EventHandler
<
Object
^>
(
this
,
&
MainPage
::
Application_Resuming
);
}
void
...
...
@@ -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
();
...
...
@@ -370,9 +370,9 @@ MainPage::BeginExtendedExecution()
newSession
->
Reason
=
ExtendedExecutionReason
::
SavingData
;
newSession
->
Description
=
"Extended Execution"
;
sessionRevokedToken
=
(
newSession
->
Revoked
+=
ref
new
TypedEventHandler
<
Object
^
,
ExtendedExecutionRevokedEventArgs
^>
(
this
,
&
MainPage
::
SessionRevoked
));
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
Markdown
is supported
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