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
cb4626fa
Commit
cb4626fa
authored
Mar 20, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsSipAccounts): supports default identity config
parent
2d8cf788
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
156 additions
and
12 deletions
+156
-12
en.ts
linphone-desktop/assets/languages/en.ts
+19
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+19
-0
AccountSettingsModel.cpp
...-desktop/src/components/settings/AccountSettingsModel.cpp
+49
-7
AccountSettingsModel.hpp
...-desktop/src/components/settings/AccountSettingsModel.hpp
+19
-5
SettingsSipAccounts.qml
...one-desktop/ui/views/App/Settings/SettingsSipAccounts.qml
+50
-0
No files found.
linphone-desktop/assets/languages/en.ts
View file @
cb4626fa
...
@@ -791,6 +791,25 @@ Server url not configured.</translation>
...
@@ -791,6 +791,25 @@ Server url not configured.</translation>
<
translation
>
Enable
adaptive
rate
control
<
/translation
>
<
translation
>
Enable
adaptive
rate
control
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsSipAccounts
<
/name
>
<
message
>
<
source
>
defaultIdentityTitle
<
/source
>
<
translation
>
Default
identity
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultDisplaynameLabel
<
/source
>
<
translation
>
Display
name
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultUsernameLabel
<
/source
>
<
translation
>
Username
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultSipAddressLabel
<
/source
>
<
translation
>
SIP
address
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
name
>
SettingsUi
<
/name
>
<
message
>
<
message
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
cb4626fa
...
@@ -791,6 +791,25 @@ Url du serveur non configurée.</translation>
...
@@ -791,6 +791,25 @@ Url du serveur non configurée.</translation>
<
translation
>
Activer
le
contr
ô
le
de
d
é
bit
adaptif
<
/translation
>
<
translation
>
Activer
le
contr
ô
le
de
d
é
bit
adaptif
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsSipAccounts
<
/name
>
<
message
>
<
source
>
defaultIdentityTitle
<
/source
>
<
translation
>
Identit
é
par
d
é
faut
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultDisplaynameLabel
<
/source
>
<
translation
>
Nom
d
&
apos
;
affichage
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultUsernameLabel
<
/source
>
<
translation
>
Nom
d
&
apos
;
utilisateur
<
/translation
>
<
/message
>
<
message
>
<
source
>
defaultSipAddressLabel
<
/source
>
<
translation
>
Adresse
SIP
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
name
>
SettingsUi
<
/name
>
<
message
>
<
message
>
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.cpp
View file @
cb4626fa
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
void
AccountSettingsModel
::
setDefaultProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
)
{
void
AccountSettingsModel
::
setDefaultProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setDefaultProxyConfig
(
proxy_config
);
CoreManager
::
getInstance
()
->
getCore
()
->
setDefaultProxyConfig
(
proxy_config
);
emit
accountUpdated
();
emit
account
Settings
Updated
();
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
AccountSettingsModel
::
getUsername
()
const
{
QString
AccountSettingsModel
::
getUsername
()
const
{
shared_ptr
<
linphone
::
Address
>
address
=
get
Default
SipAddress
();
shared_ptr
<
linphone
::
Address
>
address
=
get
Used
SipAddress
();
const
string
&
display_name
=
address
->
getDisplayName
();
const
string
&
display_name
=
address
->
getDisplayName
();
return
::
Utils
::
linphoneStringToQString
(
return
::
Utils
::
linphoneStringToQString
(
...
@@ -46,21 +46,63 @@ QString AccountSettingsModel::getUsername () const {
...
@@ -46,21 +46,63 @@ QString AccountSettingsModel::getUsername () const {
}
}
void
AccountSettingsModel
::
setUsername
(
const
QString
&
username
)
{
void
AccountSettingsModel
::
setUsername
(
const
QString
&
username
)
{
shared_ptr
<
linphone
::
Address
>
address
=
get
Default
SipAddress
();
shared_ptr
<
linphone
::
Address
>
address
=
get
Used
SipAddress
();
if
(
address
->
setDisplayName
(
::
Utils
::
qStringToLinphoneString
(
username
)))
if
(
address
->
setDisplayName
(
::
Utils
::
qStringToLinphoneString
(
username
)))
qWarning
()
<<
QStringLiteral
(
"Unable to set displayName on sip address: `%1`."
)
qWarning
()
<<
QStringLiteral
(
"Unable to set displayName on sip address: `%1`."
)
.
arg
(
::
Utils
::
linphoneStringToQString
(
address
->
asStringUriOnly
()));
.
arg
(
::
Utils
::
linphoneStringToQString
(
address
->
asStringUriOnly
()));
emit
accountUpdated
();
emit
accountSettingsUpdated
();
}
QString
AccountSettingsModel
::
getSipAddress
()
const
{
return
::
Utils
::
linphoneStringToQString
(
getUsedSipAddress
()
->
asStringUriOnly
());
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
AccountSettingsModel
::
getSipAddress
()
const
{
QString
AccountSettingsModel
::
getPrimaryUsername
()
const
{
return
::
Utils
::
linphoneStringToQString
(
getDefaultSipAddress
()
->
asStringUriOnly
());
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getPrimaryContactParsed
()
->
getUsername
()
);
}
void
AccountSettingsModel
::
setPrimaryUsername
(
const
QString
&
username
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Address
>
primary
=
core
->
getPrimaryContactParsed
();
primary
->
setUsername
(
username
.
isEmpty
()
?
"linphone"
:
::
Utils
::
qStringToLinphoneString
(
username
)
);
core
->
setPrimaryContact
(
primary
->
asString
());
emit
accountSettingsUpdated
();
}
}
QString
AccountSettingsModel
::
getPrimaryDisplayname
()
const
{
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getPrimaryContactParsed
()
->
getDisplayName
()
);
}
void
AccountSettingsModel
::
setPrimaryDisplayname
(
const
QString
&
displayname
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Address
>
primary
=
core
->
getPrimaryContactParsed
();
primary
->
setDisplayName
(
::
Utils
::
qStringToLinphoneString
(
displayname
));
core
->
setPrimaryContact
(
primary
->
asString
());
emit
accountSettingsUpdated
();
}
QString
AccountSettingsModel
::
getPrimarySipAddress
()
const
{
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getPrimaryContactParsed
()
->
asString
()
);
}
// -----------------------------------------------------------------------------
QVariantList
AccountSettingsModel
::
getAccounts
()
const
{
QVariantList
AccountSettingsModel
::
getAccounts
()
const
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
QVariantList
accounts
;
QVariantList
accounts
;
...
@@ -84,7 +126,7 @@ QVariantList AccountSettingsModel::getAccounts () const {
...
@@ -84,7 +126,7 @@ QVariantList AccountSettingsModel::getAccounts () const {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
shared_ptr
<
linphone
::
Address
>
AccountSettingsModel
::
get
Default
SipAddress
()
const
{
shared_ptr
<
linphone
::
Address
>
AccountSettingsModel
::
get
Used
SipAddress
()
const
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
ProxyConfig
>
proxy_config
=
core
->
getDefaultProxyConfig
();
shared_ptr
<
linphone
::
ProxyConfig
>
proxy_config
=
core
->
getDefaultProxyConfig
();
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.hpp
View file @
cb4626fa
...
@@ -31,9 +31,14 @@
...
@@ -31,9 +31,14 @@
class
AccountSettingsModel
:
public
QObject
{
class
AccountSettingsModel
:
public
QObject
{
Q_OBJECT
;
Q_OBJECT
;
Q_PROPERTY
(
QString
username
READ
getUsername
WRITE
setUsername
NOTIFY
accountUpdated
);
Q_PROPERTY
(
QString
username
READ
getUsername
WRITE
setUsername
NOTIFY
accountSettingsUpdated
);
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
NOTIFY
accountUpdated
);
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
NOTIFY
accountSettingsUpdated
);
Q_PROPERTY
(
QVariantList
accounts
READ
getAccounts
NOTIFY
accountUpdated
);
Q_PROPERTY
(
QString
primaryDisplayname
READ
getPrimaryDisplayname
WRITE
setPrimaryDisplayname
NOTIFY
accountSettingsUpdated
);
Q_PROPERTY
(
QString
primaryUsername
READ
getPrimaryUsername
WRITE
setPrimaryUsername
NOTIFY
accountSettingsUpdated
);
Q_PROPERTY
(
QString
primarySipAddress
READ
getPrimarySipAddress
NOTIFY
accountSettingsUpdated
);
Q_PROPERTY
(
QVariantList
accounts
READ
getAccounts
NOTIFY
accountSettingsUpdated
);
public:
public:
AccountSettingsModel
(
QObject
*
parent
=
Q_NULLPTR
)
:
QObject
(
parent
)
{}
AccountSettingsModel
(
QObject
*
parent
=
Q_NULLPTR
)
:
QObject
(
parent
)
{}
...
@@ -41,16 +46,25 @@ public:
...
@@ -41,16 +46,25 @@ public:
Q_INVOKABLE
void
setDefaultProxyConfig
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
);
Q_INVOKABLE
void
setDefaultProxyConfig
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxy_config
);
signals:
signals:
void
accountUpdated
();
void
account
Settings
Updated
();
private:
private:
QString
getUsername
()
const
;
QString
getUsername
()
const
;
void
setUsername
(
const
QString
&
username
);
void
setUsername
(
const
QString
&
username
);
QString
getSipAddress
()
const
;
QString
getSipAddress
()
const
;
QString
getPrimaryUsername
()
const
;
void
setPrimaryUsername
(
const
QString
&
username
);
QString
getPrimaryDisplayname
()
const
;
void
setPrimaryDisplayname
(
const
QString
&
displayname
);
QString
getPrimarySipAddress
()
const
;
QVariantList
getAccounts
()
const
;
QVariantList
getAccounts
()
const
;
std
::
shared_ptr
<
linphone
::
Address
>
get
Default
SipAddress
()
const
;
std
::
shared_ptr
<
linphone
::
Address
>
get
Used
SipAddress
()
const
;
};
};
Q_DECLARE_METATYPE
(
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
);
Q_DECLARE_METATYPE
(
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
);
...
...
linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml
View file @
cb4626fa
import
QtQuick
2.7
import
QtQuick
2.7
import
Common
1.0
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
// =============================================================================
// =============================================================================
TabContainer
{
TabContainer
{
Column
{
spacing
:
SettingsWindowStyle
.
forms
.
spacing
width
:
parent
.
width
// -------------------------------------------------------------------------
// Default identity.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
defaultIdentityTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
defaultDisplaynameLabel
'
)
TextField
{
text
:
AccountSettingsModel
.
primaryDisplayname
onEditingFinished
:
AccountSettingsModel
.
primaryDisplayname
=
text
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
defaultUsernameLabel
'
)
TextField
{
text
:
AccountSettingsModel
.
primaryUsername
onEditingFinished
:
AccountSettingsModel
.
primaryUsername
=
text
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
defaultSipAddressLabel
'
)
TextField
{
readOnly
:
true
text
:
AccountSettingsModel
.
primarySipAddress
}
}
}
}
}
}
}
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