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
d37c3b81
Commit
d37c3b81
authored
Jan 09, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Linphone/SmartSearchBar): supports not registered sip addresses
parent
39e83ddb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
45 deletions
+133
-45
SipAddressesModel.cpp
tests/src/components/sip-addresses/SipAddressesModel.cpp
+10
-0
SipAddressesModel.hpp
tests/src/components/sip-addresses/SipAddressesModel.hpp
+2
-0
Contact.qml
tests/ui/modules/Linphone/Contact/Contact.qml
+1
-0
SmartSearchBar.qml
tests/ui/modules/Linphone/SmartSearchBar.qml
+116
-35
SmartSearchBarStyle.qml
tests/ui/modules/Linphone/Styles/SmartSearchBarStyle.qml
+1
-1
ContactEdit.qml
tests/ui/views/App/MainWindow/ContactEdit.qml
+3
-9
No files found.
tests/src/components/sip-addresses/SipAddressesModel.cpp
View file @
d37c3b81
...
...
@@ -134,6 +134,16 @@ void SipAddressesModel::handleAllHistoryEntriesRemoved () {
// -----------------------------------------------------------------------------
QString
SipAddressesModel
::
interpretUrl
(
const
QString
&
sip_address
)
{
shared_ptr
<
linphone
::
Address
>
l_address
=
CoreManager
::
getInstance
()
->
getCore
()
->
interpretUrl
(
::
Utils
::
qStringToLinphoneString
(
sip_address
)
);
return
l_address
?
::
Utils
::
linphoneStringToQString
(
l_address
->
asStringUriOnly
())
:
""
;
}
// -----------------------------------------------------------------------------
bool
SipAddressesModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
return
removeRows
(
row
,
1
,
parent
);
}
...
...
tests/src/components/sip-addresses/SipAddressesModel.hpp
View file @
d37c3b81
...
...
@@ -27,6 +27,8 @@ public:
Q_INVOKABLE
void
handleAllHistoryEntriesRemoved
();
Q_INVOKABLE
QString
interpretUrl
(
const
QString
&
sip_address
);
private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
...
...
tests/ui/modules/Linphone/Contact/Contact.qml
View file @
d37c3b81
...
...
@@ -19,6 +19,7 @@ Rectangle {
property
alias
usernameColor
:
description
.
usernameColor
property
var
entry
property
var
_contact
:
entry
.
contact
// ---------------------------------------------------------------------------
...
...
tests/ui/modules/Linphone/SmartSearchBar.qml
View file @
d37c3b81
...
...
@@ -19,57 +19,138 @@ SearchBox {
// ---------------------------------------------------------------------------
header
:
MouseArea
{
id
:
headerContent
header
:
Column
{
readonly
property
string
interpretableSipAddress
:
SipAddressesModel
.
interpretUrl
(
searchBox
.
filter
)
height
:
SmartSearchBarStyle
.
header
.
height
height
:
{
var
height
=
SmartSearchBarStyle
.
header
.
addButtonHeight
return
defaultContact
.
visible
?
height
+
searchBox
.
entryHeight
:
height
}
width
:
parent
.
width
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
addContact
(
searchBox
.
filter
)
spacing
:
0
// -------------------------------------------------------------------------
// Default contact.
// -------------------------------------------------------------------------
Loader
{
id
:
defaultContact
height
:
searchBox
.
entryHeight
width
:
parent
.
width
visible
:
interpretableSipAddress
.
length
>
0
sourceComponent
:
Rectangle
{
anchors.fill
:
parent
color
:
SmartSearchBarStyle
.
entry
.
color
.
normal
RowLayout
{
anchors
{
fill
:
parent
rightMargin
:
SmartSearchBarStyle
.
entry
.
rightMargin
}
spacing
:
0
Contact
{
id
:
contact
Layout.fillHeight
:
true
Layout.fillWidth
:
true
entry
:
Object
({
sipAddress
:
interpretableSipAddress
})
}
ActionBar
{
iconSize
:
SmartSearchBarStyle
.
entry
.
iconSize
ActionButton
{
icon
:
'
video_call
'
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
launchVideoCall
(
interpretableSipAddress
)
}
}
ActionButton
{
icon
:
'
call
'
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
launchCall
(
interpretableSipAddress
)
}
}
ActionButton
{
icon
:
'
chat
'
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
launchChat
(
interpretableSipAddress
)
}
}
}
}
}
}
Rectangle
{
anchors.fill
:
parent
color
:
parent
.
pressed
// -------------------------------------------------------------------------
// Add contact button.
// -------------------------------------------------------------------------
MouseArea
{
id
:
addContactButton
height
:
SmartSearchBarStyle
.
header
.
addButtonHeight
width
:
parent
.
width
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
addContact
(
interpretableSipAddress
)
}
Rectangle
{
anchors.fill
:
parent
color
:
parent
.
pressed
?
SmartSearchBarStyle
.
header
.
color
.
pressed
:
SmartSearchBarStyle
.
header
.
color
.
normal
Text
{
anchors
{
left
:
parent
.
left
leftMargin
:
SmartSearchBarStyle
.
header
.
leftMargin
verticalCenter
:
parent
.
verticalCenter
}
font
{
bold
:
true
pointSize
:
SmartSearchBarStyle
.
header
.
text
.
fontSize
}
color
:
headerContent
.
pressed
Text
{
anchors
{
left
:
parent
.
left
leftMargin
:
SmartSearchBarStyle
.
header
.
leftMargin
verticalCenter
:
parent
.
verticalCenter
}
font
{
bold
:
true
pointSize
:
SmartSearchBarStyle
.
header
.
text
.
fontSize
}
color
:
addContactButton
.
pressed
?
SmartSearchBarStyle
.
header
.
text
.
color
.
pressed
:
SmartSearchBarStyle
.
header
.
text
.
color
.
normal
text
:
qsTr
(
'
addContact
'
)
}
text
:
qsTr
(
'
addContact
'
)
}
Icon
{
anchors
{
right
:
parent
.
right
rightMargin
:
SmartSearchBarStyle
.
header
.
rightMargin
verticalCenter
:
parent
.
verticalCenter
Icon
{
anchors
{
right
:
parent
.
right
rightMargin
:
SmartSearchBarStyle
.
header
.
rightMargin
verticalCenter
:
parent
.
verticalCenter
}
icon
:
'
contact_add
'
iconSize
:
SmartSearchBarStyle
.
header
.
iconSize
}
icon
:
'
contact_add
'
iconSize
:
SmartSearchBarStyle
.
header
.
iconSize
}
}
}
// ---------------------------------------------------------------------------
// Entries.
// ---------------------------------------------------------------------------
delegate
:
Rectangle
{
id
:
s
earchBox
Entry
id
:
s
ipAddress
Entry
color
:
SmartSearchBarStyle
.
entry
.
color
.
normal
height
:
searchBox
.
entryHeight
...
...
@@ -97,9 +178,9 @@ SearchBox {
}
spacing
:
0
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
// Contact or address info.
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
Contact
{
Layout.fillHeight
:
true
...
...
@@ -107,9 +188,9 @@ SearchBox {
entry
:
$entry
}
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
// Actions
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
ActionBar
{
iconSize
:
SmartSearchBarStyle
.
entry
.
iconSize
...
...
@@ -155,7 +236,7 @@ SearchBox {
PropertyChanges
{
color
:
SmartSearchBarStyle
.
entry
.
color
.
hovered
target
:
s
earchBox
Entry
target
:
s
ipAddress
Entry
}
PropertyChanges
{
...
...
tests/ui/modules/Linphone/Styles/SmartSearchBarStyle.qml
View file @
d37c3b81
...
...
@@ -27,7 +27,7 @@ QtObject {
}
property
QtObject
header
:
QtObject
{
property
int
h
eight
:
40
property
int
addButtonH
eight
:
40
property
int
iconSize
:
22
property
int
leftMargin
:
20
property
int
rightMargin
:
10
...
...
tests/ui/views/App/MainWindow/ContactEdit.qml
View file @
d37c3b81
...
...
@@ -89,9 +89,7 @@ ColumnLayout {
_vcard
=
CoreManager
.
createDetachedVcardModel
()
if
(
sipAddress
&&
sipAddress
.
length
>
0
)
{
_vcard
.
addSipAddress
(
Utils
.
startsWith
(
sipAddress
,
'
sip:
'
)
?
sipAddress
:
'
sip:
'
+
sipAddress
)
_vcard
.
addSipAddress
(
sipAddress
)
}
_edition
=
true
...
...
@@ -215,12 +213,8 @@ ColumnLayout {
// -----------------------------------------------------------------------
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
if
(
!
Utils
.
startsWith
(
newValue
,
'
sip:
'
))
{
newValue
=
'
sip:
'
+
newValue
if
(
newValue
===
defaultValue
)
{
return
}
if
(
newValue
===
defaultValue
)
{
return
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
...
...
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