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
71b04c5e
Commit
71b04c5e
authored
Apr 12, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/assistant): lock view on account validation
parent
c5a719f4
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
62 additions
and
27 deletions
+62
-27
en.ts
linphone-desktop/assets/languages/en.ts
+4
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+4
-0
App.cpp
linphone-desktop/src/app/App.cpp
+1
-1
AssistantModel.cpp
linphone-desktop/src/components/assistant/AssistantModel.cpp
+5
-3
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+1
-0
CoreManager.hpp
linphone-desktop/src/components/core/CoreManager.hpp
+6
-0
AccountSettingsModel.cpp
...-desktop/src/components/settings/AccountSettingsModel.cpp
+26
-19
AccountSettingsModel.hpp
...-desktop/src/components/settings/AccountSettingsModel.hpp
+2
-0
DialogStyle.qml
...e-desktop/ui/modules/Common/Styles/Dialog/DialogStyle.qml
+3
-3
ActivateLinphoneSipAccountWithEmail.qml
...pp/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml
+1
-0
CreateLinphoneSipAccountWithEmail.qml
.../App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml
+9
-1
No files found.
linphone-desktop/assets/languages/en.ts
View file @
71b04c5e
...
...
@@ -398,6 +398,10 @@ Server url not configured.</translation>
<
source
>
passwordConfirmationError
<
/source
>
<
translation
>
The
passwords
you
entered
do
not
match
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
quitWarning
<
/source
>
<
translation
>
Your
account
has
been
created
but
is
not
yet
validated
.
If
you
quit
this
view
,
you
should
add
manually
your
account
and
validate
it
within
24
hours
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
CreateLinphoneSipAccountWithPhoneNumber
<
/name
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
71b04c5e
...
...
@@ -398,6 +398,10 @@ Url du serveur non configurée.</translation>
<
source
>
passwordConfirmationError
<
/source
>
<
translation
>
Les
mots
de
passe
ne
correspondent
pas
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
quitWarning
<
/source
>
<
translation
>
Votre
compte
a
é
t
é
cr
é
e
mais
il
n
&
apos
;
a
pas
é
t
é
valid
é
.
Si
vous
quittez
cette
vue
,
vous
devrez
ajouter
manuellement
votre
compte
et
le
valider
dans
les
24
heures
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
CreateLinphoneSipAccountWithPhoneNumber
<
/name
>
...
...
linphone-desktop/src/app/App.cpp
View file @
71b04c5e
...
...
@@ -281,7 +281,6 @@ void App::registerTypes () {
"Linphone"
,
1
,
0
,
"VcardModel"
,
"VcardModel is uncreatable."
);
registerSingletonType
<
AccountSettingsModel
>
(
"AccountSettingsModel"
);
registerSingletonType
<
AudioCodecsModel
>
(
"AudioCodecsModel"
);
registerSingletonType
<
OwnPresenceModel
>
(
"OwnPresenceModel"
);
registerSingletonType
<
Presence
>
(
"Presence"
);
...
...
@@ -291,6 +290,7 @@ void App::registerTypes () {
registerSharedSingletonType
(
App
,
"App"
,
App
::
getInstance
);
registerSharedSingletonType
(
CoreManager
,
"CoreManager"
,
CoreManager
::
getInstance
);
registerSharedSingletonType
(
SettingsModel
,
"SettingsModel"
,
CoreManager
::
getInstance
()
->
getSettingsModel
);
registerSharedSingletonType
(
AccountSettingsModel
,
"AccountSettingsModel"
,
CoreManager
::
getInstance
()
->
getAccountSettingsModel
);
registerSharedSingletonType
(
SipAddressesModel
,
"SipAddressesModel"
,
CoreManager
::
getInstance
()
->
getSipAddressesModel
);
registerSharedSingletonType
(
CallsListModel
,
"CallsListModel"
,
CoreManager
::
getInstance
()
->
getCallsListModel
);
registerSharedSingletonType
(
ContactsListModel
,
"ContactsListModel"
,
CoreManager
::
getInstance
()
->
getContactsListModel
);
...
...
linphone-desktop/src/components/assistant/AssistantModel.cpp
View file @
71b04c5e
...
...
@@ -89,13 +89,15 @@ public:
}
void
onIsAccountActivated
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
linphone
::
AccountCreatorStatus
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountActivated
)
if
(
status
==
linphone
::
AccountCreatorStatusAccountActivated
)
{
CoreManager
::
getInstance
()
->
getAccountSettingsModel
()
->
addOrUpdateProxyConfig
(
creator
->
configure
());
emit
m_assistant
->
activateStatusChanged
(
""
);
else
{
}
else
{
if
(
status
==
linphone
::
AccountCreatorStatusRequestFailed
)
emit
m_assistant
->
activateStatusChanged
(
tr
(
"requestFailed"
));
else
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
71b04c5e
...
...
@@ -45,6 +45,7 @@ CoreManager::CoreManager (QObject *parent, const QString &config_path) : QObject
m_instance
->
m_contacts_list_model
=
new
ContactsListModel
(
m_instance
);
m_instance
->
m_sip_addresses_model
=
new
SipAddressesModel
(
m_instance
);
m_instance
->
m_settings_model
=
new
SettingsModel
(
m_instance
);
m_instance
->
m_account_settings_model
=
new
AccountSettingsModel
(
m_instance
);
emit
m_instance
->
linphoneCoreCreated
();
}
...
...
linphone-desktop/src/components/core/CoreManager.hpp
View file @
71b04c5e
...
...
@@ -25,6 +25,7 @@
#include "../calls/CallsListModel.hpp"
#include "../contacts/ContactsListModel.hpp"
#include "../settings/AccountSettingsModel.hpp"
#include "../settings/SettingsModel.hpp"
#include "../sip-addresses/SipAddressesModel.hpp"
...
...
@@ -86,6 +87,10 @@ public:
return
m_settings_model
;
}
AccountSettingsModel
*
getAccountSettingsModel
()
const
{
return
m_account_settings_model
;
}
// ---------------------------------------------------------------------------
// Initialization.
// ---------------------------------------------------------------------------
...
...
@@ -125,6 +130,7 @@ private:
ContactsListModel
*
m_contacts_list_model
;
SipAddressesModel
*
m_sip_addresses_model
;
SettingsModel
*
m_settings_model
;
AccountSettingsModel
*
m_account_settings_model
;
QTimer
*
m_cbs_timer
;
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.cpp
View file @
71b04c5e
...
...
@@ -31,7 +31,28 @@ using namespace std;
// =============================================================================
QVariantMap
AccountSettingsModel
::
getProxyConfigDescription
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
)
{
bool
AccountSettingsModel
::
addOrUpdateProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
list
<
shared_ptr
<
linphone
::
ProxyConfig
>
>
proxy_configs
=
core
->
getProxyConfigList
();
if
(
find
(
proxy_configs
.
cbegin
(),
proxy_configs
.
cend
(),
proxy_config
)
!=
proxy_configs
.
cend
())
{
if
(
proxy_config
->
done
()
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to update proxy config: `%1`."
)
.
arg
(
::
Utils
::
linphoneStringToQString
(
proxy_config
->
getIdentityAddress
()
->
asString
()));
return
false
;
}
}
else
if
(
core
->
addProxyConfig
(
proxy_config
)
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to add proxy config: `%1`."
)
.
arg
(
::
Utils
::
linphoneStringToQString
(
proxy_config
->
getIdentityAddress
()
->
asString
()));
return
false
;
}
emit
accountSettingsUpdated
();
return
true
;
}
QVariantMap
AccountSettingsModel
::
getProxyConfigDescription
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
)
{
Q_ASSERT
(
proxy_config
!=
nullptr
);
QVariantMap
map
;
...
...
@@ -67,10 +88,9 @@ void AccountSettingsModel::removeProxyConfig (const shared_ptr<linphone::ProxyCo
}
bool
AccountSettingsModel
::
addOrUpdateProxyConfig
(
const
s
td
::
s
hared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
,
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
,
const
QVariantMap
&
data
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
QString
literal
=
data
[
"sipAddress"
].
toString
();
// Sip address.
...
...
@@ -107,23 +127,10 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
:
linphone
::
AVPFMode
::
AVPFModeDefault
);
list
<
shared_ptr
<
linphone
::
ProxyConfig
>
>
proxy_configs
=
core
->
getProxyConfigList
();
if
(
find
(
proxy_configs
.
cbegin
(),
proxy_configs
.
cend
(),
proxy_config
)
!=
proxy_configs
.
cend
())
{
if
(
proxy_config
->
done
()
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to update proxy config: `%1`."
).
arg
(
literal
);
return
false
;
}
}
else
if
(
core
->
addProxyConfig
(
proxy_config
)
==
-
1
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to add proxy config: `%1`."
).
arg
(
literal
);
return
false
;
}
emit
accountSettingsUpdated
();
return
true
;
return
addOrUpdateProxyConfig
(
proxy_config
);
}
s
td
::
s
hared_ptr
<
linphone
::
ProxyConfig
>
AccountSettingsModel
::
createProxyConfig
()
{
shared_ptr
<
linphone
::
ProxyConfig
>
AccountSettingsModel
::
createProxyConfig
()
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
createProxyConfig
();
}
...
...
@@ -223,7 +230,7 @@ QVariantList AccountSettingsModel::getAccounts () const {
// -----------------------------------------------------------------------------
void
AccountSettingsModel
::
setUsedSipAddress
(
const
s
td
::
s
hared_ptr
<
const
linphone
::
Address
>
&
address
)
{
void
AccountSettingsModel
::
setUsedSipAddress
(
const
shared_ptr
<
const
linphone
::
Address
>
&
address
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
ProxyConfig
>
proxy_config
=
core
->
getDefaultProxyConfig
();
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.hpp
View file @
71b04c5e
...
...
@@ -43,6 +43,8 @@ class AccountSettingsModel : public QObject {
public:
AccountSettingsModel
(
QObject
*
parent
=
Q_NULLPTR
)
:
QObject
(
parent
)
{}
bool
addOrUpdateProxyConfig
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
);
Q_INVOKABLE
QVariantMap
getProxyConfigDescription
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
);
Q_INVOKABLE
void
setDefaultProxyConfig
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
);
...
...
linphone-desktop/ui/modules/Common/Styles/Dialog/DialogStyle.qml
View file @
71b04c5e
...
...
@@ -18,13 +18,13 @@ QtObject {
}
property
QtObject
confirmDialog
:
QtObject
{
property
int
height
:
15
0
property
int
width
:
37
0
property
int
height
:
20
0
property
int
width
:
40
0
}
property
QtObject
description
:
QtObject
{
property
color
color
:
Colors
.
l
property
int
fontSize
:
1
2
property
int
fontSize
:
1
1
property
int
verticalMargin
:
25
}
}
linphone-desktop/ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml
View file @
71b04c5e
...
...
@@ -50,6 +50,7 @@ AssistantAbstractView {
onActivateStatusChanged
:
{
requestBlock
.
stop
(
error
)
if
(
!
error
.
length
)
{
window
.
unlockView
()
window
.
setView
(
'
Home
'
)
}
}
...
...
linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml
View file @
71b04c5e
...
...
@@ -89,7 +89,13 @@ AssistantAbstractView {
RequestBlock
{
id
:
requestBlock
action
:
assistantModel
.
create
action
:
function
()
{
window
.
lockView
({
descriptionText
:
qsTr
(
'
quitWarning
'
)
})
assistantModel
.
create
()
}
width
:
parent
.
width
}
}
...
...
@@ -111,6 +117,8 @@ AssistantAbstractView {
assistant
.
pushView
(
'
ActivateLinphoneSipAccountWithEmail
'
,
{
assistantModel
:
assistantModel
})
}
else
{
window
.
unlockView
()
}
}
}
...
...
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