Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
linphone-desktop
Commits
87059fa3
Commit
87059fa3
authored
Dec 07, 2016
by
Ronan
Browse files
unstable
parent
0ce9a5d5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
38 deletions
+58
-38
tests/CMakeLists.txt
tests/CMakeLists.txt
+1
-0
tests/src/app/AvatarProvider.cpp
tests/src/app/AvatarProvider.cpp
+1
-6
tests/src/components/contacts/ContactModel.cpp
tests/src/components/contacts/ContactModel.cpp
+18
-0
tests/src/components/contacts/ContactModel.hpp
tests/src/components/contacts/ContactModel.hpp
+11
-4
tests/ui/modules/Common/Form/ListForm.qml
tests/ui/modules/Common/Form/ListForm.qml
+21
-9
tests/ui/views/App/MainWindow/ContactEdit.qml
tests/ui/views/App/MainWindow/ContactEdit.qml
+6
-19
No files found.
tests/CMakeLists.txt
View file @
87059fa3
...
...
@@ -29,6 +29,7 @@ set(CUSTOM_FLAGS "\
-Wunused \
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
CUSTOM_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DQT_QML_DEBUG"
)
# --------------------------------------------------------------------
# Define packages, libs, sources, headers, resources and languages
...
...
tests/src/app/AvatarProvider.cpp
View file @
87059fa3
...
...
@@ -22,10 +22,5 @@ QImage AvatarProvider::requestImage (
QSize
*
,
const
QSize
&
)
{
QImage
image
(
m_avatars_path
+
id
);
if
(
image
.
isNull
())
qWarning
()
<<
QStringLiteral
(
"Unable to load: `%1`."
).
arg
(
id
);
return
image
;
return
QImage
(
m_avatars_path
+
id
);
}
tests/src/components/contacts/ContactModel.cpp
View file @
87059fa3
...
...
@@ -17,6 +17,11 @@ using namespace std;
// ===================================================================
ContactModel
::
ContactModel
(
shared_ptr
<
linphone
::
Friend
>
linphone_friend
)
{
linphone_friend
->
setData
(
"contact-model"
,
*
this
);
m_linphone_friend
=
linphone_friend
;
}
Presence
::
PresenceStatus
ContactModel
::
getPresenceStatus
()
const
{
return
m_presence_status
;
}
...
...
@@ -118,6 +123,19 @@ bool ContactModel::setAvatar (const QString &path) {
return
true
;
}
QVariantList
ContactModel
::
getSipAddresses
()
const
{
QVariantList
list
;
for
(
const
auto
&
address
:
m_linphone_friend
->
getAddresses
())
list
.
append
(
Utils
::
linphoneStringToQString
(
address
->
asString
()));
return
list
;
}
void
ContactModel
::
setSipAddresses
(
const
QVariantList
&
sip_addresses
)
{
}
QString
ContactModel
::
getSipAddress
()
const
{
return
Utils
::
linphoneStringToQString
(
m_linphone_friend
->
getAddress
()
->
asString
()
...
...
tests/src/components/contacts/ContactModel.hpp
View file @
87059fa3
...
...
@@ -28,6 +28,13 @@ class ContactModel : public QObject {
NOTIFY
contactUpdated
);
Q_PROPERTY
(
QVariantList
sipAddresses
READ
getSipAddresses
WRITE
setSipAddresses
NOTIFY
contactUpdated
);
Q_PROPERTY
(
Presence
::
PresenceStatus
presenceStatus
READ
getPresenceStatus
...
...
@@ -47,10 +54,7 @@ class ContactModel : public QObject {
);
public:
ContactModel
(
std
::
shared_ptr
<
linphone
::
Friend
>
linphone_friend
)
{
linphone_friend
->
setData
(
"contact-model"
,
*
this
);
m_linphone_friend
=
linphone_friend
;
}
ContactModel
(
std
::
shared_ptr
<
linphone
::
Friend
>
linphone_friend
);
signals:
void
contactUpdated
();
...
...
@@ -62,6 +66,9 @@ private:
QString
getAvatar
()
const
;
bool
setAvatar
(
const
QString
&
path
);
QVariantList
getSipAddresses
()
const
;
void
setSipAddresses
(
const
QVariantList
&
sip_addresses
);
Presence
::
PresenceStatus
getPresenceStatus
()
const
;
Presence
::
PresenceLevel
getPresenceLevel
()
const
;
...
...
tests/ui/modules/Common/Form/ListForm.qml
View file @
87059fa3
...
...
@@ -3,20 +3,19 @@ import QtQuick.Layouts 1.3
import
Common
1.0
import
Common
.
Styles
1.0
import
Utils
1.0
// ===================================================================
RowLayout
{
id
:
listForm
property
alias
model
:
values
.
model
property
alias
placeholder
:
placeholder
.
text
property
alias
title
:
text
.
text
// -----------------------------------------------------------------
function
_addValue
(
value
)
{
model
.
append
({
$value
:
value
})
values
.
model
.
append
({
$value
:
value
})
if
(
value
.
length
===
0
)
{
addButton
.
enabled
=
false
...
...
@@ -25,9 +24,11 @@ RowLayout {
function
_handleEditionFinished
(
index
,
text
)
{
if
(
text
.
length
===
0
)
{
model
.
remove
(
index
)
console
.
log
(
'
edition end
'
)
values
.
model
.
remove
(
index
)
}
else
{
model
.
set
(
index
,
{
$value
:
text
})
console
.
log
(
'
edition end (text exists)
'
)
values
.
model
.
set
(
index
,
{
$value
:
text
})
}
addButton
.
enabled
=
true
...
...
@@ -85,8 +86,11 @@ RowLayout {
pointSize
:
ListFormStyle
.
value
.
placeholder
.
fontSize
}
padding
:
ListFormStyle
.
value
.
text
.
padding
visible
:
model
.
count
===
0
padding
:
ListFormStyle
.
value
.
text
.
padding
visible
:
{
console
.
log
(
'
placeholder
'
,
values
.
model
.
count
)
return
values
.
model
.
count
===
0
}
verticalAlignment
:
Text
.
AlignVCenter
}
...
...
@@ -100,7 +104,10 @@ RowLayout {
Layout.fillWidth
:
true
Layout.preferredHeight
:
count
*
ListFormStyle
.
lineHeight
interactive
:
false
visible
:
count
>
0
visible
:
{
console
.
log
(
'
values
'
,
model
.
count
)
return
model
.
count
>
0
}
delegate
:
Item
{
implicitHeight
:
textEdit
.
height
...
...
@@ -143,9 +150,14 @@ RowLayout {
Component.onCompleted
:
{
if
(
$value
.
length
===
0
)
{
textEdit
.
forceActiveFocus
()
textEdit
.
forceActiveFocus
()
}
}
}
model
:
ListModel
{
ListElement
{
$value
:
'
merinos@sip.linphone.org
'
}
ListElement
{
$value
:
'
elisabeth.pro@sip.linphone.org
'
}
}
}
}
tests/ui/views/App/MainWindow/ContactEdit.qml
View file @
87059fa3
...
...
@@ -137,52 +137,39 @@ ColumnLayout {
Flickable
{
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.topMargin
:
40
ScrollBar.vertical
:
ForceScrollBar
{}
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
contentHeight
:
infoList
.
height
flickableDirection
:
Flickable
.
VerticalFlick
leftMargin
:
40
rightMargin
:
40
topMargin
:
40
ColumnLayout
{
id
:
infoList
anchors.left
:
parent
.
left
anchors.margins
:
40
anchors.right
:
parent
.
right
id
:
infoList
ListForm
{
title
:
qsTr
(
'
sipAccounts
'
)
model
:
ListModel
{
ListElement
{
$value
:
'
merinos@sip.linphone.org
'
}
ListElement
{
$value
:
'
elisabeth.pro@sip.linphone.org
'
}
}
placeholder
:
qsTr
(
'
sipAccountsInput
'
)
}
ListForm
{
title
:
qsTr
(
'
address
'
)
model
:
ListModel
{
ListElement
{
$value
:
'
312 East 10th Street - New York, NY 1009
'
}
}
placeholder
:
qsTr
(
'
addressInput
'
)
}
ListForm
{
title
:
qsTr
(
'
emails
'
)
model
:
ListModel
{
ListElement
{
$value
:
'
e.meri@gmail.com
'
}
ListElement
{
$value
:
'
toto@truc.machin
'
}
}
placeholder
:
qsTr
(
'
emailsInput
'
)
}
ListForm
{
title
:
qsTr
(
'
webSites
'
)
model
:
ListModel
{
ListElement
{
$value
:
'
www.totogro.com
'
}
ListElement
{
$value
:
'
www.404.unknown
'
}
}
placeholder
:
qsTr
(
'
webSitesInput
'
)
}
}
...
...
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