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
5537900b
Commit
5537900b
authored
May 03, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsUi): add a button to remove avatars
parent
277e5d40
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
150 additions
and
59 deletions
+150
-59
en.ts
linphone-desktop/assets/languages/en.ts
+8
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+8
-0
resources.qrc
linphone-desktop/resources.qrc
+1
-0
Utils.hpp
linphone-desktop/src/Utils.hpp
+0
-4
App.cpp
linphone-desktop/src/app/App.cpp
+1
-1
VcardModel.cpp
linphone-desktop/src/components/contact/VcardModel.cpp
+51
-40
VcardModel.hpp
linphone-desktop/src/components/contact/VcardModel.hpp
+21
-10
ContactsListModel.cpp
...one-desktop/src/components/contacts/ContactsListModel.cpp
+12
-0
ContactsListModel.hpp
...one-desktop/src/components/contacts/ContactsListModel.hpp
+2
-0
ContactEdit.js
linphone-desktop/ui/views/App/Main/ContactEdit.js
+15
-3
ContactEdit.qml
linphone-desktop/ui/views/App/Main/ContactEdit.qml
+1
-1
SettingsUi.js
linphone-desktop/ui/views/App/Settings/SettingsUi.js
+19
-0
SettingsUi.qml
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
+11
-0
No files found.
linphone-desktop/assets/languages/en.ts
View file @
5537900b
...
@@ -1110,6 +1110,14 @@ your friend's SIP address or username.</translation>
...
@@ -1110,6 +1110,14 @@ your friend's SIP address or username.</translation>
<
source
>
systemLocale
<
/source
>
<
source
>
systemLocale
<
/source
>
<
translation
>
System
locale
<
/translation
>
<
translation
>
System
locale
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
cleanAvatars
<
/source
>
<
translation
>
CLEAN
AVATARS
<
/translation
>
<
/message
>
<
message
>
<
source
>
cleanAvatarsDescription
<
/source
>
<
translation
>
Are
you
sure
you
want
to
clean
all
avatars
?
<
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
<
name
>
SettingsVideo
<
/name
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
5537900b
...
@@ -1109,6 +1109,14 @@ un chat ou ajouter un contact.</translation>
...
@@ -1109,6 +1109,14 @@ un chat ou ajouter un contact.</translation>
<
source
>
systemLocale
<
/source
>
<
source
>
systemLocale
<
/source
>
<
translation
>
Locale
du
syst
è
me
<
/translation
>
<
translation
>
Locale
du
syst
è
me
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
cleanAvatars
<
/source
>
<
translation
>
SUPPRIMER
AVATARS
<
/translation
>
<
/message
>
<
message
>
<
source
>
cleanAvatarsDescription
<
/source
>
<
translation
>
Voulez
-
vous
vraiment
supprimer
tous
les
avatars
?
<
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
<
name
>
SettingsVideo
<
/name
>
...
...
linphone-desktop/resources.qrc
View file @
5537900b
...
@@ -377,6 +377,7 @@
...
@@ -377,6 +377,7 @@
<file>
ui/views/App/Settings/SettingsSipAccountsEdit.qml
</file>
<file>
ui/views/App/Settings/SettingsSipAccountsEdit.qml
</file>
<file>
ui/views/App/Settings/SettingsSipAccounts.js
</file>
<file>
ui/views/App/Settings/SettingsSipAccounts.js
</file>
<file>
ui/views/App/Settings/SettingsSipAccounts.qml
</file>
<file>
ui/views/App/Settings/SettingsSipAccounts.qml
</file>
<file>
ui/views/App/Settings/SettingsUi.js
</file>
<file>
ui/views/App/Settings/SettingsUi.qml
</file>
<file>
ui/views/App/Settings/SettingsUi.qml
</file>
<file>
ui/views/App/Settings/SettingsVideo.js
</file>
<file>
ui/views/App/Settings/SettingsVideo.js
</file>
<file>
ui/views/App/Settings/SettingsVideoPreview.qml
</file>
<file>
ui/views/App/Settings/SettingsVideoPreview.qml
</file>
...
...
linphone-desktop/src/Utils.hpp
View file @
5537900b
...
@@ -52,10 +52,6 @@ namespace Utils {
...
@@ -52,10 +52,6 @@ namespace Utils {
return
findParentType
<
T
>
(
parent
);
return
findParentType
<
T
>
(
parent
);
}
}
// Bring a window to front.
// See: http://stackoverflow.com/questions/6087887/bring-window-to-front-raise-show-activatewindow-don-t-work
void
smartShowWindow
(
QQuickWindow
*
window
);
// Reverse function of strstr.
// Reverse function of strstr.
char
*
rstrstr
(
const
char
*
a
,
const
char
*
b
);
char
*
rstrstr
(
const
char
*
a
,
const
char
*
b
);
}
}
...
...
linphone-desktop/src/app/App.cpp
View file @
5537900b
...
@@ -303,7 +303,7 @@ void registerType (const char *name) {
...
@@ -303,7 +303,7 @@ void registerType (const char *name) {
}
}
void
App
::
registerTypes
()
{
void
App
::
registerTypes
()
{
qInfo
()
<<
"Registering types..."
;
qInfo
()
<<
QStringLiteral
(
"Registering types..."
)
;
registerType
<
AssistantModel
>
(
"AssistantModel"
);
registerType
<
AssistantModel
>
(
"AssistantModel"
);
registerType
<
AuthenticationNotifier
>
(
"AuthenticationNotifier"
);
registerType
<
AuthenticationNotifier
>
(
"AuthenticationNotifier"
);
...
...
linphone-desktop/src/components/contact/VcardModel.cpp
View file @
5537900b
...
@@ -56,7 +56,8 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const Q
...
@@ -56,7 +56,8 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const Q
return
nullptr
;
return
nullptr
;
}
}
inline
shared_ptr
<
belcard
::
BelCardPhoto
>
findBelCardPhoto
(
const
list
<
shared_ptr
<
belcard
::
BelCardPhoto
>
>
&
photos
)
{
inline
shared_ptr
<
belcard
::
BelCardPhoto
>
findBelcardPhoto
(
const
shared_ptr
<
belcard
::
BelCard
>
&
belcard
)
{
const
list
<
shared_ptr
<
belcard
::
BelCardPhoto
>
>
&
photos
=
belcard
->
getPhotos
();
auto
it
=
find_if
(
auto
it
=
find_if
(
photos
.
cbegin
(),
photos
.
cend
(),
[](
const
shared_ptr
<
belcard
::
BelCardPhoto
>
&
photo
)
{
photos
.
cbegin
(),
photos
.
cend
(),
[](
const
shared_ptr
<
belcard
::
BelCardPhoto
>
&
photo
)
{
return
!
photo
->
getValue
().
compare
(
0
,
sizeof
(
VCARD_SCHEME
)
-
1
,
VCARD_SCHEME
);
return
!
photo
->
getValue
().
compare
(
0
,
sizeof
(
VCARD_SCHEME
)
-
1
,
VCARD_SCHEME
);
...
@@ -69,6 +70,21 @@ inline shared_ptr<belcard::BelCardPhoto> findBelCardPhoto (const list<shared_ptr
...
@@ -69,6 +70,21 @@ inline shared_ptr<belcard::BelCardPhoto> findBelCardPhoto (const list<shared_ptr
return
nullptr
;
return
nullptr
;
}
}
inline
void
removeBelcardPhoto
(
const
shared_ptr
<
belcard
::
BelCard
>
&
belcard
)
{
shared_ptr
<
belcard
::
BelCardPhoto
>
oldPhoto
=
findBelcardPhoto
(
belcard
);
if
(
oldPhoto
)
{
QString
imagePath
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDirPath
()
+
oldPhoto
->
getValue
().
substr
(
sizeof
(
VCARD_SCHEME
)
-
1
)
)
);
if
(
!
QFile
::
remove
(
imagePath
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove `%1`."
).
arg
(
imagePath
);
belcard
->
removePhoto
(
oldPhoto
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
VcardModel
::
VcardModel
(
shared_ptr
<
linphone
::
Vcard
>
vcard
)
{
VcardModel
::
VcardModel
(
shared_ptr
<
linphone
::
Vcard
>
vcard
)
{
...
@@ -77,9 +93,11 @@ VcardModel::VcardModel (shared_ptr<linphone::Vcard> vcard) {
...
@@ -77,9 +93,11 @@ VcardModel::VcardModel (shared_ptr<linphone::Vcard> vcard) {
}
}
VcardModel
::~
VcardModel
()
{
VcardModel
::~
VcardModel
()
{
// If it's a detached Vcard
,
the linked photo must be destroyed from fs.
// If it's a detached Vcard
and if necessary
the linked photo must be destroyed from fs.
if
(
App
::
getInstance
()
->
getEngine
()
->
objectOwnership
(
this
)
!=
QQmlEngine
::
CppOwnership
)
{
if
(
App
::
getInstance
()
->
getEngine
()
->
objectOwnership
(
this
)
!=
QQmlEngine
::
CppOwnership
)
{
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
(
findBelCardPhoto
(
mVcard
->
getVcard
()
->
getPhotos
()));
qInfo
()
<<
QStringLiteral
(
"Destroy detached vcard:"
)
<<
this
;
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
(
findBelcardPhoto
(
mVcard
->
getVcard
()));
if
(
!
photo
)
if
(
!
photo
)
return
;
return
;
...
@@ -92,8 +110,6 @@ VcardModel::~VcardModel () {
...
@@ -92,8 +110,6 @@ VcardModel::~VcardModel () {
if
(
!
QFile
::
remove
(
imagePath
))
if
(
!
QFile
::
remove
(
imagePath
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove `%1`."
).
arg
(
imagePath
);
qWarning
()
<<
QStringLiteral
(
"Unable to remove `%1`."
).
arg
(
imagePath
);
qInfo
()
<<
QStringLiteral
(
"Destroy detached vcard:"
)
<<
this
;
}
else
}
else
qInfo
()
<<
QStringLiteral
(
"Destroy attached vcard:"
)
<<
this
;
qInfo
()
<<
QStringLiteral
(
"Destroy attached vcard:"
)
<<
this
;
}
}
...
@@ -113,24 +129,9 @@ VcardModel *VcardModel::clone () const {
...
@@ -113,24 +129,9 @@ VcardModel *VcardModel::clone () const {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
VcardModel
::
getUsername
()
const
{
return
::
Utils
::
linphoneStringToQString
(
mVcard
->
getFullName
());
}
void
VcardModel
::
setUsername
(
const
QString
&
username
)
{
if
(
username
.
length
()
==
0
||
username
==
getUsername
())
return
;
mVcard
->
setFullName
(
::
Utils
::
qStringToLinphoneString
(
username
));
emit
vcardUpdated
();
}
// -----------------------------------------------------------------------------
QString
VcardModel
::
getAvatar
()
const
{
QString
VcardModel
::
getAvatar
()
const
{
// Find desktop avatar.
// Find desktop avatar.
list
<
shared_ptr
<
belcard
::
BelCardPhoto
>
>
photos
=
mVcard
->
getVcard
()
->
getPhotos
();
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
=
findBelcardPhoto
(
mVcard
->
getVcard
());
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
=
findBelCardPhoto
(
photos
);
// No path found.
// No path found.
if
(
!
photo
)
if
(
!
photo
)
...
@@ -143,6 +144,16 @@ QString VcardModel::getAvatar () const {
...
@@ -143,6 +144,16 @@ QString VcardModel::getAvatar () const {
}
}
bool
VcardModel
::
setAvatar
(
const
QString
&
path
)
{
bool
VcardModel
::
setAvatar
(
const
QString
&
path
)
{
shared_ptr
<
belcard
::
BelCard
>
belcard
=
mVcard
->
getVcard
();
// Remove avatar if path is empty.
if
(
path
.
isEmpty
())
{
removeBelcardPhoto
(
belcard
);
emit
vcardUpdated
();
return
true
;
}
// 1. Try to copy photo in avatars folder.
// 1. Try to copy photo in avatars folder.
QFile
file
(
path
);
QFile
file
(
path
);
...
@@ -162,37 +173,37 @@ bool VcardModel::setAvatar (const QString &path) {
...
@@ -162,37 +173,37 @@ bool VcardModel::setAvatar (const QString &path) {
qInfo
()
<<
QStringLiteral
(
"Update avatar of `%1`. (path=%2)"
).
arg
(
getUsername
()).
arg
(
dest
);
qInfo
()
<<
QStringLiteral
(
"Update avatar of `%1`. (path=%2)"
).
arg
(
getUsername
()).
arg
(
dest
);
// 2. Edit vcard.
// 2. Remove oldest photo.
shared_ptr
<
belcard
::
BelCard
>
belcard
=
mVcard
->
getVcard
();
removeBelcardPhoto
(
belcard
);
list
<
shared_ptr
<
belcard
::
BelCardPhoto
>
>
photos
=
belcard
->
getPhotos
();
// 3. Remove oldest photo.
// 3. Update new photo.
shared_ptr
<
belcard
::
BelCardPhoto
>
oldPhoto
=
findBelCardPhoto
(
photos
);
if
(
oldPhoto
)
{
QString
imagePath
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDirPath
()
+
oldPhoto
->
getValue
().
substr
(
sizeof
(
VCARD_SCHEME
)
-
1
)
)
);
if
(
!
QFile
::
remove
(
imagePath
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove `%1`."
).
arg
(
imagePath
);
belcard
->
removePhoto
(
oldPhoto
);
}
// 4. Update.
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardPhoto
>
();
shared_ptr
<
belcard
::
BelCardPhoto
>
photo
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardPhoto
>
();
photo
->
setValue
(
VCARD_SCHEME
+
::
Utils
::
qStringToLinphoneString
(
fileId
));
photo
->
setValue
(
VCARD_SCHEME
+
::
Utils
::
qStringToLinphoneString
(
fileId
));
emit
vcardUpdated
();
if
(
!
belcard
->
addPhoto
(
photo
))
if
(
!
belcard
->
addPhoto
(
photo
))
return
false
;
return
false
;
emit
vcardUpdated
();
return
true
;
return
true
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
VcardModel
::
getUsername
()
const
{
return
::
Utils
::
linphoneStringToQString
(
mVcard
->
getFullName
());
}
void
VcardModel
::
setUsername
(
const
QString
&
username
)
{
if
(
username
.
length
()
==
0
||
username
==
getUsername
())
return
;
mVcard
->
setFullName
(
::
Utils
::
qStringToLinphoneString
(
username
));
emit
vcardUpdated
();
}
// -----------------------------------------------------------------------------
inline
shared_ptr
<
belcard
::
BelCardAddress
>
getOrCreateBelCardAddress
(
shared_ptr
<
belcard
::
BelCard
>
belcard
)
{
inline
shared_ptr
<
belcard
::
BelCardAddress
>
getOrCreateBelCardAddress
(
shared_ptr
<
belcard
::
BelCard
>
belcard
)
{
list
<
shared_ptr
<
belcard
::
BelCardAddress
>
>
addresses
=
belcard
->
getAddresses
();
list
<
shared_ptr
<
belcard
::
BelCardAddress
>
>
addresses
=
belcard
->
getAddresses
();
shared_ptr
<
belcard
::
BelCardAddress
>
address
;
shared_ptr
<
belcard
::
BelCardAddress
>
address
;
...
...
linphone-desktop/src/components/contact/VcardModel.hpp
View file @
5537900b
...
@@ -41,13 +41,30 @@ class VcardModel : public QObject {
...
@@ -41,13 +41,30 @@ class VcardModel : public QObject {
Q_PROPERTY
(
QVariantList
emails
READ
getEmails
NOTIFY
vcardUpdated
);
Q_PROPERTY
(
QVariantList
emails
READ
getEmails
NOTIFY
vcardUpdated
);
Q_PROPERTY
(
QVariantList
urls
READ
getUrls
NOTIFY
vcardUpdated
);
Q_PROPERTY
(
QVariantList
urls
READ
getUrls
NOTIFY
vcardUpdated
);
// ---------------------------------------------------------------------------
public:
public:
VcardModel
(
std
::
shared_ptr
<
linphone
::
Vcard
>
vcard
);
VcardModel
(
std
::
shared_ptr
<
linphone
::
Vcard
>
vcard
);
~
VcardModel
();
~
VcardModel
();
// ---------------------------------------------------------------------------
QString
getAvatar
()
const
;
bool
setAvatar
(
const
QString
&
path
);
QString
getUsername
()
const
;
QString
getUsername
()
const
;
void
setUsername
(
const
QString
&
username
);
// ---------------------------------------------------------------------------
QVariantList
getSipAddresses
()
const
;
QVariantList
getSipAddresses
()
const
;
QVariantMap
getAddress
()
const
;
QVariantList
getEmails
()
const
;
QVariantList
getCompanies
()
const
;
QVariantList
getUrls
()
const
;
// ---------------------------------------------------------------------------
Q_INVOKABLE
VcardModel
*
clone
()
const
;
Q_INVOKABLE
VcardModel
*
clone
()
const
;
...
@@ -72,20 +89,14 @@ public:
...
@@ -72,20 +89,14 @@ public:
Q_INVOKABLE
void
setPostalCode
(
const
QString
&
postalCode
);
Q_INVOKABLE
void
setPostalCode
(
const
QString
&
postalCode
);
Q_INVOKABLE
void
setCountry
(
const
QString
&
country
);
Q_INVOKABLE
void
setCountry
(
const
QString
&
country
);
// ---------------------------------------------------------------------------
signals:
signals:
void
vcardUpdated
();
void
vcardUpdated
();
private:
// ---------------------------------------------------------------------------
void
setUsername
(
const
QString
&
username
);
QString
getAvatar
()
const
;
bool
setAvatar
(
const
QString
&
path
);
QVariantMap
getAddress
()
const
;
QVariantList
getCompanies
()
const
;
QVariantList
getEmails
()
const
;
QVariantList
getUrls
()
const
;
private:
std
::
shared_ptr
<
linphone
::
Vcard
>
mVcard
;
std
::
shared_ptr
<
linphone
::
Vcard
>
mVcard
;
};
};
...
...
linphone-desktop/src/components/contacts/ContactsListModel.cpp
View file @
5537900b
...
@@ -139,6 +139,18 @@ void ContactsListModel::removeContact (ContactModel *contact) {
...
@@ -139,6 +139,18 @@ void ContactsListModel::removeContact (ContactModel *contact) {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
ContactsListModel
::
cleanAvatars
()
{
qInfo
()
<<
QStringLiteral
(
"Delete all avatars."
);
for
(
const
auto
&
contact
:
mList
)
{
contact
->
startEdit
();
contact
->
getVcardModel
()
->
setAvatar
(
""
);
contact
->
endEdit
();
}
}
// -----------------------------------------------------------------------------
void
ContactsListModel
::
addContact
(
ContactModel
*
contact
)
{
void
ContactsListModel
::
addContact
(
ContactModel
*
contact
)
{
QObject
::
connect
(
QObject
::
connect
(
contact
,
&
ContactModel
::
contactUpdated
,
contact
,
&
ContactModel
::
contactUpdated
,
...
...
linphone-desktop/src/components/contacts/ContactsListModel.hpp
View file @
5537900b
...
@@ -50,6 +50,8 @@ public:
...
@@ -50,6 +50,8 @@ public:
Q_INVOKABLE
ContactModel
*
addContact
(
VcardModel
*
vcard
);
Q_INVOKABLE
ContactModel
*
addContact
(
VcardModel
*
vcard
);
Q_INVOKABLE
void
removeContact
(
ContactModel
*
contact
);
Q_INVOKABLE
void
removeContact
(
ContactModel
*
contact
);
Q_INVOKABLE
void
cleanAvatars
();
signals:
signals:
void
contactAdded
(
ContactModel
*
contact
);
void
contactAdded
(
ContactModel
*
contact
);
void
contactRemoved
(
const
ContactModel
*
contact
);
void
contactRemoved
(
const
ContactModel
*
contact
);
...
...
linphone-desktop/ui/views/App/Main/ContactEdit.js
View file @
5537900b
...
@@ -8,6 +8,19 @@
...
@@ -8,6 +8,19 @@
// =============================================================================
// =============================================================================
function
handleContactUpdated
()
{
var
contact
=
contactEdit
.
_contact
if
(
!
contactEdit
.
_edition
)
{
// Edition ended.
handleVcardChanged
(
contact
.
vcard
)
}
else
{
// Edition not ended, the contact was updated in other place.
// Update fields with new data.
contactEdit
.
_vcard
=
contact
.
vcard
.
clone
()
}
}
function
handleCreation
()
{
function
handleCreation
()
{
var
sipAddress
=
contactEdit
.
sipAddress
var
sipAddress
=
contactEdit
.
sipAddress
var
contact
=
contactEdit
.
_contact
=
Linphone
.
SipAddressesModel
.
mapSipAddressToContact
(
var
contact
=
contactEdit
.
_contact
=
Linphone
.
SipAddressesModel
.
mapSipAddressToContact
(
...
@@ -74,6 +87,8 @@ function save () {
...
@@ -74,6 +87,8 @@ function save () {
var
contact
=
contactEdit
.
_contact
var
contact
=
contactEdit
.
_contact
var
vcard
=
contactEdit
.
_vcard
var
vcard
=
contactEdit
.
_vcard
contactEdit
.
_edition
=
false
if
(
contact
)
{
if
(
contact
)
{
contact
.
vcard
=
vcard
contact
.
vcard
=
vcard
contact
.
endEdit
()
contact
.
endEdit
()
...
@@ -81,8 +96,6 @@ function save () {
...
@@ -81,8 +96,6 @@ function save () {
}
else
{
}
else
{
contactEdit
.
_contact
=
Linphone
.
ContactsListModel
.
addContact
(
vcard
)
contactEdit
.
_contact
=
Linphone
.
ContactsListModel
.
addContact
(
vcard
)
}
}
contactEdit
.
_edition
=
false
}
}
function
cancel
()
{
function
cancel
()
{
...
@@ -121,7 +134,6 @@ function handleValueChanged (fields, index, oldValue, newValue, add, update) {
...
@@ -121,7 +134,6 @@ function handleValueChanged (fields, index, oldValue, newValue, add, update) {
return
return
}
}
console
.
log
(
'
handle
'
,
oldValue
,
newValue
)
var
vcard
=
contactEdit
.
_vcard
var
vcard
=
contactEdit
.
_vcard
var
soFarSoGood
=
(
oldValue
.
length
===
0
)
var
soFarSoGood
=
(
oldValue
.
length
===
0
)
?
vcard
[
add
](
newValue
)
?
vcard
[
add
](
newValue
)
...
...
linphone-desktop/ui/views/App/Main/ContactEdit.qml
View file @
5537900b
...
@@ -39,7 +39,7 @@ ColumnLayout {
...
@@ -39,7 +39,7 @@ ColumnLayout {
sourceComponent
:
Connections
{
sourceComponent
:
Connections
{
target
:
contactEdit
.
_contact
target
:
contactEdit
.
_contact
onContactUpdated
:
Logic
.
handle
VcardChanged
(
contactEdit
.
_contact
.
vcard
)
onContactUpdated
:
Logic
.
handle
ContactUpdated
(
)
}
}
}
}
...
...
linphone-desktop/ui/views/App/Settings/SettingsUi.js
0 → 100644
View file @
5537900b
// =============================================================================
// `SettingsUi.qml` Logic.
// =============================================================================
.
import
Linphone
1.0
as
Linphone
.
import
'
qrc:/ui/scripts/Utils/utils.js
'
as
Utils
// =============================================================================
function
cleanAvatars
()
{
window
.
attachVirtualWindow
(
Utils
.
buildDialogUri
(
'
ConfirmDialog
'
),
{
descriptionText
:
qsTr
(
'
cleanAvatarsDescription
'
),
},
function
(
status
)
{
if
(
status
)
{
Linphone
.
ContactsListModel
.
cleanAvatars
()
}
})
}
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
View file @
5537900b
...
@@ -6,6 +6,8 @@ import Utils 1.0
...
@@ -6,6 +6,8 @@ import Utils 1.0
import
App
.
Styles
1.0
import
App
.
Styles
1.0
import
'
SettingsUi.js
'
as
Logic
// =============================================================================
// =============================================================================
TabContainer
{
TabContainer
{
...
@@ -106,6 +108,15 @@ TabContainer {
...
@@ -106,6 +108,15 @@ TabContainer {
}
}
}
}
}
}
FormEmptyLine
{}
}
TextButtonB
{
anchors.right
:
parent
.
right
text
:
qsTr
(
'
cleanAvatars
'
)
onClicked
:
Logic
.
cleanAvatars
()
}
}
}
}
}
}
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