123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- import QtQuick 1.0
- import "content"
- Column{
- id: screen
- width: 360
- height: 360
- //spacing: 30
- property int frameMargin: 10
- property int rowHeight: 60
- property int margin: 20
- property string brgndColour: "#469e63"
- Rectangle {
- id: cataloguePane
- width: parent.width
- height: parent.height - optionbar.height - screen.spacing
- color: screen.brgndColour
- BusyIndicator {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- on: listView.model.isApplicationBusy
- }
- ListView {
- id: listView
- anchors.fill: parent
- anchors.margins: screen.margin
- spacing: screen.margin
- Component {
- id: drmListDelegate
- Item {
- id: productRow
- width: listView.width; height: screen.rowHeight
- clip: true
- Row {
- spacing: screen.frameMargin
- Image {
- //NOTE image provider caches data, the side effect is updated image is not shown
- source: (isActivated === true) ? "image://imagestatusprovider/"+index : //persistent , allow caching
- //else disable caching
- // workaround for http://bugreports.qt.nokia.com/browse/QTBUG-14900
- "image://imagestatusprovider/"+index+
- "ignoringpart" + Qt.formatTime(new Date(), "hhmmsszzz")
- width: screen.rowHeight
- height: screen.rowHeight
- MouseArea {
- anchors.fill:parent
- onClicked: {
- console.log("onClicked")
- if(isDataKnown === true && isActivated === false){
- drmListModel.buy(index)
- }
- }
- }
- }
- BusyIndicator {
- anchors.verticalCenter: parent.verticalCenter
- width: screen.rowHeight / 2
- height: screen.rowHeight / 2
- on: isBusy
- }
- Text {
- anchors.verticalCenter: parent.verticalCenter
- text: (isDataKnown === true) ?
- (productid + "; " +reqresult + "; " +
- tile + "; " +
- shortDescr + "; " +
- longDescr + "; " +
- price)
- : productid + "; <UNKNOWN>"
- }
- }
- }
- }
- model: drmListModel
- delegate: drmListDelegate
- }
- }
- Rectangle{
- id: optionbar
- width: parent.width
- height:
- ((restoreBtn.width + purgeBtn.width +
- userInfoBtn.width + exitBtn.width +
- screen.margin * 6) <= width) ? restoreBtn.height + screen.margin :
- (restoreBtn.height + screen.margin) * 2
- gradient: Gradient {
- GradientStop {
- position: 0.00;
- color: screen.brgndColour;
- }
- GradientStop {
- position: 1.00;
- color: "black";
- }
- }
- Flow{
- spacing: screen.margin
- width: parent.width
- Button {
- id: restoreBtn
- text: "Restore"
- onClicked: listView.model.restoreProducts()
- }
- Button {
- id: purgeBtn
- text: "Purge"
- onClicked: listView.model.purgeProducts()
- }
- Button {
- id: userInfoBtn
- text: "User info"
- onClicked: listView.model.getUserInfo()
- }
- Button {
- id: exitBtn
- text: "Exit"
- onClicked: Qt.quit()
- }
- }
- }
- }
|