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
Show 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 () {
...
@@ -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
)
{
bool
SipAddressesModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
return
removeRows
(
row
,
1
,
parent
);
return
removeRows
(
row
,
1
,
parent
);
}
}
...
...
tests/src/components/sip-addresses/SipAddressesModel.hpp
View file @
d37c3b81
...
@@ -27,6 +27,8 @@ public:
...
@@ -27,6 +27,8 @@ public:
Q_INVOKABLE
void
handleAllHistoryEntriesRemoved
();
Q_INVOKABLE
void
handleAllHistoryEntriesRemoved
();
Q_INVOKABLE
QString
interpretUrl
(
const
QString
&
sip_address
);
private:
private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
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 {
...
@@ -19,6 +19,7 @@ Rectangle {
property
alias
usernameColor
:
description
.
usernameColor
property
alias
usernameColor
:
description
.
usernameColor
property
var
entry
property
var
entry
property
var
_contact
:
entry
.
contact
property
var
_contact
:
entry
.
contact
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
...
tests/ui/modules/Linphone/SmartSearchBar.qml
View file @
d37c3b81
...
@@ -19,15 +19,94 @@ SearchBox {
...
@@ -19,15 +19,94 @@ SearchBox {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
header
:
MouseArea
{
header
:
Column
{
id
:
headerContent
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
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
)
}
}
}
}
}
}
// -------------------------------------------------------------------------
// Add contact button.
// -------------------------------------------------------------------------
MouseArea
{
id
:
addContactButton
height
:
SmartSearchBarStyle
.
header
.
addButtonHeight
width
:
parent
.
width
width
:
parent
.
width
onClicked
:
{
onClicked
:
{
searchBox
.
hideMenu
()
searchBox
.
hideMenu
()
searchBox
.
addContact
(
searchBox
.
filter
)
searchBox
.
addContact
(
interpretableSipAddress
)
}
}
Rectangle
{
Rectangle
{
...
@@ -46,7 +125,7 @@ SearchBox {
...
@@ -46,7 +125,7 @@ SearchBox {
bold
:
true
bold
:
true
pointSize
:
SmartSearchBarStyle
.
header
.
text
.
fontSize
pointSize
:
SmartSearchBarStyle
.
header
.
text
.
fontSize
}
}
color
:
headerContent
.
pressed
color
:
addContactButton
.
pressed
?
SmartSearchBarStyle
.
header
.
text
.
color
.
pressed
?
SmartSearchBarStyle
.
header
.
text
.
color
.
pressed
:
SmartSearchBarStyle
.
header
.
text
.
color
.
normal
:
SmartSearchBarStyle
.
header
.
text
.
color
.
normal
text
:
qsTr
(
'
addContact
'
)
text
:
qsTr
(
'
addContact
'
)
...
@@ -63,13 +142,15 @@ SearchBox {
...
@@ -63,13 +142,15 @@ SearchBox {
}
}
}
}
}
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Entries.
// Entries.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
delegate
:
Rectangle
{
delegate
:
Rectangle
{
id
:
s
earchBox
Entry
id
:
s
ipAddress
Entry
color
:
SmartSearchBarStyle
.
entry
.
color
.
normal
color
:
SmartSearchBarStyle
.
entry
.
color
.
normal
height
:
searchBox
.
entryHeight
height
:
searchBox
.
entryHeight
...
@@ -97,9 +178,9 @@ SearchBox {
...
@@ -97,9 +178,9 @@ SearchBox {
}
}
spacing
:
0
spacing
:
0
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
// Contact or address info.
// Contact or address info.
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
Contact
{
Contact
{
Layout.fillHeight
:
true
Layout.fillHeight
:
true
...
@@ -107,9 +188,9 @@ SearchBox {
...
@@ -107,9 +188,9 @@ SearchBox {
entry
:
$entry
entry
:
$entry
}
}
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
// Actions
// Actions
// -------------------------------------------------------------------
--
// -------------------------------------------------------------------
ActionBar
{
ActionBar
{
iconSize
:
SmartSearchBarStyle
.
entry
.
iconSize
iconSize
:
SmartSearchBarStyle
.
entry
.
iconSize
...
@@ -155,7 +236,7 @@ SearchBox {
...
@@ -155,7 +236,7 @@ SearchBox {
PropertyChanges
{
PropertyChanges
{
color
:
SmartSearchBarStyle
.
entry
.
color
.
hovered
color
:
SmartSearchBarStyle
.
entry
.
color
.
hovered
target
:
s
earchBox
Entry
target
:
s
ipAddress
Entry
}
}
PropertyChanges
{
PropertyChanges
{
...
...
tests/ui/modules/Linphone/Styles/SmartSearchBarStyle.qml
View file @
d37c3b81
...
@@ -27,7 +27,7 @@ QtObject {
...
@@ -27,7 +27,7 @@ QtObject {
}
}
property
QtObject
header
:
QtObject
{
property
QtObject
header
:
QtObject
{
property
int
h
eight
:
40
property
int
addButtonH
eight
:
40
property
int
iconSize
:
22
property
int
iconSize
:
22
property
int
leftMargin
:
20
property
int
leftMargin
:
20
property
int
rightMargin
:
10
property
int
rightMargin
:
10
...
...
tests/ui/views/App/MainWindow/ContactEdit.qml
View file @
d37c3b81
...
@@ -89,9 +89,7 @@ ColumnLayout {
...
@@ -89,9 +89,7 @@ ColumnLayout {
_vcard
=
CoreManager
.
createDetachedVcardModel
()
_vcard
=
CoreManager
.
createDetachedVcardModel
()
if
(
sipAddress
&&
sipAddress
.
length
>
0
)
{
if
(
sipAddress
&&
sipAddress
.
length
>
0
)
{
_vcard
.
addSipAddress
(
_vcard
.
addSipAddress
(
sipAddress
)
Utils
.
startsWith
(
sipAddress
,
'
sip:
'
)
?
sipAddress
:
'
sip:
'
+
sipAddress
)
}
}
_edition
=
true
_edition
=
true
...
@@ -215,13 +213,9 @@ ColumnLayout {
...
@@ -215,13 +213,9 @@ ColumnLayout {
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
if
(
!
Utils
.
startsWith
(
newValue
,
'
sip:
'
))
{
newValue
=
'
sip:
'
+
newValue
if
(
newValue
===
defaultValue
)
{
if
(
newValue
===
defaultValue
)
{
return
return
}
}
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addSipAddress
(
newValue
)
?
_vcard
.
addSipAddress
(
newValue
)
...
...
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