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
24ee1aa9
Commit
24ee1aa9
authored
Sep 29, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ManageAccounts): can select default account
parent
7e089a9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
140 deletions
+157
-140
InvertedMouseArea.qml
tests/ui/modules/Linphone/InvertedMouseArea.qml
+3
-1
ScrollableListView.qml
tests/ui/modules/Linphone/View/ScrollableListView.qml
+0
-1
MainWindow.qml
tests/ui/views/MainWindow/MainWindow.qml
+6
-2
ManageAccounts.qml
tests/ui/views/ManageAccounts.qml
+148
-136
No files found.
tests/ui/modules/Linphone/InvertedMouseArea.qml
View file @
24ee1aa9
...
...
@@ -83,6 +83,8 @@ Item {
mapToItem
(
item
.
parent
,
mouse
.
x
,
mouse
.
y
)
))
{
if
(
_timeout
!=
null
)
{
// Remove existing timeout to avoid the creation of
// many children.
Utils
.
clearTimeout
(
_timeout
)
}
...
...
@@ -91,7 +93,7 @@ Item {
//
// It's useful to ensure the window's context is not
// modified with the mouse event before the `onPressed`
//
function
.
//
call
.
//
// The timeout is destroyed with the `MouseArea` component.
_timeout
=
Utils
.
setTimeout
.
call
(
this
,
0
,
item
.
pressed
.
bind
(
this
))
...
...
tests/ui/modules/Linphone/View/ScrollableListView.qml
View file @
24ee1aa9
...
...
@@ -9,6 +9,5 @@ ListView {
ScrollBar.vertical
:
ForceScrollBar
{
}
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
highlightRangeMode
:
ListView
.
ApplyRange
spacing
:
0
}
tests/ui/views/MainWindow/MainWindow.qml
View file @
24ee1aa9
...
...
@@ -12,6 +12,10 @@ ApplicationWindow {
loaderContent
.
source
=
'
qrc:/ui/views/MainWindow/
'
+
view
+
'
.qml
'
}
function
_manageAccounts
()
{
Utils
.
openWindow
(
'
ManageAccounts
'
,
window
)
}
maximumHeight
:
70
minimumHeight
:
70
minimumWidth
:
780
...
...
@@ -53,13 +57,13 @@ ApplicationWindow {
MouseArea
{
anchors.fill
:
contactDescription
onClicked
:
Utils
.
openWindow
(
'
ManageAccounts
'
,
window
)
onClicked
:
_manageAccounts
(
)
}
// User actions.
ActionButton
{
Layout.preferredWidth
:
1
onClicked
:
Utils
.
openWindow
(
'
ManageAccounts
'
,
window
)
onClicked
:
_manageAccounts
(
)
}
ActionButton
{
...
...
tests/ui/views/ManageAccounts.qml
View file @
24ee1aa9
...
...
@@ -5,149 +5,161 @@ import QtQuick.Layouts 1.3
import
Linphone
1.0
DialogPlus
{
descriptionText
:
qsTr
(
'
manageAccountsDescription
'
)
minimumHeight
:
328
minimumWidth
:
480
title
:
qsTr
(
'
manageAccountsTitle
'
)
descriptionText
:
qsTr
(
'
manageAccountsDescription
'
)
minimumHeight
:
328
minimumWidth
:
480
title
:
qsTr
(
'
manageAccountsTitle
'
)
buttons
:
TextButtonA
{
text
:
qsTr
(
'
validate
'
)
}
buttons
:
TextButtonA
{
text
:
qsTr
(
'
validate
'
)
onClicked
:
exit
(
0
)
}
Item
{
anchors.fill
:
parent
// TODO: Compute list max.
ScrollableListView
{
id
:
accounts
Item
{
anchors.fill
:
parent
anchors.fill
:
parent
// TODO: Compute list max.
ScrollableListView
{
// TODO: Remove, use C++ model instead.
model
:
model1
delegate
:
Item
{
function
isDefaultAccount
()
{
return
accounts
.
currentIndex
===
index
}
height
:
34
width
:
parent
.
width
Rectangle
{
anchors.fill
:
parent
color
:
isDefaultAccount
()
?
'
#EAEAEA
'
:
'
transparent
'
id
:
accountLine
RowLayout
{
anchors.fill
:
parent
id
:
accountsList
// TODO: Remove, use C++ model instead.
model
:
ListModel
{
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
jim.williams.zzzz.yyyy.kkkk.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
toto.lala.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
disconnected
'
sipAddress
:
'
machin.truc.sip.linphone.org
'
isDefault
:
true
}
ListElement
{
presence
:
'
absent
'
sipAddress
:
'
hey.listen.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
do_not_disturb
'
sipAddress
:
'
valentin.cognito.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
do_not_disturb
'
sipAddress
:
'
charles.henri.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
disconnected
'
sipAddress
:
'
yesyes.nono.sip.linphone.org
'
isDefault
:
false
}
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
nsa.sip.linphone.org
'
isDefault
:
false
}
spacing
:
15
anchors.leftMargin
:
15
anchors.rightMargin
:
15
// Default account.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
20
Image
{
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
source
:
isDefaultAccount
()
?
'
qrc:/imgs/valid.svg
'
:
''
}
}
delegate
:
Item
{
height
:
34
width
:
parent
.
width
Rectangle
{
anchors.fill
:
parent
color
:
isDefault
?
'
#EAEAEA
'
:
'
transparent
'
id
:
accountLine
RowLayout
{
anchors.fill
:
parent
spacing
:
15
anchors.leftMargin
:
15
anchors.rightMargin
:
15
// Default account.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
20
Image
{
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
source
:
isDefault
?
'
qrc:/imgs/valid.svg
'
:
''
}
}
// Sip account.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.fillWidth
:
true
Text
{
anchors.fill
:
parent
clip
:
true
color
:
'
#59575A
'
text
:
sipAddress
;
verticalAlignment
:
Text
.
AlignVCenter
MouseArea
{
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
}
}
}
// Presence.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
20
Image
{
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
source
:
'
qrc:/imgs/led_
'
+
presence
+
'
.svg
'
}
}
// Update presence.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
160
TransparentComboBox
{
anchors.fill
:
parent
model
:
ListModel
{
ListElement
{
key
:
qsTr
(
'
onlinePresence
'
);
value
:
1
}
ListElement
{
key
:
qsTr
(
'
busyPresence
'
);
value
:
2
}
ListElement
{
key
:
qsTr
(
'
beRightBackPresence
'
);
value
:
3
}
ListElement
{
key
:
qsTr
(
'
awayPresence
'
);
value
:
4
}
ListElement
{
key
:
qsTr
(
'
onThePhonePresence
'
);
value
:
5
}
ListElement
{
key
:
qsTr
(
'
outToLunchPresence
'
);
value
:
6
}
ListElement
{
key
:
qsTr
(
'
doNotDisturbPresence
'
);
value
:
7
}
ListElement
{
key
:
qsTr
(
'
movedPresence
'
);
value
:
8
}
ListElement
{
key
:
qsTr
(
'
usingAnotherMessagingServicePresence
'
);
value
:
9
}
ListElement
{
key
:
qsTr
(
'
offlinePresence
'
);
value
:
10
}
}
textRole
:
'
key
'
}
}
}
// Sip account.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.fillWidth
:
true
Text
{
anchors.fill
:
parent
clip
:
true
color
:
'
#59575A
'
text
:
sipAddress
;
verticalAlignment
:
Text
.
AlignVCenter
MouseArea
{
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
onClicked
:
accounts
.
currentIndex
=
index
}
}
}
// Presence.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
20
Image
{
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
source
:
'
qrc:/imgs/led_
'
+
presence
+
'
.svg
'
}
}
// Update presence.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
160
TransparentComboBox
{
anchors.fill
:
parent
model
:
model2
textRole
:
'
key
'
}
}
}
}
}
}
}
// =================================================================
// TMP
// =================================================================
ListModel
{
id
:
model1
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
jim.williams.zzzz.yyyy.kkkk.sip.linphone.org
'
}
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
toto.lala.sip.linphone.org
'
}
ListElement
{
presence
:
'
disconnected
'
sipAddress
:
'
machin.truc.sip.linphone.org
'
}
ListElement
{
presence
:
'
absent
'
sipAddress
:
'
hey.listen.sip.linphone.org
'
}
ListElement
{
presence
:
'
do_not_disturb
'
sipAddress
:
'
valentin.cognito.sip.linphone.org
'
}
ListElement
{
presence
:
'
do_not_disturb
'
sipAddress
:
'
charles.henri.sip.linphone.org
'
}
ListElement
{
presence
:
'
disconnected
'
sipAddress
:
'
yesyes.nono.sip.linphone.org
'
}
ListElement
{
presence
:
'
connected
'
sipAddress
:
'
nsa.sip.linphone.org
'
}
}
ListModel
{
id
:
model2
ListElement
{
key
:
qsTr
(
'
onlinePresence
'
);
value
:
1
}
ListElement
{
key
:
qsTr
(
'
busyPresence
'
);
value
:
2
}
ListElement
{
key
:
qsTr
(
'
beRightBackPresence
'
);
value
:
3
}
ListElement
{
key
:
qsTr
(
'
awayPresence
'
);
value
:
4
}
ListElement
{
key
:
qsTr
(
'
onThePhonePresence
'
);
value
:
5
}
ListElement
{
key
:
qsTr
(
'
outToLunchPresence
'
);
value
:
6
}
ListElement
{
key
:
qsTr
(
'
doNotDisturbPresence
'
);
value
:
7
}
ListElement
{
key
:
qsTr
(
'
movedPresence
'
);
value
:
8
}
ListElement
{
key
:
qsTr
(
'
usingAnotherMessagingServicePresence
'
);
value
:
9
}
ListElement
{
key
:
qsTr
(
'
offlinePresence
'
);
value
:
10
}
}
}
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