Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
3633ee50
Commit
3633ee50
authored
Jun 02, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/assistant): deal correctly with phone numbers
parent
a9607f6a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
128 additions
and
38 deletions
+128
-38
en.ts
linphone-desktop/assets/languages/en.ts
+11
-3
fr.ts
linphone-desktop/assets/languages/fr.ts
+11
-3
AssistantModel.cpp
linphone-desktop/src/components/assistant/AssistantModel.cpp
+29
-4
AssistantModel.hpp
linphone-desktop/src/components/assistant/AssistantModel.hpp
+1
-0
CreateLinphoneSipAccountWithEmail.qml
.../App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml
+10
-13
CreateLinphoneSipAccountWithPhoneNumber.qml
...ain/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml
+10
-13
UseLinphoneSipAccount.qml
...top/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml
+34
-0
UseLinphoneSipAccountWithPhoneNumber.qml
...p/Main/Assistant/UseLinphoneSipAccountWithPhoneNumber.qml
+21
-1
ortp
submodules/ortp
+1
-1
No files found.
linphone-desktop/assets/languages/en.ts
View file @
3633ee50
...
...
@@ -12,7 +12,7 @@
<
name
>
ActivateLinphoneSipAccountWithEmail
<
/name
>
<
message
>
<
source
>
activateLinphoneSipAccount
<
/source
>
<
translation
>
CRE
ATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
translation
>
ACTIV
ATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
...
...
@@ -27,7 +27,7 @@
<
name
>
ActivateLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
activateLinphoneSipAccount
<
/source
>
<
translation
>
CRE
ATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
translation
>
ACTIV
ATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
...
...
@@ -159,7 +159,7 @@
<
/message
>
<
message
>
<
source
>
smsActivationFailed
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
SMS
activation
failed
!
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailActivationFailed
<
/source
>
...
...
@@ -181,6 +181,10 @@
<
source
>
phoneNumberStatusInvalidCountryCode
<
/source
>
<
translation
>
Invalid
country
code
!<
/translation
>
<
/message
>
<
message
>
<
source
>
loginWithPhoneNumberFailed
<
/source
>
<
translation
>
Login
failed
.
Please
check
your
phone
number
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AuthenticationRequest
<
/name
>
...
...
@@ -1341,6 +1345,10 @@ your friend's SIP address or username.</translation>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Use
username
and
password
rather
than
your
phone
number
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
quitWarning
<
/source
>
<
translation
>
Your
account
has
been
created
but
is
not
yet
validated
.
Are
you
sure
you
want
to
quit
this
view
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
UseLinphoneSipAccountWithPhoneNumber
<
/name
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
3633ee50
...
...
@@ -12,7 +12,7 @@
<
name
>
ActivateLinphoneSipAccountWithEmail
<
/name
>
<
message
>
<
source
>
activateLinphoneSipAccount
<
/source
>
<
translation
>
CR
É
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
translation
>
ACTIV
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
...
...
@@ -27,7 +27,7 @@
<
name
>
ActivateLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
activateLinphoneSipAccount
<
/source
>
<
translation
>
CR
É
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
translation
>
ACTIV
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
...
...
@@ -159,7 +159,7 @@
<
/message
>
<
message
>
<
source
>
smsActivationFailed
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
L
&
apos
;
activation
par
SMS
a
é
chou
é
!
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailActivationFailed
<
/source
>
...
...
@@ -181,6 +181,10 @@
<
source
>
phoneNumberStatusInvalidCountryCode
<
/source
>
<
translation
>
Indicatif
t
é
l
.
invalide
!<
/translation
>
<
/message
>
<
message
>
<
source
>
loginWithPhoneNumberFailed
<
/source
>
<
translation
>
La
connection
a
é
chou
é
e
.
Merci
de
v
é
rifier
votre
num
é
ro
de
t
é
l
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AuthenticationRequest
<
/name
>
...
...
@@ -1340,6 +1344,10 @@ un chat ou ajouter un contact.</translation>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Utiliser
un
nom
et
mot
de
passe
plut
ô
t
que
votre
num
é
ro
de
t
é
l
é
phone
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
quitWarning
<
/source
>
<
translation
>
Votre
compte
a
é
t
é
cr
é
e
mais
il
n
&
apos
;
a
pas
é
t
é
valid
é
.
Ê
tes
-
vous
s
û
r
de
vouloir
quitter
cette
vue
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
UseLinphoneSipAccountWithPhoneNumber
<
/name
>
...
...
linphone-desktop/src/components/assistant/AssistantModel.cpp
View file @
3633ee50
...
...
@@ -75,16 +75,21 @@ private:
}
void
onActivateAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
linphone
::
AccountCreatorStatus
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountActivated
||
status
==
linphone
::
AccountCreatorStatusAccountAlreadyActivated
)
)
{
if
(
creator
->
getEmail
().
empty
())
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_ASSERT
(
proxyConfig
!=
nullptr
);
}
emit
mAssistant
->
activateStatusChanged
(
""
);
else
{
}
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
emit
mAssistant
->
activateStatusChanged
(
tr
(
"requestFailed"
));
else
...
...
@@ -110,6 +115,23 @@ private:
}
}
void
onRecoverAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
linphone
::
AccountCreatorStatus
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestOk
)
{
emit
mAssistant
->
recoverStatusChanged
(
""
);
}
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"requestFailed"
));
else
if
(
status
==
linphone
::
AccountCreatorStatusServerError
)
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"cannotSendSms"
));
else
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"loginWithPhoneNumberFailed"
));
}
}
private:
AssistantModel
*
mAssistant
;
};
...
...
@@ -140,7 +162,10 @@ void AssistantModel::create () {
}
void
AssistantModel
::
login
()
{
mAccountCreator
->
isAccountExist
();
if
(
mAccountCreator
->
getEmail
().
empty
())
mAccountCreator
->
recoverAccount
();
else
mAccountCreator
->
isAccountExist
();
}
void
AssistantModel
::
reset
()
{
...
...
linphone-desktop/src/components/assistant/AssistantModel.hpp
View file @
3633ee50
...
...
@@ -63,6 +63,7 @@ signals:
void
activateStatusChanged
(
const
QString
&
error
);
void
createStatusChanged
(
const
QString
&
error
);
void
loginStatusChanged
(
const
QString
&
error
);
void
recoverStatusChanged
(
const
QString
&
error
);
void
configFilenameChanged
(
const
QString
&
configFilename
);
...
...
linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml
View file @
3633ee50
...
...
@@ -97,13 +97,7 @@ AssistantAbstractView {
RequestBlock
{
id
:
requestBlock
action
:
function
()
{
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistantModel
.
create
()
}
action
:
assistantModel
.
create
width
:
parent
.
width
}
}
...
...
@@ -123,13 +117,16 @@ AssistantAbstractView {
onCreateStatusChanged
:
{
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithEmail
'
,
{
assistantModel
:
assistantModel
})
}
else
{
window
.
unlockView
()
if
(
error
.
length
)
{
return
}
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithEmail
'
,
{
assistantModel
:
assistantModel
})
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml
View file @
3633ee50
...
...
@@ -96,13 +96,7 @@ AssistantAbstractView {
RequestBlock
{
id
:
requestBlock
action
:
function
()
{
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistantModel
.
create
()
}
action
:
assistantModel
.
create
width
:
parent
.
width
}
}
...
...
@@ -123,13 +117,16 @@ AssistantAbstractView {
onCreateStatusChanged
:
{
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithPhoneNumber
'
,
{
assistantModel
:
assistantModel
})
}
else
{
window
.
unlockView
()
if
(
error
.
length
)
{
return
}
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithPhoneNumber
'
,
{
assistantModel
:
assistantModel
})
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml
View file @
3633ee50
...
...
@@ -58,14 +58,27 @@ AssistantAbstractView {
AssistantModel
{
id
:
assistantModel
function
setCountryCode
(
index
)
{
var
model
=
telephoneNumbersModel
assistantModel
.
countryCode
=
model
.
data
(
model
.
index
(
index
,
0
)).
countryCode
}
configFilename
:
'
use-linphone-sip-account.rc
'
countryCode
:
setCountryCode
(
telephoneNumbersModel
.
defaultIndex
)
onPasswordChanged
:
{
if
(
checkBox
.
checked
)
{
loader
.
item
.
passwordError
=
error
}
}
onPhoneNumberChanged
:
{
if
(
!
checkBox
.
checked
)
{
loader
.
item
.
phoneNumberError
=
error
}
}
onUsernameChanged
:
{
if
(
checkBox
.
checked
)
{
loader
.
item
.
usernameError
=
error
...
...
@@ -78,5 +91,26 @@ AssistantAbstractView {
window
.
setView
(
'
Home
'
)
}
}
onRecoverStatusChanged
:
{
if
(
checkBox
.
checked
)
{
requestBlock
.
stop
(
''
)
return
}
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithPhoneNumber
'
,
{
assistantModel
:
assistantModel
})
}
}
}
TelephoneNumbersModel
{
id
:
telephoneNumbersModel
}
}
linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccountWithPhoneNumber.qml
View file @
3633ee50
import
Common
1.0
import
Linphone
1.0
// =============================================================================
Form
{
property
bool
mainActionEnabled
:
country
.
currentIndex
!==
-
1
&&
phoneNumber
.
text
property
alias
phoneNumberError
:
phoneNumber
.
error
property
bool
mainActionEnabled
:
phoneNumber
.
text
.
length
&&
!
phoneNumberError
.
length
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
...
...
@@ -14,6 +18,18 @@ Form {
ComboBox
{
id
:
country
currentIndex
:
model
.
defaultIndex
model
:
telephoneNumbersModel
textRole
:
'
countryName
'
onActivated
:
{
assistantModel
.
setCountryCode
(
index
)
var
text
=
phoneNumber
.
text
if
(
text
.
length
>
0
)
{
assistantModel
.
phoneNumber
=
text
}
}
}
}
}
...
...
@@ -24,6 +40,10 @@ Form {
TextField
{
id
:
phoneNumber
inputMethodHints
:
Qt
.
ImhDialableCharactersOnly
onTextChanged
:
assistantModel
.
phoneNumber
=
text
}
}
}
...
...
ortp
@
bd792338
Subproject commit
4b0eb84c8e738a606cfd5da35d2a673853b4b13a
Subproject commit
bd792338c47c3849cce3661d4e693df0177873c0
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