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
85ce8f71
Commit
85ce8f71
authored
Apr 10, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Main/Assistant): creation in progress
parent
749e0051
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
482 additions
and
266 deletions
+482
-266
en.ts
linphone-desktop/assets/languages/en.ts
+55
-11
fr.ts
linphone-desktop/assets/languages/fr.ts
+60
-16
resources.qrc
linphone-desktop/resources.qrc
+4
-0
AssistantModel.cpp
linphone-desktop/src/components/assistant/AssistantModel.cpp
+62
-20
AssistantModel.hpp
linphone-desktop/src/components/assistant/AssistantModel.hpp
+7
-2
FormVGroupStyle.qml
...modules/Common/Styles/Form/Placements/FormVGroupStyle.qml
+1
-1
RequestBlock.qml
linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml
+5
-1
RequestBlockStyle.qml
...p/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml
+1
-0
AssistantAbstractView.qml
...top/ui/views/App/Main/Assistant/AssistantAbstractView.qml
+2
-0
AssistantCreateLinphoneSipAccount.qml
.../App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
+3
-125
AssistantCreateLinphoneSipAccountWithEmail.qml
.../Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
+115
-0
AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
...tant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
+72
-0
AssistantUseLinphoneSipAccount.qml
...ews/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
+20
-85
AssistantUseLinphoneSipAccountWithPhoneNumber.qml
...sistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
+30
-0
AssistantUseLinphoneSipAccountWithUsername.qml
.../Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
+40
-0
AssistantHomeStyle.qml
...ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml
+3
-3
bzrtp
submodules/bzrtp
+1
-1
linphone
submodules/linphone
+1
-1
No files found.
linphone-desktop/assets/languages/en.ts
View file @
85ce8f71
...
...
@@ -53,17 +53,20 @@
<
source
>
withEmailAddress
<
/source
>
<
translation
>
WITH
AN
EMAIL
ADDRESS
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantCreateLinphoneSipAccountWithEmail
<
/name
>
<
message
>
<
source
>
c
ountryLabel
<
/source
>
<
translation
>
Your
country
<
/translation
>
<
source
>
c
reateLinphoneSipAccountTitle
<
/source
>
<
translation
>
CREATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
/message
>
<
message
>
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Phone
number
<
/translation
>
<
source
>
confirmAction
<
/source
>
<
translation
>
CREATE
<
/translation
>
<
/message
>
<
message
>
<
source
>
usernameLabel
<
/source
>
<
translation
>
Username
(
optional
)
<
/translation
>
<
translation
>
Username
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailLabel
<
/source
>
...
...
@@ -78,8 +81,27 @@
<
translation
>
Password
confirmation
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
<
translation
>
CREATE
<
/translation
>
<
source
>
passwordConfirmationError
<
/source
>
<
translation
>
The
passwords
you
entered
do
not
match
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantCreateLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
createLinphoneSipAccountTitle
<
/source
>
<
translation
>
CREATE
A
LINPHONE
ACCOUNT
<
/translation
>
<
/message
>
<
message
>
<
source
>
countryLabel
<
/source
>
<
translation
>
Your
country
<
/translation
>
<
/message
>
<
message
>
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Phone
number
<
/translation
>
<
/message
>
<
message
>
<
source
>
usernameLabel
<
/source
>
<
translation
>
Username
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -166,6 +188,22 @@
<
source
>
requestFailed
<
/source
>
<
translation
>
Unable
to
send
the
request
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailStatusMalformed
<
/source
>
<
translation
>
Malformed
email
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailStatusMalformedInvalidCharacters
<
/source
>
<
translation
>
Malformed
email
or
invalid
characters
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
cannotSendSms
<
/source
>
<
translation
>
Server
error
:
Cannot
send
sms
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
accountAlreadyExists
<
/source
>
<
translation
>
Account
already
exists
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccount
<
/name
>
...
...
@@ -177,6 +215,13 @@
<
source
>
useLinphoneSipAccountTitle
<
/source
>
<
translation
>
USE
A
LINPHONE
ACCOUNT
<
/translation
>
<
/message
>
<
message
>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Use
username
and
password
rather
than
your
phone
number
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
countryLabel
<
/source
>
<
translation
>
Your
country
<
/translation
>
...
...
@@ -185,10 +230,9 @@
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Phone
number
<
/translation
>
<
/message
>
<
message
>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Use
username
and
password
rather
than
your
phone
number
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccountWithUsername
<
/name
>
<
message
>
<
source
>
usernameLabel
<
/source
>
<
translation
>
Username
<
/translation
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
85ce8f71
...
...
@@ -53,13 +53,16 @@
<
source
>
withEmailAddress
<
/source
>
<
translation
>
AVER
UNE
ADRESSE
E
-
MAIL
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantCreateLinphoneSipAccountWithEmail
<
/name
>
<
message
>
<
source
>
c
ountryLabel
<
/source
>
<
translation
>
Votre
pays
<
/translation
>
<
source
>
c
reateLinphoneSipAccountTitle
<
/source
>
<
translation
>
CR
É
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
/message
>
<
message
>
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Num
é
ro
de
t
é
l
é
phone
<
/translation
>
<
source
>
confirmAction
<
/source
>
<
translation
>
CR
É
ER
<
/translation
>
<
/message
>
<
message
>
<
source
>
usernameLabel
<
/source
>
...
...
@@ -78,8 +81,27 @@
<
translation
>
Confirmation
du
mot
de
passe
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirmAction
<
/source
>
<
translation
>
CREATE
<
/translation
>
<
source
>
passwordConfirmationError
<
/source
>
<
translation
>
Les
mots
de
passe
ne
correspondent
pas
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantCreateLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
createLinphoneSipAccountTitle
<
/source
>
<
translation
>
CR
É
ER
UN
COMPTE
LINPHONE
<
/translation
>
<
/message
>
<
message
>
<
source
>
countryLabel
<
/source
>
<
translation
>
Votre
pays
<
/translation
>
<
/message
>
<
message
>
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Num
é
ro
de
t
é
l
é
phone
<
/translation
>
<
/message
>
<
message
>
<
source
>
usernameLabel
<
/source
>
<
translation
>
Nom
d
&
apos
;
utilisateur
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -166,6 +188,22 @@
<
source
>
loginWithUsernameFailed
<
/source
>
<
translation
>
La
connection
a
é
chou
é
e
.
Merci
de
v
é
rifier
le
nom
d
&
apos
;
utilisateur
/
mot
de
passe
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailStatusMalformed
<
/source
>
<
translation
>
Adresse
malform
é
e
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
emailStatusMalformedInvalidCharacters
<
/source
>
<
translation
>
Adresse
malform
é
e
ou
caract
è
res
invalides
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
cannotSendSms
<
/source
>
<
translation
>
Erreur
serveur
:
impossible
d
&
apos
;
envoyer
un
sms
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
accountAlreadyExists
<
/source
>
<
translation
>
Le
compte
existe
d
é
j
à
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccount
<
/name
>
...
...
@@ -177,6 +215,13 @@
<
source
>
useLinphoneSipAccountTitle
<
/source
>
<
translation
>
UTILISER
UN
COMPTE
LINPHONE
<
/translation
>
<
/message
>
<
message
>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Utiliser
un
nom
et
mot
de
passe
plut
ô
t
que
votre
num
é
ro
de
t
é
l
é
phone
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccountWithPhoneNumber
<
/name
>
<
message
>
<
source
>
countryLabel
<
/source
>
<
translation
>
Votre
pays
<
/translation
>
...
...
@@ -185,10 +230,9 @@
<
source
>
phoneNumberLabel
<
/source
>
<
translation
>
Num
é
ro
de
t
é
l
é
phone
<
/translation
>
<
/message
>
<
message
>
<
source
>
useUsernameToLogin
<
/source
>
<
translation
>
Utiliser
un
nom
et
mot
de
passe
plut
ô
t
que
votre
num
é
ro
de
t
é
l
é
phone
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AssistantUseLinphoneSipAccountWithUsername
<
/name
>
<
message
>
<
source
>
usernameLabel
<
/source
>
<
translation
>
Nom
d
&
apos
;
utilisateur
<
/translation
>
...
...
@@ -283,27 +327,27 @@ Url du serveur non configurée.</translation>
<
name
>
CodecsViewer
<
/name
>
<
message
>
<
source
>
codecMime
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Nom
<
/translation
>
<
/message
>
<
message
>
<
source
>
codecEncoderDescription
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Description
<
/translation
>
<
/message
>
<
message
>
<
source
>
codecEncoderClockRate
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Fr
é
quence
(
Hz
)
<
/translation
>
<
/message
>
<
message
>
<
source
>
codecBitrate
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
D
é
bit
(
Kbit
/
s
)
<
/translation
>
<
/message
>
<
message
>
<
source
>
codecRecvFmtp
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Param
è
tres
<
/translation
>
<
/message
>
<
message
>
<
source
>
codecStatus
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
status
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
linphone-desktop/resources.qrc
View file @
85ce8f71
...
...
@@ -327,9 +327,13 @@
<file>
ui/views/App/Calls/OutgoingCall.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantAbstractView.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantFetchRemoteConfiguration.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantHome.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantUseOtherSipAccount.qml
</file>
<file>
ui/views/App/Main/Assistant.qml
</file>
<file>
ui/views/App/Main/ContactEdit.js
</file>
...
...
linphone-desktop/src/components/assistant/AssistantModel.cpp
View file @
85ce8f71
...
...
@@ -37,11 +37,22 @@ public:
m_assistant
=
assistant
;
}
// void onCreateAccount (
// const shared_ptr<linphone::AccountCreator> &creator,
// linphone::AccountCreatorStatus status,
// const string &resp
// ) override {}
void
onCreateAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
linphone
::
AccountCreatorStatus
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountCreated
)
emit
m_assistant
->
createStatusChanged
(
""
);
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
emit
m_assistant
->
createStatusChanged
(
tr
(
"requestFailed"
));
else
if
(
status
==
linphone
::
AccountCreatorStatusServerError
)
emit
m_assistant
->
createStatusChanged
(
tr
(
"cannotSendSms"
));
else
emit
m_assistant
->
createStatusChanged
(
tr
(
"accountAlreadyExists"
));
}
}
void
onIsAccountExist
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
...
...
@@ -125,29 +136,22 @@ AssistantModel::AssistantModel (QObject *parent) : QObject(parent) {
// -----------------------------------------------------------------------------
void
AssistantModel
::
set
Username
(
const
QString
&
username
)
{
void
AssistantModel
::
set
Email
(
const
QString
&
email
)
{
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
switch
(
m_account_creator
->
set
Username
(
::
Utils
::
qStringToLinphoneString
(
username
)))
{
case
linphone
:
:
AccountCreator
Username
StatusOk
:
switch
(
m_account_creator
->
set
Email
(
::
Utils
::
qStringToLinphoneString
(
email
)))
{
case
linphone
:
:
AccountCreator
Email
StatusOk
:
break
;
case
linphone
:
:
AccountCreatorUsernameStatusTooShort
:
error
=
tr
(
"usernameStatusTooShort"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_min_length"
,
1
));
break
;
case
linphone
:
:
AccountCreatorUsernameStatusTooLong
:
error
=
tr
(
"usernameStatusTooLong"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_max_length"
,
-
1
));
break
;
case
linphone
:
:
AccountCreatorUsernameStatusInvalidCharacters
:
error
=
tr
(
"usernameStatusInvalidCharacters"
)
.
arg
(
::
Utils
::
linphoneStringToQString
(
config
->
getString
(
"assistant"
,
"username_regex"
,
""
)));
case
linphone
:
:
AccountCreatorEmailStatusMalformed
:
error
=
tr
(
"emailStatusMalformed"
);
break
;
case
linphone
:
:
AccountCreator
UsernameStatusInvalid
:
error
=
tr
(
"
usernameStatusInvalid
"
);
case
linphone
:
:
AccountCreator
EmailStatusInvalidCharacters
:
error
=
tr
(
"
emailStatusMalformedInvalidCharacters
"
);
break
;
}
emit
usernameChanged
(
username
,
error
);
emit
emailChanged
(
email
,
error
);
}
void
AssistantModel
::
setPassword
(
const
QString
&
password
)
{
...
...
@@ -185,8 +189,46 @@ void AssistantModel::setPhoneNumber (const QString &phone_number) {
emit
phoneNumberChanged
(
phone_number
,
error
);
}
void
AssistantModel
::
setUsername
(
const
QString
&
username
)
{
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
switch
(
m_account_creator
->
setUsername
(
::
Utils
::
qStringToLinphoneString
(
username
)))
{
case
linphone
:
:
AccountCreatorUsernameStatusOk
:
break
;
case
linphone
:
:
AccountCreatorUsernameStatusTooShort
:
error
=
tr
(
"usernameStatusTooShort"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_min_length"
,
1
));
break
;
case
linphone
:
:
AccountCreatorUsernameStatusTooLong
:
error
=
tr
(
"usernameStatusTooLong"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_max_length"
,
-
1
));
break
;
case
linphone
:
:
AccountCreatorUsernameStatusInvalidCharacters
:
error
=
tr
(
"usernameStatusInvalidCharacters"
)
.
arg
(
::
Utils
::
linphoneStringToQString
(
config
->
getString
(
"assistant"
,
"username_regex"
,
""
)));
break
;
case
linphone
:
:
AccountCreatorUsernameStatusInvalid
:
error
=
tr
(
"usernameStatusInvalid"
);
break
;
}
emit
usernameChanged
(
username
,
error
);
}
// -----------------------------------------------------------------------------
void
AssistantModel
::
create
()
{
m_account_creator
->
createAccount
();
}
void
AssistantModel
::
login
()
{
m_account_creator
->
isAccountExist
();
}
void
AssistantModel
::
reset
()
{
m_account_creator
->
reset
();
emit
emailChanged
(
""
,
""
);
emit
passwordChanged
(
""
,
""
);
emit
phoneNumberChanged
(
""
,
""
);
emit
usernameChanged
(
""
,
""
);
}
linphone-desktop/src/components/assistant/AssistantModel.hpp
View file @
85ce8f71
...
...
@@ -36,17 +36,22 @@ class AssistantModel : public QObject {
public:
AssistantModel
(
QObject
*
parent
=
Q_NULLPTR
);
Q_INVOKABLE
void
set
Username
(
const
QString
&
username
);
Q_INVOKABLE
void
set
Email
(
const
QString
&
email
);
Q_INVOKABLE
void
setPassword
(
const
QString
&
password
);
Q_INVOKABLE
void
setPhoneNumber
(
const
QString
&
phone_number
);
Q_INVOKABLE
void
setUsername
(
const
QString
&
username
);
Q_INVOKABLE
void
create
();
Q_INVOKABLE
void
login
();
Q_INVOKABLE
void
reset
();
signals:
void
usernameChanged
(
const
QString
&
username
,
const
QString
&
error
);
void
emailChanged
(
const
QString
&
email
,
const
QString
&
error
);
void
passwordChanged
(
const
QString
&
password
,
const
QString
&
error
);
void
phoneNumberChanged
(
const
QString
&
phone_number
,
const
QString
&
error
);
void
usernameChanged
(
const
QString
&
username
,
const
QString
&
error
);
void
createStatusChanged
(
const
QString
&
error
);
void
loginStatusChanged
(
const
QString
&
error
);
private:
...
...
linphone-desktop/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml
View file @
85ce8f71
...
...
@@ -15,7 +15,7 @@ QtObject {
property
QtObject
error
:
QtObject
{
property
color
color
:
Colors
.
error
property
int
fontSize
:
10
property
int
height
:
1
6
property
int
height
:
1
1
}
property
QtObject
legend
:
QtObject
{
...
...
linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml
View file @
85ce8f71
...
...
@@ -44,13 +44,17 @@ Item {
width
:
parent
.
width
horizontalAlignment
:
Text
.
AlignHCenter
padding
:
RequestBlockStyle
.
error
.
padding
wrapMode
:
Text
.
WordWrap
visible
:
!
block
.
loading
}
BusyIndicator
{
anchors.centerIn
:
parent
anchors
{
horizontalCenter
:
parent
.
horizontalCenter
top
:
parent
.
top
}
height
:
RequestBlockStyle
.
loadingIndicator
.
height
width
:
RequestBlockStyle
.
loadingIndicator
.
width
...
...
linphone-desktop/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml
View file @
85ce8f71
...
...
@@ -11,6 +11,7 @@ QtObject {
property
QtObject
error
:
QtObject
{
property
color
color
:
Colors
.
error
property
int
fontSize
:
11
property
int
padding
:
4
}
property
QtObject
loadingIndicator
:
QtObject
{
...
...
linphone-desktop/ui/views/App/Main/Assistant/AssistantAbstractView.qml
View file @
85ce8f71
...
...
@@ -61,6 +61,8 @@ Item {
horizontalAlignment
:
Text
.
AlignHCenter
width
:
parent
.
width
visible
:
text
.
length
>
0
}
// -------------------------------------------------------------------------
...
...
linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
View file @
85ce8f71
...
...
@@ -7,133 +7,11 @@ import App.Styles 1.0
// =============================================================================
AssistantAbstractView
{
id
:
view
description
:
qsTr
(
'
createLinphoneSipAccountDescription
'
)
title
:
qsTr
(
'
createLinphoneSipAccountTitle
'
)
// ---------------------------------------------------------------------------
// Create with phone number.
// ---------------------------------------------------------------------------
Component
{
id
:
phoneNumberView
AssistantAbstractView
{
mainAction
:
(
function
()
{
console
.
log
(
'
TODO
'
)
})
mainActionEnabled
:
country
.
currentIndex
!==
-
1
&&
phoneNumber
.
text
.
length
mainActionLabel
:
qsTr
(
'
confirmAction
'
)
title
:
view
.
title
Form
{
anchors.fill
:
parent
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
countryLabel
'
)
ComboBox
{
id
:
country
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
phoneNumberLabel
'
)
TextField
{
id
:
phoneNumber
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{}
}
}
}
}
}
// ---------------------------------------------------------------------------
// Create with email address.
// ---------------------------------------------------------------------------
Component
{
id
:
emailAddressView
AssistantAbstractView
{
mainAction
:
(
function
()
{
console
.
log
(
'
TODO
'
)
})
mainActionEnabled
:
username
.
text
.
length
&&
email
.
text
.
length
&&
password
.
text
.
length
&&
passwordConfirmation
.
text
===
password
.
text
mainActionLabel
:
qsTr
(
'
confirmAction
'
)
title
:
view
.
title
Form
{
anchors.fill
:
parent
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{
id
:
username
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
emailLabel
'
)
TextField
{
id
:
email
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordLabel
'
)
TextField
{
id
:
password
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordConfirmationLabel
'
)
TextField
{
id
:
passwordConfirmation
}
}
}
}
}
}
// Menu.
// ---------------------------------------------------------------------------
Column
{
...
...
@@ -147,7 +25,7 @@ AssistantAbstractView {
height
:
AssistantCreateLinphoneSipAccountStyle
.
buttons
.
button
.
height
width
:
parent
.
width
onClicked
:
assistant
.
pushView
(
phoneNumberView
)
onClicked
:
assistant
.
pushView
(
'
AssistantCreateLinphoneSipAccountWithPhoneNumber
'
)
}
TextButtonA
{
...
...
@@ -156,7 +34,7 @@ AssistantAbstractView {
height
:
AssistantCreateLinphoneSipAccountStyle
.
buttons
.
button
.
height
width
:
parent
.
width
onClicked
:
assistant
.
pushView
(
emailAddressView
)
onClicked
:
assistant
.
pushView
(
'
AssistantCreateLinphoneSipAccountWithEmail
'
)
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
0 → 100644
View file @
85ce8f71
import
QtQuick
2.7
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
// =============================================================================
AssistantAbstractView
{
id
:
view
property
alias
emailError
:
email
.
error
property
alias
passwordError
:
password
.
error
property
alias
usernameError
:
username
.
error
title
:
qsTr
(
'
createLinphoneSipAccountTitle
'
)
mainAction
:
requestBlock
.
execute
mainActionEnabled
:
email
.
text
.
length
&&
password
.
text
.
length
&&
passwordConfirmation
.
text
===
password
.
text
&&
username
.
text
.
length
&&
!
emailError
.
length
&&
!
passwordError
.
length
&&
!
requestBlock
.
loading
&&
!
usernameError
.
length
mainActionLabel
:
qsTr
(
'
confirmAction
'
)
Column
{
anchors.fill
:
parent
Form
{
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{
id
:
username
onTextChanged
:
assistantModel
.
setUsername
(
text
)
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
emailLabel
'
)
TextField
{
id
:
email
onTextChanged
:
assistantModel
.
setEmail
(
text
)
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordLabel
'
)
TextField
{
id
:
password
onTextChanged
:
assistantModel
.
setPassword
(
text
)
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordConfirmationLabel
'
)
TextField
{
id
:
passwordConfirmation
onTextChanged
:
error
=
password
.
text
!==
text
?
qsTr
(
'
passwordConfirmationError
'
)
:
''
}
}
}
}
RequestBlock
{
id
:
requestBlock
action
:
assistantModel
.
create
width
:
parent
.
width
}
}
// ---------------------------------------------------------------------------
// Assistant.
// ---------------------------------------------------------------------------
AssistantModel
{
id
:
assistantModel
onEmailChanged
:
emailError
=
error
onPasswordChanged
:
passwordError
=
error
onUsernameChanged
:
usernameError
=
error
onCreateStatusChanged
:
{
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
// TODO.
}
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
0 → 100644
View file @
85ce8f71
import
QtQuick
2.7
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
// =============================================================================
AssistantAbstractView
{
id
:
view
property
alias
usernameError
:
username
.
error
title
:
qsTr
(
'
createLinphoneSipAccountTitle
'
)
Form
{
anchors.fill
:
parent
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
countryLabel
'
)
ComboBox
{
id
:
country
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
phoneNumberLabel
'
)
TextField
{
id
:
phoneNumber
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{
id
:
username
onTextChanged
:
assistantModel
.
setUsername
(
text
)
}
}
}
}
// ---------------------------------------------------------------------------
// Assistant.
// ---------------------------------------------------------------------------
AssistantModel
{
id
:
assistantModel
onUsernameChanged
:
usernameError
=
error
onCreateStatusChanged
:
{
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
// TODO.
}
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
View file @
85ce8f71
...
...
@@ -13,91 +13,10 @@ AssistantAbstractView {
var
item
=
loader
.
item
return
item
&&
item
.
mainActionEnabled
&&
!
requestBlock
.
loading
}
mainActionLabel
:
qsTr
(
'
confirmAction
'
)
title
:
qsTr
(
'
useLinphoneSipAccountTitle
'
)
// ---------------------------------------------------------------------------
// Login with phone number.
// ---------------------------------------------------------------------------
Component
{
id
:
phoneNumberForm
Form
{
property
bool
mainActionEnabled
:
country
.
currentIndex
!==
-
1
&&
phoneNumber
.
text
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
countryLabel
'
)
ComboBox
{
id
:
country
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
phoneNumberLabel
'
)
TextField
{
id
:
phoneNumber
}
}
}
}
}
// ---------------------------------------------------------------------------
// Login with email address.
// ---------------------------------------------------------------------------
Component
{
id
:
emailAddressForm
Form
{
property
bool
mainActionEnabled
:
username
.
length
&&
password
.
text
&&
!
usernameError
.
length
&&
!
passwordError
.
length
property
alias
usernameError
:
username
.
error
property
alias
passwordError
:
password
.
error
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{
id
:
username
onTextChanged
:
assistantModel
.
setUsername
(
text
)
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordLabel
'
)
TextField
{
id
:
password
onTextChanged
:
assistantModel
.
setPassword
(
text
)
}
}
}
}
}
// ---------------------------------------------------------------------------
Column
{
...
...
@@ -106,7 +25,9 @@ AssistantAbstractView {
Loader
{
id
:
loader
sourceComponent
:
checkBox
.
checked
?
emailAddressForm
:
phoneNumberForm
source
:
'
AssistantUseLinphoneSipAccountWith
'
+
(
checkBox
.
checked
?
'
Username
'
:
'
PhoneNumber
'
)
+
'
.qml
'
width
:
parent
.
width
}
...
...
@@ -116,7 +37,10 @@ AssistantAbstractView {
text
:
qsTr
(
'
useUsernameToLogin
'
)
width
:
AssistantUseLinphoneSipAccountStyle
.
checkBox
.
width
onClicked
:
requestBlock
.
stop
(
''
)
onClicked
:
{
assistantModel
.
reset
()
requestBlock
.
stop
(
''
)
}
}
RequestBlock
{
...
...
@@ -127,13 +51,24 @@ AssistantAbstractView {
}
}
// ---------------------------------------------------------------------------
// Assistant.
// ---------------------------------------------------------------------------
AssistantModel
{
id
:
assistantModel
onUsernameChanged
:
loader
.
item
.
usernameError
=
error
onPasswordChanged
:
loader
.
item
.
passwordError
=
error
onPasswordChanged
:
{
if
(
checkBox
.
checked
)
{
loader
.
item
.
passwordError
=
error
}
}
onUsernameChanged
:
{
if
(
checkBox
.
checked
)
{
loader
.
item
.
usernameError
=
error
}
}
onLoginStatusChanged
:
{
requestBlock
.
stop
(
error
)
...
...
linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
0 → 100644
View file @
85ce8f71
import
Common
1.0
// =============================================================================
Form
{
property
bool
mainActionEnabled
:
country
.
currentIndex
!==
-
1
&&
phoneNumber
.
text
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
countryLabel
'
)
ComboBox
{
id
:
country
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
phoneNumberLabel
'
)
TextField
{
id
:
phoneNumber
}
}
}
}
linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
0 → 100644
View file @
85ce8f71
import
Common
1.0
// =============================================================================
Form
{
property
alias
passwordError
:
password
.
error
property
alias
usernameError
:
username
.
error
property
bool
mainActionEnabled
:
password
.
text
&&
username
.
length
&&
!
passwordError
.
length
&&
!
usernameError
.
length
dealWithErrors
:
true
orientation
:
Qt
.
Vertical
FormLine
{
FormGroup
{
label
:
qsTr
(
'
usernameLabel
'
)
TextField
{
id
:
username
onTextChanged
:
assistantModel
.
setUsername
(
text
)
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordLabel
'
)
TextField
{
id
:
password
onTextChanged
:
assistantModel
.
setPassword
(
text
)
}
}
}
}
linphone-desktop/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml
View file @
85ce8f71
...
...
@@ -12,20 +12,20 @@ QtObject {
property
QtObject
description
:
QtObject
{
property
color
color
:
Colors
.
g
property
int
height
:
40
property
int
fontSize
:
10
property
int
height
:
40
}
property
QtObject
title
:
QtObject
{
property
color
color
:
Colors
.
g
property
int
height
:
40
property
int
fontSize
:
11
property
int
height
:
40
}
}
property
QtObject
buttons
:
QtObject
{
property
int
maxWidth
:
690
property
int
height
:
90
property
int
maxWidth
:
690
property
int
spacing
:
5
}
}
bzrtp
@
1d092f58
Subproject commit
b5b5e00d49e000a84e69c473eb9cea7fdf5cab35
Subproject commit
1d092f58ec8e04c617e2288577cbedfab7bf9e6a
linphone
@
a3fbb53b
Subproject commit
b1ec18f963eca39cd8f4f8cac379b3c9598297e4
Subproject commit
a3fbb53b246b53f5c19a5a8a6a0b9f7947e9d970
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