main.qml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. import QtQuick 1.1
  2. import com.nokia.meego 1.0
  3. PageStackWindow {
  4. id: appWindow
  5. initialPage: mainPage
  6. MainPage {
  7. id: mainPage
  8. }
  9. TimeDiffPage {
  10. id: timeDiffPage
  11. }
  12. ToolBarLayout {
  13. id: commonTools
  14. visible: true
  15. ToolIcon {
  16. platformIconId: "toolbar-view-menu"
  17. anchors.right: (parent === undefined) ? undefined : parent.right
  18. onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
  19. }
  20. }
  21. Page{
  22. id: aboutPage
  23. Rectangle {
  24. id: aboutWindow
  25. color: "#4c0094"
  26. gradient: Gradient {
  27. GradientStop {
  28. position: 0.00;
  29. color: "#c7b8fa";
  30. }
  31. GradientStop {
  32. position: 0.60;
  33. color: "#ffffff";
  34. }
  35. }
  36. anchors.left: parent.left
  37. anchors.leftMargin: 0
  38. anchors.top: parent.top
  39. width: aboutPage.width
  40. height: aboutPage.height
  41. Row {
  42. id: aboutMainRow
  43. height: 70
  44. Image {
  45. id: appLogo
  46. x: 0; y: 0
  47. width: 64; height: 64
  48. source: "qrc:/icon_withoutBG"
  49. MouseArea {
  50. anchors.fill: parent
  51. onClicked: Qt.openUrlExternally("http://dadablog.net/HarmattanApps")
  52. }
  53. }
  54. Rectangle {
  55. Text {
  56. id: txtAppName
  57. x: 80; y: 10
  58. text: qsTr("Time Calculator v1.0")
  59. color: "#3f0064"
  60. font { family: "Helvetica"; pixelSize: 24; bold: true; }
  61. MouseArea {
  62. anchors.fill: parent
  63. onClicked: Qt.openUrlExternally("http://dadablog.net/HarmattanApps")
  64. }
  65. }
  66. Text {
  67. id: txtAppURL
  68. x: 80; y: 40
  69. text: "DaDaBlog.net/HarmattanApps"
  70. color: "#3f0064"
  71. font { family: "Helvetica"; pixelSize: 24; bold: true; }
  72. MouseArea {
  73. anchors.fill: parent
  74. onClicked: Qt.openUrlExternally("http://dadablog.net/HarmattanApps")
  75. }
  76. }
  77. }
  78. }
  79. Flickable {
  80. id: flickAbout
  81. anchors.left: parent.left
  82. anchors.leftMargin: 0
  83. anchors.top: aboutMainRow.bottom; anchors.topMargin: 40
  84. contentHeight: aboutPage.width>=800 ? aboutPage.height * 2.35 : aboutPage.height * 1.5
  85. width: aboutPage.width
  86. height: aboutPage.height
  87. clip: true
  88. flickableDirection: Flickable.VerticalFlick
  89. boundsBehavior: Flickable.DragOverBounds
  90. Column {
  91. Text {
  92. id: txtAppDesc1
  93. x: 10
  94. width: aboutPage.width - 20
  95. text: qsTr("With Time Calculator, you can add or subtract a number of years, months, days, hours, minutes, or seconds (decimal supported) to or from a date / time value:\n")
  96. font { family: "Helvetica"; pixelSize: 22}
  97. wrapMode: Text.WordWrap;
  98. }
  99. Image {
  100. id: imgCalcPlusMinus
  101. x: (aboutPage.width / 2) - 160
  102. width: 320;
  103. source: qsTr("qrc:/icon_plusminus")
  104. MouseArea {
  105. anchors.fill: parent
  106. onClicked: {
  107. appWindow.pageStack.clear()
  108. appWindow.pageStack.push(mainPage)
  109. }
  110. }
  111. }
  112. Text {
  113. id: txtAppDesc2
  114. x: 10
  115. width: aboutPage.width - 20
  116. text: qsTr("\nYou can also find out the difference between two date/time:\n")
  117. font { family: "Helvetica"; pixelSize: 22}
  118. wrapMode: Text.WordWrap;
  119. }
  120. Image {
  121. id: imgCalcTimeDiff
  122. x: (aboutPage.width / 2) - 160
  123. width: 320;
  124. source: qsTr("qrc:/icon_timediff")
  125. MouseArea {
  126. anchors.fill: parent
  127. onClicked: {
  128. appWindow.pageStack.clear()
  129. appWindow.pageStack.push(timeDiffPage)
  130. }
  131. }
  132. }
  133. Text {
  134. id: txtAppDesc3
  135. x: 10
  136. width: aboutPage.width - 20
  137. text: qsTr("According to the definition of the Gregorian calendar, the following assumptions are made in this application:\n\n" +
  138. " 1 Year = 365.25 days\n" +
  139. " 1 Month = 30.436875 days\n" +
  140. " 1 Week = 7 days\n" +
  141. " 1 Day = 24 hours\n" +
  142. " 1 Business Day = A day in between Monday and Friday inclusive, except local public holidays.\n" +
  143. " 1 Hour = 60 Minutes\n" +
  144. " 1 Minute = 60 Seconds\n" +
  145. " Earliest date supported: 4713/01/02 B.C.\n" +
  146. " Earliest Selectable Date: 1900/01/01 00:00:00\n" +
  147. " Latest Selectable Date: 2099/12/31 23:59:59\n" +
  148. " Largest Plus/Minus Value: 99999\n" +
  149. " A.D. 2012 - 2012 years = 1 B.C., as there is no Year 0 by definition\n\n" +
  150. "Notice: Calculation results of this application are for reference purpose only; their accuracy is not guaranteed.\n")
  151. font { family: "Helvetica"; pixelSize: 22}
  152. wrapMode: Text.WordWrap;
  153. }
  154. }
  155. }
  156. Rectangle {
  157. id: aboutProduct
  158. x: 0; y: aboutPage.height - 50
  159. width: aboutPage.width /2
  160. height: 50
  161. color: "#d9d9d9"
  162. Text {
  163. text: qsTr("Copyright Information")
  164. font { family: "Helvetica"; pixelSize: 20; bold: true }
  165. anchors.fill: parent
  166. horizontalAlignment: Text.AlignHCenter
  167. verticalAlignment: Text.AlignVCenter
  168. }
  169. MouseArea {
  170. anchors.fill: parent
  171. onClicked: aboutProductDialog.open()
  172. }
  173. QueryDialog {
  174. id: aboutProductDialog
  175. titleText: qsTr("TimeCalc v1.0")
  176. acceptButtonText: qsTr("OK")
  177. message: qsTr("for MeeGo 1.2 Harmattan\n(C)Amanda Lam, 2012 All rights reserved.")
  178. }
  179. }
  180. Rectangle {
  181. id: btnBack
  182. width: aboutPage.width / 2
  183. height: 50
  184. color: "#e6ccff"
  185. x: aboutPage.width / 2; y: aboutPage.height - 50
  186. Text {
  187. text: qsTr("< Back")
  188. anchors.fill: parent
  189. horizontalAlignment: Text.AlignHCenter
  190. verticalAlignment: Text.AlignVCenter
  191. font { family: "Helvetica"; pixelSize: 20; bold: true; }
  192. }
  193. MouseArea {
  194. anchors.fill: parent
  195. onClicked: appWindow.pageStack.pop()
  196. }
  197. }
  198. }
  199. }
  200. Menu {
  201. id: myMenu
  202. visualParent: pageStack
  203. MenuLayout {
  204. MenuItem {
  205. text: qsTr("Sponsor")
  206. onClicked: Qt.openUrlExternally(qsTr("http://dadablog.net/maemo/donation.html"))
  207. }
  208. MenuItem {
  209. text: qsTr("Plus/Minus Time")
  210. onClicked: {
  211. appWindow.pageStack.clear()
  212. appWindow.pageStack.push(mainPage)
  213. }
  214. }
  215. MenuItem {
  216. text: qsTr("Get Time Difference")
  217. onClicked: {
  218. appWindow.pageStack.clear()
  219. appWindow.pageStack.push(timeDiffPage)
  220. }
  221. }
  222. MenuItem {
  223. text: qsTr("About this app")
  224. onClicked: appWindow.pageStack.push(aboutPage)
  225. }
  226. MenuItem {
  227. text: qsTr("Exit")
  228. onClicked: Qt.quit()
  229. }
  230. }
  231. }
  232. }