/* Copyright (C) 2011 by Cuong Le This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see */ import QtQuick 1.0 import "Settings.js" as Settings Item{ Rectangle { id: rectangle1 anchors.fill: parent; anchors.bottomMargin: 0 visible: true opacity:0.9 Component { id: listDelegate Rectangle { height:60 Rectangle { width:rectangle1.width; y:0; x:0 height:1 border.color: "#b57e8f" } Text { id: text1 text:name font.pixelSize: 21 font.family: "Nokia Sans" x:20 anchors.verticalCenter: parent.verticalCenter } Switch { id: switch_me x:rectangle1.width-220 onSwitched:{ listModel.setProperty(index, "selected", switchedOn); } switchedOn: selected anchors.verticalCenter: parent.verticalCenter } } } ListModel { id: listModel Component.onCompleted: { Settings.restore(listModel); var cdx = Settings.chedoxoay(); ROOT.initScreenOrientation(cdx); } } ListView { id: listView anchors.fill: parent;anchors.topMargin: 45;anchors.leftMargin: 0; model: listModel delegate: listDelegate focus: true } } ToolBar { id: toolBar; height: 50; y: screen.height-78 width: parent.width; button1Label: "Đồng Ý" button2Label: "Hủy Bỏ" onButton1Clicked: { Settings.save(listModel) screen.state="mainscreen" var cdx = Settings.chedoxoay(); ROOT.initScreenOrientation(cdx); } onButton2Clicked: { Settings.restore(listModel) screen.state="mainscreen" } } transitions: [ Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } } ] }