@@ -17,6 +17,7 @@
17import "Gradient.js" as Gradient
17import "Gradient.js" as Gradient
18import QtQuick 2.4
18import QtQuick 2.4
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
22 id: infographic
23 id: infographic
@@ -25,7 +26,7 @@ Item {
26 property int animDuration: 10
27 property int animDuration: 10
28− property int currentDay: -1 // Boot time value
29+ property int currentWeekDay
30 QtObject {
31 QtObject {
@@ -58,22 +59,40 @@ Item {
58 onDataDisappeared: startShowAnimation() // show "no data" label
59 onDataDisappeared: startShowAnimation() // show "no data" label
62− function startShowAnimation() {
66+ onStatusChanged: {
63− if(currentDay !== model.currentDay){
67+ if(Powerd.status === Powerd.On){
64− currentDay = model.currentDay
68+ handleScreenOn()
65− model.nextDataSource();
67− dotHideAnimTimer.stop()
68− notification.hideAnim.stop()
70− if (d.useDotAnimation) {
71− dotShowAnimTimer.startFromBeginning()
73− notification.showAnim.start()
73+ function handleScreenOn(){
74+ var today = new Date().getDay()
75+ if(infographic.currentWeekDay !== today){
76+ infographic.currentWeekDay = today
81+ function reloadUserData(){
82+ d.useDotAnimation = false
83+ infographic.model.nextDataSource()
86+ function startShowAnimation() {
87+ dotHideAnimTimer.stop()
88+ notification.hideAnim.stop()
90+ if (d.useDotAnimation) {
91+ dotShowAnimTimer.startFromBeginning()
93+ notification.showAnim.start()
77 function startHideAnimation() {
96 function startHideAnimation() {
78 dotShowAnimTimer.stop()
97 dotShowAnimTimer.stop()
79 circleChangeAnimTimer.stop()
98 circleChangeAnimTimer.stop()
@@ -89,7 +108,10 @@ Item {
90 visible: model.username !== ""
109 visible: model.username !== ""
92− Component.onCompleted: startShowAnimation()
111+ Component.onCompleted: {
112+ currentWeekDay = new Date().getDay()
113+ startShowAnimation()
95 id: dataCircle
117 id: dataCircle
@@ -413,8 +435,7 @@ Item {
414 onDoubleClicked: {
436 onDoubleClicked: {
415 if (!d.animating) {
437 if (!d.animating) {
416− d.useDotAnimation = false
438+ reloadUserData()
417− infographic.model.nextDataSource()