Advertisement
Guest User

sfweather

a guest
Oct 5th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.17 KB | None | 0 0
  1. import QtQuick 2.0
  2. import Sailfish.Silica 1.0
  3. import Sailfish.Weather 1.0
  4.  
  5. BackgroundItem {
  6.  
  7. id: weatherData
  8. property bool autoRefresh: false
  9. property bool active: true
  10. property QtObject meecastData
  11. property bool expanded
  12.  
  13. onClicked: {expanded = !expanded; weatherData.refresh()}
  14. onPressAndHold: { weatherData.meecastData.startMeeCast()}
  15.  
  16. Component.onCompleted: {
  17. meecastData = Qt.createQmlObject('import QtQuick 2.0; import org.meecast.data 1.0 as Meecast; Meecast.Data {}', weatherData)
  18. }
  19.  
  20. function refresh(){
  21.  
  22. icon.source = weatherData.meecastData.forecastdata["item1_icon"]
  23. stationname.text = weatherData.meecastData.nameString
  24. description.text = weatherData.meecastData.forecastdata["item1_description"] ? weatherData.meecastData.forecastdata["item1_description"] : "MeeCast"
  25. if (weatherData.meecastData.forecastdata["item1_temperature"] && weatherData.meecastData.forecastdata["item1_temperature"] != "N/A"){
  26. temperature.text = weatherData.meecastData.forecastdata["item1_temperature"] + '°' + weatherData.meecastData.forecastdata["temperatureunit"]
  27. }else{
  28. temperature.text = weatherData.meecastData.forecastdata["item1_temperature_low"] + '°' + weatherData.meecastData.forecastdata["temperatureunit"] + "/"+ weatherData.meecastData.forecastdata["item1_temperature_high"] + '°' + weatherData.meecastData.forecastdata["temperatureunit"]
  29. }
  30. if (expanded){
  31. last_update.text = "Last update: " + weatherData.meecastData.forecastdata["last_update"]
  32. if ( weatherData.meecastData.forecastdata["item2_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item2_temperature_low"] == "N/A" ){
  33. temperature_2.text = weatherData.meecastData.forecastdata["item2_temperature"] + '°'
  34. }else{
  35. if (weatherData.meecastData.forecastdata["item2_temperature_low"] && weatherData.meecastData.forecastdata["item2_temperature_high"])
  36. temperature_2.text = weatherData.meecastData.forecastdata["item2_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item2_temperature_high"] + '°'
  37. else{
  38. temperature_2.text = ""
  39. }
  40. }
  41. if ( weatherData.meecastData.forecastdata["item3_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item3_temperature_low"] == "N/A" ){
  42. temperature_3.text = weatherData.meecastData.forecastdata["item3_temperature"] + '°'
  43. }else{
  44. if (weatherData.meecastData.forecastdata["item3_temperature_low"] && weatherData.meecastData.forecastdata["item3_temperature_high"])
  45. temperature_3.text = weatherData.meecastData.forecastdata["item3_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item3_temperature_high"] + '°'
  46. else{
  47. temperature_3.text = ""
  48. }
  49. }
  50. if ( weatherData.meecastData.forecastdata["item4_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item4_temperature_low"] == "N/A" ){
  51. temperature_4.text = weatherData.meecastData.forecastdata["item4_temperature"] + '°'
  52. }else{
  53. if (weatherData.meecastData.forecastdata["item4_temperature_low"] && weatherData.meecastData.forecastdata["item4_temperature_high"])
  54. temperature_4.text = weatherData.meecastData.forecastdata["item4_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item4_temperature_high"] + '°'
  55. else{
  56. temperature_4.text = ""
  57. }
  58. }
  59. if ( weatherData.meecastData.forecastdata["item5_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item5_temperature_low"] == "N/A" ){
  60. temperature_5.text = weatherData.meecastData.forecastdata["item5_temperature"] + '°'
  61. }else{
  62. if (weatherData.meecastData.forecastdata["item5_temperature_low"] && weatherData.meecastData.forecastdata["item5_temperature_high"])
  63. temperature_5.text = weatherData.meecastData.forecastdata["item5_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item5_temperature_high"] + '°'
  64. else{
  65. temperature_5.text = ""
  66. }
  67. }
  68. if ( weatherData.meecastData.forecastdata["item6_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item6_temperature_low"] == "N/A" ){
  69. temperature_6.text = weatherData.meecastData.forecastdata["item6_temperature"] + '°'
  70. }else{
  71. if (weatherData.meecastData.forecastdata["item6_temperature_low"] && weatherData.meecastData.forecastdata["item6_temperature_high"])
  72. temperature_6.text = weatherData.meecastData.forecastdata["item6_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item6_temperature_high"] + '°'
  73. else{
  74. temperature_6.text = ""
  75. }
  76. }
  77. if ( weatherData.meecastData.forecastdata["item7_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item7_temperature_low"] == "N/A" ){
  78. temperature_7.text = weatherData.meecastData.forecastdata["item7_temperature"] + '°'
  79. }else{
  80. if (weatherData.meecastData.forecastdata["item7_temperature_low"] && weatherData.meecastData.forecastdata["item7_temperature_high"])
  81. temperature_7.text = weatherData.meecastData.forecastdata["item7_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item7_temperature_high"] + '°'
  82. else{
  83. temperature_7.text = ""
  84. }
  85. }
  86. if ( weatherData.meecastData.forecastdata["item8_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item8_temperature_low"] == "N/A" ){
  87. temperature_8.text = weatherData.meecastData.forecastdata["item8_temperature"] + '°'
  88. }else{
  89. if (weatherData.meecastData.forecastdata["item8_temperature_low"] && weatherData.meecastData.forecastdata["item8_temperature_high"])
  90. temperature_8.text = weatherData.meecastData.forecastdata["item8_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item8_temperature_high"] + '°'
  91. else{
  92. temperature_8.text = ""
  93. }
  94. }
  95.  
  96. day_name_2.text = weatherData.meecastData.forecastdata["item2_short_day_name"]
  97. day_name_3.text = weatherData.meecastData.forecastdata["item3_short_day_name"]
  98. day_name_4.text = weatherData.meecastData.forecastdata["item4_short_day_name"]
  99. day_name_5.text = weatherData.meecastData.forecastdata["item5_short_day_name"]
  100. day_name_6.text = weatherData.meecastData.forecastdata["item6_short_day_name"]
  101. day_name_7.text = weatherData.meecastData.forecastdata["item7_short_day_name"]
  102. day_name_8.text = weatherData.meecastData.forecastdata["item8_short_day_name"]
  103. icon2.source = weatherData.meecastData.forecastdata["item2_icon"]
  104. icon3.source = weatherData.meecastData.forecastdata["item3_icon"]
  105. icon4.source = weatherData.meecastData.forecastdata["item4_icon"]
  106. icon5.source = weatherData.meecastData.forecastdata["item5_icon"]
  107. icon6.source = weatherData.meecastData.forecastdata["item6_icon"]
  108. icon7.source = weatherData.meecastData.forecastdata["item7_icon"]
  109. icon8.source = weatherData.meecastData.forecastdata["item8_icon"]
  110. }
  111.  
  112. }
  113. function reload() {
  114. console.log("reload")
  115. }
  116. function save() {
  117. }
  118.  
  119. visible: enabled
  120. enabled: enabled
  121. height: enabled ? column.height : 0
  122.  
  123. Column {
  124. id: column
  125. width: parent.width
  126. anchors {
  127. left: parent.left
  128. }
  129. Row {
  130. id: current_row
  131. spacing: Theme.paddingMedium
  132. anchors.horizontalCenter: parent.horizontalCenter
  133. height: Theme.itemSizeSmall
  134. anchors.left: parent.left
  135. anchors.leftMargin: isPortrait ? Theme.paddingSmall : Theme.paddingMedium + Theme.paddingSmall
  136.  
  137. Image {
  138. id: icon
  139. height: parent.height
  140. width: height
  141. opacity: lipstickSettings.lowPowerMode ? 0.8 : 1.0
  142. source: weatherData.meecastData.forecastdata["item1_icon"]
  143. }
  144. Label {
  145. id: temperature
  146. text: {
  147. if (weatherData.meecastData.forecastdata["item1_temperature"] && weatherData.meecastData.forecastdata["item1_temperature"] != "N/A"){
  148. return weatherData.meecastData.forecastdata["item1_temperature"] + '°'
  149. }else{
  150. if (weatherData.meecastData.forecastdata["item1_temperature_low"] && weatherData.meecastData.forecastdata["item1_temperature_high"])
  151. return weatherData.meecastData.forecastdata["item1_temperature_low"] + '°' + "/"+ weatherData.meecastData.forecastdata["item1_temperature_high"] + '°'
  152. else
  153. return ""
  154. }
  155. }
  156. y: isPortrait ? Theme.paddingLarge : Theme.paddingMedium
  157. anchors {
  158. top: parent.top
  159. }
  160. font {
  161. pixelSize: isPortrait ? Theme.fontSizeHuge : Theme.fontSizeExtraLarge
  162. family: Theme.fontFamilyHeading
  163. }
  164. color: lipstickSettings.lowPowerMode ? Theme.highlightColor : Theme.primaryColor
  165. }
  166.  
  167. Column {
  168. width: parent.width - temperature.width - icon.width
  169. Label {
  170. id: stationname
  171. width: parent.width
  172. text: weatherData.meecastData.nameString ? weatherData.meecastData.nameString : "MeeCast"
  173. //color: Theme.primaryColor
  174. color: Theme.highlightColor
  175. //horizontalAlignment: Text.AlignRight
  176. horizontalAlignment: Text.AlignHCenter
  177. font {
  178. pixelSize: Theme.fontSizeLarge
  179. family: Theme.fontFamilyHeading
  180. }
  181. truncationMode: TruncationMode.Fade
  182. }
  183.  
  184. Label {
  185. id: description
  186. width: parent.width
  187. text: weatherData.meecastData.forecastdata["item1_description"] ? weatherData.meecastData.forecastdata["item1_description"] : "MeeCast"
  188. horizontalAlignment: Text.AlignHCenter
  189. font {
  190. pixelSize: isPortrait ? Theme.fontSizeExtraSmall : Theme.fontSizeSmall
  191. family: Theme.fontFamilyHeading
  192. }
  193. color: lipstickSettings.lowPowerMode ? Theme.highlightColor : Theme.secondaryColor
  194. truncationMode: TruncationMode.Fade
  195. }
  196. }
  197. }
  198. Row {
  199. id: forecasts_row
  200. // x: Theme.horizontalPageMargin-Theme.paddingLarge
  201. // width: parent.width - 2*x
  202. width: parent.width
  203. height: 0
  204. opacity: 0.0
  205. spacing: Theme.paddingMedium*1.16
  206. states: State {
  207. name: "expanded"
  208. when: weatherData.expanded
  209. PropertyChanges {
  210. target: forecasts_row
  211. opacity: 1.0
  212. height: 1.6*(Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall)
  213. }
  214. }
  215.  
  216. Row {
  217. id: forecast2_row
  218. Column {
  219. id: icon_day_column2
  220. Label {
  221. id: day_name_2
  222. anchors.bottom: icon_2.top
  223. anchors.bottomMargin: -Theme.paddingSmall
  224. font.pixelSize: Theme.fontSizeSmall
  225. color: Theme.secondaryColor
  226. horizontalAlignment: Text.AlignHCenter
  227. width: parent.width
  228. text: weatherData.meecastData.forecastdata["item2_short_day_name"]
  229. }
  230. Row{
  231. Image {
  232. id: icon2
  233. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  234. width: height
  235. source: weatherData.meecastData.forecastdata["item2_icon"]
  236. }
  237. Label {
  238. id: temperature_2
  239. font.pixelSize: Theme.fontSizeSmall
  240. horizontalAlignment: Text.AlignRight
  241. verticalAlignment: Text.AlignVCenter
  242. height: icon2.height
  243. wrapMode: Text.Wrap
  244. width: 1.6*Theme.fontSizeSmall
  245. text: {
  246. if ( weatherData.meecastData.forecastdata["item2_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item2_temperature_low"] == "N/A" ){
  247. return weatherData.meecastData.forecastdata["item2_temperature"] + '°' }else{
  248. if (weatherData.meecastData.forecastdata["item2_temperature_low"] && weatherData.meecastData.forecastdata["item2_temperature_high"])
  249. return weatherData.meecastData.forecastdata["item2_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item2_temperature_high"] + '°'
  250. else
  251. return ""
  252. }
  253. }
  254. }
  255.  
  256. }
  257. }
  258. }
  259. Row {
  260. id: forecast3_row
  261. Column {
  262. id: icon_day_column3
  263. Label {
  264. id: day_name_3
  265. anchors.bottom: icon_3.top
  266. anchors.bottomMargin: -Theme.paddingSmall
  267. font.pixelSize: Theme.fontSizeSmall
  268. color: Theme.secondaryColor
  269. horizontalAlignment: Text.AlignHCenter
  270. width: parent.width
  271. text: weatherData.meecastData.forecastdata["item3_short_day_name"]
  272. }
  273. Row{
  274. Image {
  275. id: icon3
  276. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  277. width: height
  278. source: weatherData.meecastData.forecastdata["item3_icon"]
  279. }
  280. Label {
  281. id: temperature_3
  282. font.pixelSize: Theme.fontSizeSmall
  283. horizontalAlignment: Text.AlignRight
  284. verticalAlignment: Text.AlignVCenter
  285. height: icon3.height
  286. wrapMode: Text.Wrap
  287. width: 1.6*Theme.fontSizeSmall
  288. text: {
  289. if ( weatherData.meecastData.forecastdata["item3_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item3_temperature_low"] == "N/A" ){
  290. return weatherData.meecastData.forecastdata["item3_temperature"] + '°' }else{
  291. if (weatherData.meecastData.forecastdata["item3_temperature_low"] && weatherData.meecastData.forecastdata["item3_temperature_high"])
  292. return weatherData.meecastData.forecastdata["item3_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item3_temperature_high"] + '°'
  293. else
  294. return ""
  295. }
  296. }
  297. }
  298.  
  299. }
  300. }
  301. }
  302. Row {
  303. id: forecast4_row
  304. Column {
  305. id: icon_day_column4
  306. Label {
  307. id: day_name_4
  308. anchors.bottom: icon_4.top
  309. anchors.bottomMargin: -Theme.paddingSmall
  310. font.pixelSize: Theme.fontSizeSmall
  311. color: Theme.secondaryColor
  312. horizontalAlignment: Text.AlignHCenter
  313. width: parent.width
  314. text: weatherData.meecastData.forecastdata["item4_short_day_name"]
  315. }
  316. Row {
  317. Image {
  318. id: icon4
  319. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  320. width: height
  321. source: weatherData.meecastData.forecastdata["item4_icon"]
  322. }
  323. Label {
  324. id: temperature_4
  325. font.pixelSize: Theme.fontSizeSmall
  326. horizontalAlignment: Text.AlignRight
  327. verticalAlignment: Text.AlignVCenter
  328. height: icon4.height
  329. wrapMode: Text.Wrap
  330. width: 1.6*Theme.fontSizeSmall
  331. text: {
  332. if ( weatherData.meecastData.forecastdata["item4_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item4_temperature_low"] == "N/A" ){
  333. return weatherData.meecastData.forecastdata["item4_temperature"] + '°' }else{
  334. if (weatherData.meecastData.forecastdata["item4_temperature_low"] && weatherData.meecastData.forecastdata["item4_temperature_high"])
  335. return weatherData.meecastData.forecastdata["item4_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item4_temperature_high"] + '°'
  336. else
  337. return ""
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. Row {
  345. id: forecast5_row
  346. Column {
  347. id: icon_day_column5
  348. Label {
  349. id: day_name_5
  350. anchors.bottom: icon_5.top
  351. anchors.bottomMargin: -Theme.paddingSmall
  352. font.pixelSize: Theme.fontSizeSmall
  353. color: Theme.secondaryColor
  354. horizontalAlignment: Text.AlignHCenter
  355. width: parent.width
  356. text: weatherData.meecastData.forecastdata["item5_short_day_name"]
  357. }
  358. Row {
  359. Image {
  360. id: icon5
  361. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  362. width: height
  363. source: weatherData.meecastData.forecastdata["item5_icon"]
  364. }
  365. Label {
  366. id: temperature_5
  367. font.pixelSize: Theme.fontSizeSmall
  368. horizontalAlignment: Text.AlignRight
  369. verticalAlignment: Text.AlignVCenter
  370. height: icon5.height
  371. wrapMode: Text.Wrap
  372. width: 1.6*Theme.fontSizeSmall
  373. text: {
  374. if ( weatherData.meecastData.forecastdata["item5_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item5_temperature_low"] == "N/A" ){
  375. return weatherData.meecastData.forecastdata["item5_temperature"] + '°'
  376. }else{
  377. if (weatherData.meecastData.forecastdata["item5_temperature_low"] && weatherData.meecastData.forecastdata["item5_temperature_high"])
  378. return weatherData.meecastData.forecastdata["item5_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item5_temperature_high"] + '°'
  379. else
  380. return ""
  381. }
  382. }
  383. }
  384. }
  385. }
  386. }
  387. Row {
  388. id: forecast6_row
  389. visible: isPortrait ? false : true
  390. enabled: isPortrait ? false : true
  391. Column {
  392. id: icon_day_column6
  393. Label {
  394. id: day_name_6
  395. anchors.bottom: icon_6.top
  396. anchors.bottomMargin: -Theme.paddingSmall
  397. font.pixelSize: Theme.fontSizeSmall
  398. color: Theme.secondaryColor
  399. horizontalAlignment: Text.AlignHCenter
  400. width: parent.width
  401. text: weatherData.meecastData.forecastdata["item6_short_day_name"]
  402. }
  403. Row {
  404. Image {
  405. id: icon6
  406. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  407. width: height
  408. source: weatherData.meecastData.forecastdata["item6_icon"]
  409. }
  410. Label {
  411. id: temperature_6
  412. font.pixelSize: Theme.fontSizeSmall
  413. horizontalAlignment: Text.AlignRight
  414. verticalAlignment: Text.AlignVCenter
  415. height: icon6.height
  416. wrapMode: Text.Wrap
  417. width: 1.6*Theme.fontSizeSmall
  418. text: {
  419. if ( weatherData.meecastData.forecastdata["item6_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item6_temperature_low"] == "N/A" ){
  420. return weatherData.meecastData.forecastdata["item6_temperature"] + '°'
  421. }else{
  422. if (weatherData.meecastData.forecastdata["item6_temperature_low"] && weatherData.meecastData.forecastdata["item6_temperature_high"])
  423. return weatherData.meecastData.forecastdata["item6_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item6_temperature_high"] + '°'
  424. else
  425. return ""
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432.  
  433. Row {
  434. id: forecast7_row
  435. visible: isPortrait ? false : true
  436. enabled: isPortrait ? false : true
  437. Column {
  438. id: icon_day_column7
  439. Label {
  440. id: day_name_7
  441. anchors.bottom: icon_7.top
  442. anchors.bottomMargin: -Theme.paddingSmall
  443. font.pixelSize: Theme.fontSizeSmall
  444. color: Theme.secondaryColor
  445. horizontalAlignment: Text.AlignHCenter
  446. width: parent.width
  447. text: weatherData.meecastData.forecastdata["item7_short_day_name"]
  448. }
  449. Row {
  450. Image {
  451. id: icon7
  452. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  453. width: height
  454. source: weatherData.meecastData.forecastdata["item7_icon"]
  455. }
  456. Label {
  457. id: temperature_7
  458. font.pixelSize: Theme.fontSizeSmall
  459. horizontalAlignment: Text.AlignRight
  460. verticalAlignment: Text.AlignVCenter
  461. height: icon7.height
  462. wrapMode: Text.Wrap
  463. width: 1.6*Theme.fontSizeSmall
  464. text: {
  465. if ( weatherData.meecastData.forecastdata["item7_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item7_temperature_low"] == "N/A" ){
  466. return weatherData.meecastData.forecastdata["item7_temperature"] + '°'
  467. }else{
  468. if (weatherData.meecastData.forecastdata["item7_temperature_low"] && weatherData.meecastData.forecastdata["item7_temperature_high"])
  469. return weatherData.meecastData.forecastdata["item7_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item7_temperature_high"] + '°'
  470. else
  471. return ""
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. Row {
  479. id: forecast8_row
  480. visible: isPortrait ? false : true
  481. enabled: isPortrait ? false : true
  482. Column {
  483. id: icon_day_column8
  484. Label {
  485. id: day_name_8
  486. anchors.bottom: icon_8.top
  487. anchors.bottomMargin: -Theme.paddingSmall
  488. font.pixelSize: Theme.fontSizeSmall
  489. color: Theme.secondaryColor
  490. horizontalAlignment: Text.AlignHCenter
  491. width: parent.width
  492. text: weatherData.meecastData.forecastdata["item8_short_day_name"]
  493. }
  494. Row {
  495. Image {
  496. id: icon8
  497. height: Screen.sizeCategory >= Screen.Large ? Theme.itemSizeLarge : Theme.itemSizeSmall
  498. width: height
  499. source: weatherData.meecastData.forecastdata["item8_icon"]
  500. }
  501. Label {
  502. id: temperature_8
  503. font.pixelSize: Theme.fontSizeSmall
  504. horizontalAlignment: Text.AlignRight
  505. verticalAlignment: Text.AlignVCenter
  506. height: icon7.height
  507. wrapMode: Text.Wrap
  508. width: 1.6*Theme.fontSizeSmall
  509. text: {
  510. if ( weatherData.meecastData.forecastdata["item8_temperature_high"] == "N/A" || weatherData.meecastData.forecastdata["item8_temperature_low"] == "N/A" ){
  511. return weatherData.meecastData.forecastdata["item8_temperature"] + '°'
  512. }else{
  513. if (weatherData.meecastData.forecastdata["item8_temperature_low"] && weatherData.meecastData.forecastdata["item8_temperature_high"])
  514. return weatherData.meecastData.forecastdata["item8_temperature_low"] + '°' + "\n"+ weatherData.meecastData.forecastdata["item8_temperature_high"] + '°'
  515. else
  516. return ""
  517. }
  518. }
  519. }
  520. }
  521. }
  522. }
  523.  
  524. }
  525. Row {
  526. height: 0
  527. opacity: 0.0
  528. id: lastupdate_row
  529. width: parent.width
  530. states: State {
  531. name: "expanded"
  532. when: weatherData.expanded
  533. PropertyChanges {
  534. target: lastupdate_row
  535. opacity: 1.0
  536. height: Theme.itemSizeExtrasSmall
  537. }
  538. }
  539.  
  540. Label {
  541. id: last_update
  542. width: parent.width
  543. font.pixelSize: Theme.fontSizeSmall
  544. color: Theme.secondaryColor
  545. horizontalAlignment: Text.AlignRight
  546. text: "Last update: " + weatherData.meecastData.forecastdata["last_update"]
  547. }
  548. }
  549. }
  550. Connections {
  551. target: weatherData.meecastData
  552. onRefreshWidget: {
  553. console.log("Refresh MeeCast widget !!!!!!!!!!!!!!")
  554. weatherData.refresh();
  555. }
  556. }
  557.  
  558. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement