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
3839f917
Commit
3839f917
authored
Dec 16, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/MainWindow/ContactEdit): display contact addresses
parent
534c5f0a
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
343 additions
and
151 deletions
+343
-151
en.ts
tests/assets/languages/en.ts
+37
-5
fr.ts
tests/assets/languages/fr.ts
+36
-8
resources.qrc
tests/resources.qrc
+1
-0
ActionSwitch.qml
tests/ui/modules/Common/Form/ActionSwitch.qml
+2
-2
ExclusiveButtons.qml
tests/ui/modules/Common/Form/ExclusiveButtons.qml
+1
-1
StaticListForm.qml
tests/ui/modules/Common/Form/StaticListForm.qml
+54
-0
TransparentTextInput.qml
tests/ui/modules/Common/Form/TransparentTextInput.qml
+24
-3
TransparentTextInputStyle.qml
.../modules/Common/Styles/Form/TransparentTextInputStyle.qml
+12
-3
qmldir
tests/ui/modules/Common/qmldir
+1
-0
ContactEdit.qml
tests/ui/views/App/MainWindow/ContactEdit.qml
+175
-129
No files found.
tests/assets/languages/en.ts
View file @
3839f917
...
@@ -112,11 +112,11 @@
...
@@ -112,11 +112,11 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
sipAccountsInput
<
/source
>
<
source
>
sipAccountsInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
SIP
Address
<
/translation
>
<
translation
type
=
"
obsolete
"
>
SIP
Address
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
address
<
/source
>
<
source
>
address
<
/source
>
<
translation
type
=
"
obsolete
"
>
ADDRESS
<
/translation
>
<
translation
type
=
"
unfinished
"
>
ADDRESS
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
addressInput
<
/source
>
<
source
>
addressInput
<
/source
>
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
emailsInput
<
/source
>
<
source
>
emailsInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
E
-
mail
address
<
/translation
>
<
translation
type
=
"
obsolete
"
>
E
-
mail
address
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
webSites
<
/source
>
<
source
>
webSites
<
/source
>
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
webSitesInput
<
/source
>
<
source
>
webSitesInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
URL
<
/translation
>
<
translation
type
=
"
obsolete
"
>
URL
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
avatarChooserTitle
<
/source
>
<
source
>
avatarChooserTitle
<
/source
>
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
companiesInput
<
/source
>
<
source
>
companiesInput
<
/source
>
<
translation
>
Company
<
/translation
>
<
translation
type
=
"
vanished
"
>
Company
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
companies
<
/source
>
<
source
>
companies
<
/source
>
...
@@ -158,6 +158,38 @@
...
@@ -158,6 +158,38 @@
<
source
>
cancel
<
/source
>
<
source
>
cancel
<
/source
>
<
translation
>
CANCEL
<
/translation
>
<
translation
>
CANCEL
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
sipAccountsPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
companiesPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
emailsPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
webSitesPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
street
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
postalCode
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
country
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
locality
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
Contacts
<
/name
>
<
name
>
Contacts
<
/name
>
...
...
tests/assets/languages/fr.ts
View file @
3839f917
...
@@ -104,11 +104,11 @@
...
@@ -104,11 +104,11 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
sipAccountsInput
<
/source
>
<
source
>
sipAccountsInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
Adresse
SIP
<
/translation
>
<
translation
type
=
"
obsolete
"
>
Adresse
SIP
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
address
<
/source
>
<
source
>
address
<
/source
>
<
translation
type
=
"
obsolete
"
>
ADRESSE
(
S
)
<
/translation
>
<
translation
type
=
"
unfinished
"
>
ADRESSE
(
S
)
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
addressInput
<
/source
>
<
source
>
addressInput
<
/source
>
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
emailsInput
<
/source
>
<
source
>
emailsInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
Adresse
e
-
mail
<
/translation
>
<
translation
type
=
"
obsolete
"
>
Adresse
e
-
mail
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
webSites
<
/source
>
<
source
>
webSites
<
/source
>
...
@@ -128,16 +128,12 @@
...
@@ -128,16 +128,12 @@
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
webSitesInput
<
/source
>
<
source
>
webSitesInput
<
/source
>
<
translation
type
=
"
unfinished
"
>
URL
<
/translation
>
<
translation
type
=
"
obsolete
"
>
URL
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
message
>
<
source
>
avatarChooserTitle
<
/source
>
<
source
>
avatarChooserTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
companiesInput
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
message
>
<
source
>
companies
<
/source
>
<
source
>
companies
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
><
/translation
>
...
@@ -150,6 +146,38 @@
...
@@ -150,6 +146,38 @@
<
source
>
cancel
<
/source
>
<
source
>
cancel
<
/source
>
<
translation
type
=
"
unfinished
"
>
ANNULER
<
/translation
>
<
translation
type
=
"
unfinished
"
>
ANNULER
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
sipAccountsPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
companiesPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
emailsPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
webSitesPlaceholder
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
street
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
postalCode
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
country
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
locality
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
Contacts
<
/name
>
<
name
>
Contacts
<
/name
>
...
...
tests/resources.qrc
View file @
3839f917
...
@@ -143,6 +143,7 @@
...
@@ -143,6 +143,7 @@
<file>
ui/modules/Common/Form/ExclusiveButtons.qml
</file>
<file>
ui/modules/Common/Form/ExclusiveButtons.qml
</file>
<file>
ui/modules/Common/Form/ListForm.qml
</file>
<file>
ui/modules/Common/Form/ListForm.qml
</file>
<file>
ui/modules/Common/Form/SmallButton.qml
</file>
<file>
ui/modules/Common/Form/SmallButton.qml
</file>
<file>
ui/modules/Common/Form/StaticListForm.qml
</file>
<file>
ui/modules/Common/Form/TextButtonA.qml
</file>
<file>
ui/modules/Common/Form/TextButtonA.qml
</file>
<file>
ui/modules/Common/Form/TextButtonB.qml
</file>
<file>
ui/modules/Common/Form/TextButtonB.qml
</file>
<file>
ui/modules/Common/Form/TextField.qml
</file>
<file>
ui/modules/Common/Form/TextField.qml
</file>
...
...
tests/ui/modules/Common/Form/ActionSwitch.qml
View file @
3839f917
import
QtQuick
2.7
import
QtQuick
2.7
// ===================================================================
// ===================================================================
==========
Item
{
Item
{
property
alias
useStates
:
actionButton
.
useStates
property
alias
useStates
:
actionButton
.
useStates
...
@@ -10,7 +10,7 @@ Item {
...
@@ -10,7 +10,7 @@ Item {
signal
clicked
signal
clicked
// -----------------------------------------------------------------
// -----------------------------------------------------------------
----------
height
:
iconSize
||
parent
.
iconSize
||
parent
.
height
height
:
iconSize
||
parent
.
iconSize
||
parent
.
height
width
:
iconSize
||
parent
.
iconSize
||
parent
.
height
width
:
iconSize
||
parent
.
iconSize
||
parent
.
height
...
...
tests/ui/modules/Common/Form/ExclusiveButtons.qml
View file @
3839f917
...
@@ -2,7 +2,7 @@ import QtQuick 2.7
...
@@ -2,7 +2,7 @@ import QtQuick 2.7
import
Common
.
Styles
1.0
import
Common
.
Styles
1.0
// ===================================================================
// ===================================================================
==========
Row
{
Row
{
id
:
item
id
:
item
...
...
tests/ui/modules/Common/Form/StaticListForm.qml
0 → 100644
View file @
3839f917
import
QtQuick
2.7
import
QtQuick
.
Layouts
1.3
import
Common
.
Styles
1.0
// =============================================================================
RowLayout
{
id
:
form
property
alias
title
:
text
.
text
property
bool
readOnly
:
false
property
var
fields
// ---------------------------------------------------------------------------
spacing
:
0
Text
{
id
:
text
Layout.leftMargin
:
ListFormStyle
.
titleArea
.
iconSize
+
ListFormStyle
.
titleArea
.
spacing
Layout.preferredHeight
:
ListFormStyle
.
lineHeight
Layout.preferredWidth
:
ListFormStyle
.
titleArea
.
text
.
width
Layout.alignment
:
Qt
.
AlignTop
color
:
ListFormStyle
.
titleArea
.
text
.
color
elide
:
Text
.
ElideRight
font
{
bold
:
true
pointSize
:
ListFormStyle
.
titleArea
.
text
.
fontSize
}
verticalAlignment
:
Text
.
AlignVCenter
}
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
0
Repeater
{
model
:
form
.
fields
TransparentTextInput
{
Layout.fillWidth
:
true
Layout.preferredHeight
:
ListFormStyle
.
lineHeight
placeholder
:
modelData
.
placeholder
||
''
readOnly
:
form
.
readOnly
text
:
modelData
.
text
||
''
}
}
}
}
tests/ui/modules/Common/Form/TransparentTextInput.qml
View file @
3839f917
...
@@ -11,6 +11,7 @@ Item {
...
@@ -11,6 +11,7 @@ Item {
property
alias
color
:
textInput
.
color
property
alias
color
:
textInput
.
color
property
alias
font
:
textInput
.
font
property
alias
font
:
textInput
.
font
property
alias
inputMethodHints
:
textInput
.
inputMethodHints
property
alias
inputMethodHints
:
textInput
.
inputMethodHints
property
alias
placeholder
:
placeholder
.
text
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
forceFocus
:
false
...
@@ -59,17 +60,37 @@ Item {
...
@@ -59,17 +60,37 @@ Item {
visible
:
parent
.
isInvalid
visible
:
parent
.
isInvalid
}
}
Text
{
id
:
placeholder
anchors.centerIn
:
parent
color
:
TransparentTextInputStyle
.
placeholder
.
color
elide
:
Text
.
ElideRight
font
{
italic
:
true
pointSize
:
TransparentTextInputStyle
.
placeholder
.
fontSize
}
height
:
textInput
.
height
width
:
textInput
.
width
verticalAlignment
:
Text
.
AlignVCenter
visible
:
textInput
.
text
.
length
===
0
&&
!
textInput
.
activeFocus
&&
!
textInput
.
readOnly
}
TextInput
{
TextInput
{
id
:
textInput
id
:
textInput
anchors.centerIn
:
parent
anchors.centerIn
:
parent
height
:
parent
.
height
-
parent
.
padding
*
2
height
:
parent
.
height
width
:
parent
.
width
-
parent
.
padding
*
2
width
:
parent
.
width
-
parent
.
padding
*
2
clip
:
true
clip
:
true
color
:
activeFocus
&&
!
readOnly
color
:
activeFocus
&&
!
readOnly
?
TransparentTextInputStyle
.
textColor
.
focused
?
TransparentTextInputStyle
.
text
.
color
.
focused
:
TransparentTextInputStyle
.
textColor
.
normal
:
TransparentTextInputStyle
.
text
.
color
.
normal
font.pointSize
:
TransparentTextInputStyle
.
text
.
fontSize
selectByMouse
:
true
selectByMouse
:
true
verticalAlignment
:
TextInput
.
AlignVCenter
verticalAlignment
:
TextInput
.
AlignVCenter
...
...
tests/ui/modules/Common/Styles/Form/TransparentTextInputStyle.qml
View file @
3839f917
...
@@ -10,8 +10,17 @@ QtObject {
...
@@ -10,8 +10,17 @@ QtObject {
property
int
iconSize
:
12
property
int
iconSize
:
12
property
int
padding
:
10
property
int
padding
:
10
property
QtObject
textColor
:
QtObject
{
property
QtObject
placeholder
:
QtObject
{
property
color
color
:
Colors
.
w
property
int
fontSize
:
10
}
property
QtObject
text
:
QtObject
{
property
int
fontSize
:
10
property
QtObject
color
:
QtObject
{
property
color
focused
:
Colors
.
l
property
color
focused
:
Colors
.
l
property
color
normal
:
Colors
.
r
property
color
normal
:
Colors
.
r
}
}
}
}
}
tests/ui/modules/Common/qmldir
View file @
3839f917
...
@@ -38,6 +38,7 @@ CheckBoxText 1.0 Form/CheckBoxText.qml
...
@@ -38,6 +38,7 @@ CheckBoxText 1.0 Form/CheckBoxText.qml
ExclusiveButtons 1.0 Form/ExclusiveButtons.qml
ExclusiveButtons 1.0 Form/ExclusiveButtons.qml
LightButton 1.0 Form/LightButton.qml
LightButton 1.0 Form/LightButton.qml
ListForm 1.0 Form/ListForm.qml
ListForm 1.0 Form/ListForm.qml
StaticListForm 1.0 Form/StaticListForm.qml
TextButtonA 1.0 Form/TextButtonA.qml
TextButtonA 1.0 Form/TextButtonA.qml
TextButtonB 1.0 Form/TextButtonB.qml
TextButtonB 1.0 Form/TextButtonB.qml
TextField 1.0 Form/TextField.qml
TextField 1.0 Form/TextField.qml
...
...
tests/ui/views/App/MainWindow/ContactEdit.qml
View file @
3839f917
...
@@ -70,35 +70,6 @@ ColumnLayout {
...
@@ -70,35 +70,6 @@ ColumnLayout {
usernameInput
.
text
=
_vcard
.
username
usernameInput
.
text
=
_vcard
.
username
}
}
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
if
(
!
Utils
.
startsWith
(
newValue
,
'
sip:
'
))
{
newValue
=
'
sip:
'
+
newValue
if
(
newValue
===
defaultValue
)
{
return
}
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addSipAddress
(
newValue
)
:
_vcard
.
updateSipAddress
(
defaultValue
,
newValue
)
addresses
.
setInvalid
(
index
,
!
so_far_so_good
)
}
function
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
{
var
url
=
Utils
.
extractFirstUri
(
newValue
)
if
(
url
===
defaultValue
)
{
return
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
url
&&
_vcard
.
addUrl
(
newValue
)
:
url
&&
_vcard
.
updateUrl
(
defaultValue
,
newValue
)
urls
.
setInvalid
(
index
,
!
so_far_so_good
)
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
spacing
:
0
spacing
:
0
...
@@ -218,11 +189,63 @@ ColumnLayout {
...
@@ -218,11 +189,63 @@ ColumnLayout {
// Info list.
// Info list.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Flickable
{
Loader
{
id
:
flick
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
active
:
_vcard
!=
null
sourceComponent
:
Flickable
{
id
:
flick
// -----------------------------------------------------------------------
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
if
(
!
Utils
.
startsWith
(
newValue
,
'
sip:
'
))
{
newValue
=
'
sip:
'
+
newValue
if
(
newValue
===
defaultValue
)
{
return
}
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addSipAddress
(
newValue
)
:
_vcard
.
updateSipAddress
(
defaultValue
,
newValue
)
addresses
.
setInvalid
(
index
,
!
so_far_so_good
)
}
function
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
{
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addCompany
(
newValue
)
:
_vcard
.
updateCompany
(
defaultValue
,
newValue
)
companies
.
setInvalid
(
index
,
!
so_far_so_good
)
}
function
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
{
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addEmail
(
newValue
)
:
_vcard
.
updateEmail
(
defaultValue
,
newValue
)
emails
.
setInvalid
(
index
,
!
so_far_so_good
)
}
function
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
{
var
url
=
Utils
.
extractFirstUri
(
newValue
)
if
(
url
===
defaultValue
)
{
return
}
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
url
&&
_vcard
.
addUrl
(
newValue
)
:
url
&&
_vcard
.
updateUrl
(
defaultValue
,
newValue
)
urls
.
setInvalid
(
index
,
!
so_far_so_good
)
}
// -----------------------------------------------------------------------
ScrollBar.vertical
:
ForceScrollBar
{}
ScrollBar.vertical
:
ForceScrollBar
{}
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
...
@@ -245,7 +268,7 @@ ColumnLayout {
...
@@ -245,7 +268,7 @@ ColumnLayout {
defaultData
:
_vcard
.
sipAddresses
defaultData
:
_vcard
.
sipAddresses
minValues
:
_contact
?
1
:
0
minValues
:
_contact
?
1
:
0
placeholder
:
qsTr
(
'
sipAccountsInput
'
)
placeholder
:
qsTr
(
'
sipAccountsPlaceholder
'
)
readOnly
:
!
_edition
readOnly
:
!
_edition
title
:
qsTr
(
'
sipAccounts
'
)
title
:
qsTr
(
'
sipAccounts
'
)
...
@@ -266,13 +289,11 @@ ColumnLayout {
...
@@ -266,13 +289,11 @@ ColumnLayout {
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
defaultData
:
_vcard
.
companies
defaultData
:
_vcard
.
companies
placeholder
:
qsTr
(
'
companiesInput
'
)
placeholder
:
qsTr
(
'
companiesPlaceholder
'
)
readOnly
:
!
_edition
readOnly
:
!
_edition
title
:
qsTr
(
'
companies
'
)
title
:
qsTr
(
'
companies
'
)
onChanged
:
defaultValue
.
length
===
0
onChanged
:
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
?
_vcard
.
addCompany
(
newValue
)
:
_vcard
.
updateCompany
(
defaultValue
,
newValue
)
onRemoved
:
_vcard
.
removeCompany
(
value
)
onRemoved
:
_vcard
.
removeCompany
(
value
)
}
}
...
@@ -290,13 +311,11 @@ ColumnLayout {
...
@@ -290,13 +311,11 @@ ColumnLayout {
defaultData
:
_vcard
.
emails
defaultData
:
_vcard
.
emails
inputMethodHints
:
Qt
.
ImhEmailCharactersOnly
inputMethodHints
:
Qt
.
ImhEmailCharactersOnly
placeholder
:
qsTr
(
'
emailsInput
'
)
placeholder
:
qsTr
(
'
emailsPlaceholder
'
)
readOnly
:
!
_edition
readOnly
:
!
_edition
title
:
qsTr
(
'
emails
'
)
title
:
qsTr
(
'
emails
'
)
onChanged
:
defaultValue
.
length
===
0
onChanged
:
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
?
_vcard
.
addEmail
(
newValue
)
:
_vcard
.
updateEmail
(
defaultValue
,
newValue
)
onRemoved
:
_vcard
.
removeEmail
(
value
)
onRemoved
:
_vcard
.
removeEmail
(
value
)
}
}
...
@@ -314,7 +333,7 @@ ColumnLayout {
...
@@ -314,7 +333,7 @@ ColumnLayout {
defaultData
:
_vcard
.
urls
defaultData
:
_vcard
.
urls
inputMethodHints
:
Qt
.
ImhUrlCharactersOnly
inputMethodHints
:
Qt
.
ImhUrlCharactersOnly
placeholder
:
qsTr
(
'
webSitesInput
'
)
placeholder
:
qsTr
(
'
webSitesPlaceholder
'
)
readOnly
:
!
_edition
readOnly
:
!
_edition
title
:
qsTr
(
'
webSites
'
)
title
:
qsTr
(
'
webSites
'
)
...
@@ -328,9 +347,35 @@ ColumnLayout {
...
@@ -328,9 +347,35 @@ ColumnLayout {
color
:
ContactEditStyle
.
values
.
separator
.
color
color
:
ContactEditStyle
.
values
.
separator
.
color
}
}
// -----------------------------------------------------------------------
StaticListForm
{
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
fields
:
{
var
address
=
_vcard
.
address
return
[{
placeholder
:
qsTr
(
'
street
'
),
text
:
address
.
street
},
{
placeholder
:
qsTr
(
'
locality
'
),
text
:
address
.
locality
},
{
placeholder
:
qsTr
(
'
postalCode
'
),
text
:
address
.
postalCode
},
{
placeholder
:
qsTr
(
'
country
'
),
text
:
address
.
country
}]
}
readOnly
:
!
_edition
title
:
qsTr
(
'
address
'
)
}
// ---------------------------------------------------------------------
// Edition buttons.
// Edition buttons.
// --
---------------------------------------------------------------------
//
---------------------------------------------------------------------
Row
{
Row
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
...
@@ -338,16 +383,16 @@ ColumnLayout {
...
@@ -338,16 +383,16 @@ ColumnLayout {
spacing
:
ContactEditStyle
.
buttons
.
spacing
spacing
:
ContactEditStyle
.
buttons
.
spacing
visible
:
_edition
visible
:
_edition
TextButtonA
{
text
:
qsTr
(
'
cancel
'
)
onClicked
:
_cancel
()
}
TextButtonB
{
TextButtonB
{
enabled
:
usernameInput
.
text
.
length
>
0
&&
_vcard
.
sipAddresses
.
length
>
0
enabled
:
usernameInput
.
text
.
length
>
0
&&
_vcard
.
sipAddresses
.
length
>
0
text
:
qsTr
(
'
save
'
)
text
:
qsTr
(
'
save
'
)
onClicked
:
_save
()
onClicked
:
_save
()
}
}
TextButtonA
{
text
:
qsTr
(
'
cancel
'
)
onClicked
:
_cancel
()
}
}
}
Item
{
Item
{
...
@@ -355,4 +400,5 @@ ColumnLayout {
...
@@ -355,4 +400,5 @@ ColumnLayout {
}
}
}
}
}
}
}
}
}
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