2
import Ubuntu.Components 0.1
3
import Ubuntu.Components.Popups 0.1
4
import "../js/localStorage.js" as Settings
5
import QtQuick.LocalStorage 2.0
11
id: editProfileDialogue
12
title: i18n.tr("Edit profile")
24
anchors.horizontalCenter: parent.horizontalCenter
27
text: Settings.getUserLastName(editUserId)
28
placeholderText: i18n.tr("Lastname")
36
anchors.horizontalCenter: parent.horizontalCenter
39
anchors.horizontalCenter: parent.horizontalCenter
40
placeholderText: i18n.tr("Firstname")
41
text: Settings.getUserFirstName(editUserId)
52
buttonText: i18n.tr("OK")
53
width: parent.width/2;
57
if(lastnameField.text!="" && firstnameField.text!="")
60
if(!Settings.existProfile( lastnameField.text, firstnameField.text))
63
Settings.updateProfile(editUserId, lastnameField.text, firstnameField.text);
64
var userId = currentUserId
66
currentUserId = userId
68
PopupUtils.close(editProfileDialogue)
70
PopupUtils.close(editProfileDialogue)
75
mainView.showAlert(i18n.tr("Warning"), i18n.tr("Lastname and firstname must not be empty."), okButton)
86
buttonText: i18n.tr("Delete")
87
width: parent.width/2;
90
Settings.deleteProfile(editUserId)
91
if(editUserId == currentUserId)
95
PopupUtils.close(editProfileDialogue)
100
anchors.horizontalCenter: parent.horizontalCenter
101
buttonText: i18n.tr("Cancel")
102
width: parent.width/2;
105
PopupUtils.close(editProfileDialogue)