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
0813eda3
Commit
0813eda3
authored
Oct 31, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Contact/Avatar): better `_computeInitials` function
parent
5640d2d4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
14 deletions
+25
-14
main.cpp
tests/src/main.cpp
+1
-1
AccountStatus.qml
tests/ui/modules/Linphone/Account/AccountStatus.qml
+2
-1
Avatar.qml
tests/ui/modules/Linphone/Contact/Avatar.qml
+14
-6
Contact.qml
tests/ui/modules/Linphone/Contact/Contact.qml
+7
-5
Timeline.qml
tests/ui/modules/Linphone/Timeline.qml
+1
-1
No files found.
tests/src/main.cpp
View file @
0813eda3
...
@@ -65,7 +65,7 @@ void addContextProperties (QQmlApplicationEngine &engine) {
...
@@ -65,7 +65,7 @@ void addContextProperties (QQmlApplicationEngine &engine) {
if
(
component
.
isError
())
{
if
(
component
.
isError
())
{
qWarning
()
<<
component
.
errors
();
qWarning
()
<<
component
.
errors
();
}
else
{
}
else
{
context
->
setContextProperty
(
"CallsWindow"
,
component
.
create
());
//
context->setContextProperty("CallsWindow", component.create());
}
}
// Models.
// Models.
...
...
tests/ui/modules/Linphone/Account/AccountStatus.qml
View file @
0813eda3
...
@@ -50,10 +50,11 @@ Item {
...
@@ -50,10 +50,11 @@ Item {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
hoverEnabled
:
true
cursorShape
:
containsMouse
cursorShape
:
containsMouse
?
Qt
.
PointingHandCursor
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
:
Qt
.
ArrowCursor
hoverEnabled
:
true
onClicked
:
Utils
.
openWindow
(
'
ManageAccounts
'
,
this
)
onClicked
:
Utils
.
openWindow
(
'
ManageAccounts
'
,
this
)
}
}
}
}
tests/ui/modules/Linphone/Contact/Avatar.qml
View file @
0813eda3
...
@@ -3,6 +3,7 @@ import QtGraphicalEffects 1.0
...
@@ -3,6 +3,7 @@ import QtGraphicalEffects 1.0
import
Linphone
1.0
import
Linphone
1.0
import
Linphone
.
Styles
1.0
import
Linphone
.
Styles
1.0
import
Utils
1.0
// ===================================================================
// ===================================================================
...
@@ -11,15 +12,22 @@ Item {
...
@@ -11,15 +12,22 @@ Item {
property
alias
presenceLevel
:
presenceLevel
.
level
property
alias
presenceLevel
:
presenceLevel
.
level
property
string
username
property
string
username
property
var
_initialsRegex
:
/^
\s
*
([^\s]
+
)(?:\s
+
([^\s]
+
))?
/
function
_computeInitials
()
{
function
_computeInitials
()
{
var
spaceIndex
=
username
.
indexOf
(
'
'
)
var
result
=
username
.
match
(
_initialsRegex
)
var
firstLetter
=
username
.
charAt
(
0
)
if
(
spaceIndex
===
-
1
)
{
Utils
.
assert
(
return
firstLetter
result
!=
null
,
}
'
Unable to get initials of:
\'
'
+
username
+
'
\'
'
)
return
firstLetter
+
username
.
charAt
(
spaceIndex
+
1
)
return
result
[
1
].
charAt
(
0
).
toUpperCase
()
+
(
result
[
2
]
!=
null
?
result
[
2
].
charAt
(
0
).
toUpperCase
()
:
''
)
}
}
// Image mask. (Circle)
// Image mask. (Circle)
...
...
tests/ui/modules/Linphone/Contact/Contact.qml
View file @
0813eda3
...
@@ -17,9 +17,11 @@ Item {
...
@@ -17,9 +17,11 @@ Item {
height
:
ContactStyle
.
height
height
:
ContactStyle
.
height
RowLayout
{
RowLayout
{
anchors.fill
:
parent
anchors
{
anchors.leftMargin
:
ContactStyle
.
leftMargin
fill
:
parent
anchors.rightMargin
:
ContactStyle
.
rightMargin
leftMargin
:
ContactStyle
.
leftMargin
rightMargin
:
ContactStyle
.
rightMargin
}
spacing
:
ContactStyle
.
spacing
spacing
:
ContactStyle
.
spacing
Avatar
{
Avatar
{
...
@@ -27,7 +29,7 @@ Item {
...
@@ -27,7 +29,7 @@ Item {
Layout.preferredHeight
:
ContactStyle
.
contentHeight
Layout.preferredHeight
:
ContactStyle
.
contentHeight
Layout.preferredWidth
:
ContactStyle
.
contentHeight
Layout.preferredWidth
:
ContactStyle
.
contentHeight
image
:
contact
.
image
image
:
contact
.
avatar
presenceLevel
:
contact
.
presenceLevel
presenceLevel
:
contact
.
presenceLevel
username
:
contact
.
username
username
:
contact
.
username
}
}
...
@@ -37,7 +39,7 @@ Item {
...
@@ -37,7 +39,7 @@ Item {
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sipAddress
:
contact
.
sipAddress
sipAddress
:
contact
.
sipAddress
es
[
0
]
username
:
avatar
.
username
username
:
avatar
.
username
}
}
...
...
tests/ui/modules/Linphone/Timeline.qml
View file @
0813eda3
...
@@ -25,9 +25,9 @@ ColumnLayout {
...
@@ -25,9 +25,9 @@ ColumnLayout {
spacing
:
TimelineStyle
.
legend
.
spacing
spacing
:
TimelineStyle
.
legend
.
spacing
Icon
{
Icon
{
anchors.verticalCenter
:
parent
.
verticalCenter
icon
:
'
history
'
icon
:
'
history
'
iconSize
:
TimelineStyle
.
legend
.
iconSize
iconSize
:
TimelineStyle
.
legend
.
iconSize
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
Text
{
Text
{
...
...
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