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
b13763e2
Commit
b13763e2
authored
Dec 15, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui/views/App/MainWindow/ContactEdit): little ui fixes
parent
23f0c854
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
11 deletions
+21
-11
ContactsListModel.cpp
tests/src/components/contacts/ContactsListModel.cpp
+4
-2
ContactsListModel.hpp
tests/src/components/contacts/ContactsListModel.hpp
+1
-1
TransparentTextInput.qml
tests/ui/modules/Common/Form/TransparentTextInput.qml
+6
-4
ContactEdit.qml
tests/ui/views/App/MainWindow/ContactEdit.qml
+10
-4
No files found.
tests/src/components/contacts/ContactsListModel.cpp
View file @
b13763e2
...
@@ -86,7 +86,7 @@ ContactModel *ContactsListModel::mapSipAddressToContact (const QString &sipAddre
...
@@ -86,7 +86,7 @@ ContactModel *ContactsListModel::mapSipAddressToContact (const QString &sipAddre
return
&
friend_
->
getData
<
ContactModel
>
(
ContactModel
::
NAME
);
return
&
friend_
->
getData
<
ContactModel
>
(
ContactModel
::
NAME
);
}
}
void
ContactsListModel
::
addContact
(
VcardModel
*
vcard
)
{
ContactModel
*
ContactsListModel
::
addContact
(
VcardModel
*
vcard
)
{
ContactModel
*
contact
=
new
ContactModel
(
vcard
);
ContactModel
*
contact
=
new
ContactModel
(
vcard
);
App
::
getInstance
()
->
getEngine
()
->
setObjectOwnership
(
contact
,
QQmlEngine
::
CppOwnership
);
App
::
getInstance
()
->
getEngine
()
->
setObjectOwnership
(
contact
,
QQmlEngine
::
CppOwnership
);
...
@@ -98,7 +98,7 @@ void ContactsListModel::addContact (VcardModel *vcard) {
...
@@ -98,7 +98,7 @@ void ContactsListModel::addContact (VcardModel *vcard) {
)
{
)
{
qWarning
()
<<
"Unable to add friend from vcard:"
<<
vcard
;
qWarning
()
<<
"Unable to add friend from vcard:"
<<
vcard
;
delete
contact
;
delete
contact
;
return
;
return
nullptr
;
}
}
int
row
=
rowCount
();
int
row
=
rowCount
();
...
@@ -106,6 +106,8 @@ void ContactsListModel::addContact (VcardModel *vcard) {
...
@@ -106,6 +106,8 @@ void ContactsListModel::addContact (VcardModel *vcard) {
beginInsertRows
(
QModelIndex
(),
row
,
row
);
beginInsertRows
(
QModelIndex
(),
row
,
row
);
m_list
<<
contact
;
m_list
<<
contact
;
endInsertRows
();
endInsertRows
();
return
contact
;
}
}
void
ContactsListModel
::
removeContact
(
ContactModel
*
contact
)
{
void
ContactsListModel
::
removeContact
(
ContactModel
*
contact
)
{
...
...
tests/src/components/contacts/ContactsListModel.hpp
View file @
b13763e2
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
public
slots
:
public
slots
:
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sipAddress
)
const
;
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sipAddress
)
const
;
void
addContact
(
VcardModel
*
vcard
);
ContactModel
*
addContact
(
VcardModel
*
vcard
);
void
removeContact
(
ContactModel
*
contact
);
void
removeContact
(
ContactModel
*
contact
);
private:
private:
...
...
tests/ui/modules/Common/Form/TransparentTextInput.qml
View file @
b13763e2
...
@@ -3,9 +3,9 @@ import QtQuick 2.7
...
@@ -3,9 +3,9 @@ import QtQuick 2.7
import
Common
1.0
import
Common
1.0
import
Common
.
Styles
1.0
import
Common
.
Styles
1.0
// ===================================================================
// ===================================================================
==========
// A editable text that has a background color on focus.
// A editable text that has a background color on focus.
// ===================================================================
// ===================================================================
==========
Item
{
Item
{
property
alias
color
:
textInput
.
color
property
alias
color
:
textInput
.
color
...
@@ -13,11 +13,13 @@ Item {
...
@@ -13,11 +13,13 @@ Item {
property
alias
inputMethodHints
:
textInput
.
inputMethodHints
property
alias
inputMethodHints
:
textInput
.
inputMethodHints
property
alias
readOnly
:
textInput
.
readOnly
property
alias
readOnly
:
textInput
.
readOnly
property
alias
text
:
textInput
.
text
property
alias
text
:
textInput
.
text
property
bool
forceFocus
:
false
property
bool
isInvalid
:
false
property
bool
isInvalid
:
false
property
int
padding
:
TransparentTextInputStyle
.
padding
property
int
padding
:
TransparentTextInputStyle
.
padding
signal
editingFinished
signal
editingFinished
// -----------------------------------------------------------------
// -----------------------------------------------------------------
----------
onActiveFocusChanged
:
{
onActiveFocusChanged
:
{
if
(
activeFocus
)
{
if
(
activeFocus
)
{
...
@@ -28,7 +30,7 @@ Item {
...
@@ -28,7 +30,7 @@ Item {
Rectangle
{
Rectangle
{
id
:
background
id
:
background
color
:
textInput
.
activeFocus
&&
!
textInput
.
readOnly
color
:
(
textInput
.
activeFocus
||
parent
.
forceFocus
)
&&
!
textInput
.
readOnly
?
TransparentTextInputStyle
.
backgroundColor
?
TransparentTextInputStyle
.
backgroundColor
:
// No Style constant, see component name.
:
// No Style constant, see component name.
// It's a `transparent` TextInput.
// It's a `transparent` TextInput.
...
...
tests/ui/views/App/MainWindow/ContactEdit.qml
View file @
b13763e2
...
@@ -30,10 +30,11 @@ ColumnLayout {
...
@@ -30,10 +30,11 @@ ColumnLayout {
function
_save
()
{
function
_save
()
{
if
(
_contact
)
{
if
(
_contact
)
{
_contact
.
endEdit
()
_contact
.
endEdit
()
_edition
=
false
}
else
{
}
else
{
_contact
=
ContactsListModel
.
addContact
(
_vcard
)
_contact
=
ContactsListModel
.
addContact
(
_vcard
)
}
}
_edition
=
false
}
}
function
_cancel
()
{
function
_cancel
()
{
...
@@ -50,8 +51,8 @@ ColumnLayout {
...
@@ -50,8 +51,8 @@ ColumnLayout {
descriptionText
:
qsTr
(
'
removeContactDescription
'
),
descriptionText
:
qsTr
(
'
removeContactDescription
'
),
exitHandler
:
function
(
status
)
{
exitHandler
:
function
(
status
)
{
if
(
status
)
{
if
(
status
)
{
window
.
setView
(
'
Contacts
'
)
ContactsListModel
.
removeContact
(
_contact
)
ContactsListModel
.
removeContact
(
_contact
)
window
.
setView
(
'
Home
'
)
}
}
},
},
title
:
qsTr
(
'
removeContactTitle
'
)
title
:
qsTr
(
'
removeContactTitle
'
)
...
@@ -65,7 +66,7 @@ ColumnLayout {
...
@@ -65,7 +66,7 @@ ColumnLayout {
function
_setUsername
(
username
)
{
function
_setUsername
(
username
)
{
_vcard
.
username
=
username
_vcard
.
username
=
username
// Update current text with new username.
// Update current text with new
/old
username.
usernameInput
.
text
=
_vcard
.
username
usernameInput
.
text
=
_vcard
.
username
}
}
...
@@ -114,6 +115,10 @@ ColumnLayout {
...
@@ -114,6 +115,10 @@ ColumnLayout {
}
}
Component.onDestruction
:
{
Component.onDestruction
:
{
if
(
_edition
&&
_contact
)
{
_contact
.
abortEdit
()
}
// TODO: Remove photo if contact not created.
// TODO: Remove photo if contact not created.
}
}
...
@@ -174,7 +179,8 @@ ColumnLayout {
...
@@ -174,7 +179,8 @@ ColumnLayout {
bold
:
true
bold
:
true
pointSize
:
ContactEditStyle
.
infoBar
.
username
.
fontSize
pointSize
:
ContactEditStyle
.
infoBar
.
username
.
fontSize
}
}
forceFocus
:
true
readOnly
:
!
_edition
text
:
avatar
.
username
text
:
avatar
.
username
onEditingFinished
:
_setUsername
(
text
)
onEditingFinished
:
_setUsername
(
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