+ }
+ }
+ }
+
+ Component {
+ id: stockQuotesUIComponent
+ Item {
+ Rectangle{
+ id: pathViewWrapper
+ width: parent.width
+ anchors.top: parent.top
+ anchors.bottom: footerText.top
+ color: "#343434"
+
+ PathView {
+ id: stockQuotesView
+ anchors.fill: parent
+ flickDeceleration: 500
+ //preferredHighlightBegin: 1/stockQuotesView.count
+ //preferredHighlightEnd: 1/stockQuotesView.count
+ //pathItemCount: count
+ focus: true
+ interactive: true
+ model: stockQuoteDataModel
+ delegate: stockQuotesDelegate
+ path: Path {
+ startX: width / 2
+ startY: itemHeight/2
+ PathLine {
+ x: width / 2
+ y: stockQuotesView.count * itemHeight + itemHeight/2
+ }
+ }
+ Keys.onDownPressed: if (!moving && interactive) incrementCurrentIndex()
+ Keys.onUpPressed: if (!moving && interactive) decrementCurrentIndex()
+
+ Connections {
+ target: mainPage
+ onQuoteRefreshCompleted:{
+ stockQuotesView.currentIndex = 0;
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onDownButtonClicked: {
+ if (!stockQuotesView.moving && stockQuotesView.interactive)
+ stockQuotesView.currentIndex = stockQuotesView.currentIndex + 1
+ }
+ onUpButtonClicked: {
+ if (!stockQuotesView.moving && stockQuotesView.interactive)
+ stockQuotesView.currentIndex = stockQuotesView.currentIndex - 1
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ id: stockStatusMsgArea
+ height: 100
+ color: "#343434"
+ anchors {left: parent.left; leftMargin: 15; right: parent.right; rightMargin: 15;
+ verticalCenter: parent.verticalCenter}
+ visible: false
+
+ Text {
+ id: stockStatusText
+ anchors.fill: parent
+ text: "Loading quotes.."
+ horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter
+ width: parent.width; font.pixelSize: 16; elide: Text.ElideNone;
+ color: "#cccccc"
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ style: Text.Raised; styleColor: "black"
+
+ Connections {
+ target: mainPage
+ onQuoteRefreshCompleted: {
+ if (success){
+ stockStatusMsgArea.visible = false;
+ pathViewWrapper.visible = true;
+ }
+ else{
+ stockStatusText.text = strMessage;
+ pathViewWrapper.visible = false;
+ stockStatusMsgArea.visible = true;
+ }
+ }
+ }
+ }
+ }
+
+ Rectangle{
+ id: footerText
+ width: parent.width
+ height: 25
+ color: "#343434"
+ anchors.bottom: parent.bottom
+ Text {
+ id: timeStamp
+ anchors.fill: parent
+ text: mainPage.lastUpdatedTimeStamp
+ horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
+ width: parent.width; font.pixelSize: 12; elide: Text.ElideRight;
+ color: "#cccccc"
+ style: Text.Raised; styleColor: "black"
+
+ Connections {
+ target: mainPage
+ onQuoteRefreshCompleted:{
+ timeStamp.text = mainPage.lastUpdatedTimeStamp;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Component {
+ id: newsComponent
+ Item {
+ Rectangle{
+ id: newsViewArea
+ width: parent.width
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ color: "#343434"
+
+ PathView {
+ id: newsView
+ anchors.fill: parent
+ flickDeceleration: 500
+ focus: true
+ interactive: true
+ model: newsDataModel
+ delegate: newsDelegate
+ path: Path {
+ startX: width / 2
+ startY: itemHeight/2
+ PathLine {
+ x: width / 2
+ y: newsView.count * itemHeight + itemHeight/2
+ }
+ }
+ Keys.onDownPressed: if (!moving && interactive) incrementCurrentIndex()
+ Keys.onUpPressed: if (!moving && interactive) decrementCurrentIndex()
+
+ Connections {
+ target: mainPage
+ onQuoteRefreshCompleted:{
+ newsView.currentIndex = 0;
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onDownButtonClicked: {
+ if (!newsView.moving && newsView.interactive)
+ newsView.currentIndex = newsView.currentIndex + 1
+ }
+ onUpButtonClicked: {
+ if (!newsView.moving && newsView.interactive)
+ newsView.currentIndex = newsView.currentIndex - 1
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ id: newsStatusMsgArea
+ height: 100
+ color: "#343434"
+ anchors {left: parent.left; leftMargin: 15; right: parent.right; rightMargin: 15;
+ verticalCenter: parent.verticalCenter}
+ visible: false
+
+ Text {
+ id: newsStatusText
+ anchors.fill: parent
+ text: "Loading news.."
+ horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter
+ width: parent.width; font.pixelSize: 16; elide: Text.ElideNone;
+ color: "#cccccc"
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ style: Text.Raised; styleColor: "black"
+
+ Connections {
+ target: mainPage
+ onNewsReloadCompleted: {
+ if (success){
+ newsStatusMsgArea.visible = false;
+ newsViewArea.visible = true;
+ }
+ else{
+ newsStatusText.text = strMessage;
+ newsViewArea.visible = false;
+ newsStatusMsgArea.visible = true;
+ }
+ }
+ }
+ }