123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
- import QtQuick 1.1
- import "../js/core.js" as Core
- import "../parts/"
- KPage {
- id: settingsDialog
- property alias name: userName.text;
- property alias image: selectImage.source
- property alias description: txtDescription.text
- property bool firstExecution: false
- Rectangle{
- anchors.fill: parent
- color: "#e1ecef"
- }
- anchors.fill:parent
- Flickable{
- id: flick
- width: parent.width; height: parent.height-titlebar.height
- contentWidth: parent.width;
- contentHeight: 700
- anchors.top: titlebar.bottom
- Column {
- id: grid1
- spacing: 20
- anchors{
- top:parent.top
- left: parent.left
- right: parent.right
- margins: 10
- }
- KLabel{text:qsTr("Your image"); height: 40;color: "#8f00FF" }
- Image {
- id: selectImage
- width: 128
- height: 128
- source: "qrc:/violet/face"
- MouseArea{
- anchors.fill: parent;
- //onClicked: pageStack.push(Qt.resolvedUrl("ImageSelectionDialog.qml"))
- onClicked: imageSelection.visible= true
- }
- }
- KLabel{id:name; text:qsTr("Name"); height: 40;color: "#8f00FF" }
- KTextInput{
- id:userName;
- width: parent.width
- }
- KLabel{id:description; text:qsTr("Something about your karma"); height: 40;color:"#8f00FF" }
- KTextArea{
- id:txtDescription;
- text: qsTr("I'm a karmic person\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus dictum arcu vitae velit lobortis iaculis. Nam quis lorem sit amet turpis tincidunt malesuada. Sed vitae pulvinar sapien. Ut sem ligula, interdum at pulvinar faucibus, consectetur in ligula. Vestibulum nunc orci, iaculis nec euismod ac, fringilla ac lorem. Proin ac turpis leo, nec placerat diam. Nam non enim orci. Cras vitae accumsan odio. Aenean diam est, rutrum vel tincidunt in, tincidunt non lacus. Pellentesque risus sapien, sagittis et rutrum ut, feugiat id neque. Pellentesque sed leo sed ante condimentum congue. Vivamus accumsan laoreet arcu non consectetur. Phasellus non felis eget elit porta elementum. Vivamus viverra, leo quis egestas egestas, elit neque ultricies lectus, et faucibus enim nisi in orci. ")
- width: parent.width
- //wrapMode: TextEdit.WordWrap
- }
- }
- }
- //Page layout is divided in 3
- TitleBar{
- id: titlebar
- }
- KToolBar{
- KButton{
- text:qsTr("Cancel")
- onClicked: pageStack.pop()
- }
- KButton{
- text:qsTr("Ok")
- onClicked: {
- var item = Core.defaultUserItem();
- item.name = userName.text;
- item.image = image;
- item.description = txtDescription.text
- item.id=1
- Core.updateUser(item);
- if (firstExecution)
- pageStack.push(Qt.resolvedUrl("PersonPage.qml"))
- else
- pageStack.pop()
- }
- }
- }
- //Keys.onPressed:{ console.log("KEY Code es " + event.key);if (event.key == Qt.Key_Up) console.log('--------------------ShowDetails'); }
- ImageSelectionDialog{
- id: imageSelection
- visible:false
- }
- }
|