diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-09-03 07:55:24 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-09-03 07:55:24 (GMT) |
commit | 2ed054843498b703becf099e885aadc925d85195 (patch) | |
tree | c65f29485dc7625061850282f40a46366875b085 /demos | |
parent | 4caad879cd9a71b26690728e338ad090fa6591d6 (diff) | |
download | Qt-2ed054843498b703becf099e885aadc925d85195.zip Qt-2ed054843498b703becf099e885aadc925d85195.tar.gz Qt-2ed054843498b703becf099e885aadc925d85195.tar.bz2 |
Fix some twitter demo bugs
Includes making the update button work and clearing the post box on post
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/twitter/content/AuthView.qml | 2 | ||||
-rw-r--r-- | demos/declarative/twitter/content/HomeTitleBar.qml | 17 | ||||
-rw-r--r-- | demos/declarative/twitter/twitter.qml | 1 |
3 files changed, 11 insertions, 9 deletions
diff --git a/demos/declarative/twitter/content/AuthView.qml b/demos/declarative/twitter/content/AuthView.qml index 6bd98b9..9ca4d88 100644 --- a/demos/declarative/twitter/content/AuthView.qml +++ b/demos/declarative/twitter/content/AuthView.qml @@ -85,7 +85,7 @@ Item { height: 32 id: guest text: "Guest" - onClicked: RssModel.authName='inv' + onClicked: {RssModel.authName='-'; Screen.setMode(true);} } } } diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml index 878a83e..5cb8bea 100644 --- a/demos/declarative/twitter/content/HomeTitleBar.qml +++ b/demos/declarative/twitter/content/HomeTitleBar.qml @@ -3,7 +3,7 @@ import "../../flickr/mobile" import "../../flickr/common" Item { - id: TitleBar + id: titleBar signal update() onYChanged: state="" //When switching titlebars @@ -23,12 +23,13 @@ Item { postman.open("POST", "http://twitter.com/statuses/update.xml", true, RssModel.authName, RssModel.authPass); postman.onreadystatechange = function() { if (postman.readyState == postman.DONE) { - TitleBar.update(); + titleBar.update(); } } postman.send(postData); - TitleBar.state = "" + Editor.text = "" + titleBar.state = "" } } @@ -57,15 +58,15 @@ Item { } Button { - id: TagButton; x: TitleBar.width - 90; width: 85; height: 32; text: "New Post..." + id: TagButton; x: titleBar.width - 90; width: 85; height: 32; text: "New Post..." anchors.verticalCenter: parent.verticalCenter; - onClicked: if (TitleBar.state == "Posting") accept(); else TitleBar.state = "Posting" + onClicked: if (titleBar.state == "Posting") accept(); else titleBar.state = "Posting" } Text { id: charsLeftText; anchors.horizontalCenter: TagButton.horizontalCenter; anchors.top: TagButton.bottom; anchors.topMargin: 2 - text: {140 - Editor.text.length;} visible: TitleBar.state == "Posting" + text: {140 - Editor.text.length;} visible: titleBar.state == "Posting" font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" } Item { @@ -101,7 +102,7 @@ Item { Item { id: ReturnKey Keys.onReturnPressed: accept() - Keys.onEscapePressed: TitleBar.state = "" + Keys.onEscapePressed: titleBar.state = "" } } } @@ -109,7 +110,7 @@ Item { State { name: "Posting" PropertyChanges { target: Container; x: -TagButton.x + 5 } - PropertyChanges { target: TitleBar; height: 80 } + PropertyChanges { target: titleBar; height: 80 } PropertyChanges { target: TagButton; text: "OK" } PropertyChanges { target: TagButton; width: 28 } PropertyChanges { target: TagButton; height: 24 } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index e467f82..14075bf 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -67,6 +67,7 @@ Item { width: parent.width; opacity: 0.9 button1Label: "Update" button2Label: "View others" + onButton1Clicked: RssModel.reload(); onButton2Clicked: { if(Screen.userView == true){ |