Added global controller andalso filebrowser qml
[lichviet] / qml / LichViet / main.qml
index 1c7eb47..338f9a1 100644 (file)
@@ -3,7 +3,7 @@ Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
+the Free Software Foundation, either version 2 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
@@ -25,8 +25,8 @@ import "CacNgayLeTrongNam.js" as CNLTN
 
 Item {
      id: screen
-     width: 480
-     height: 800
+     width: 800
+     height: 480
 
      property int curDay: LC.curDay()
      property int curMonth: LC.curMonth()
@@ -100,9 +100,10 @@ Item {
              width: 80
              height: 20
              color: "#29d999"
-             text: "Tháng "+screen.curMonth+" Năm "+screen.curYear
+             textFormat: Text.RichText
+             text: "Tháng <b>"+screen.curMonth+"</b> Năm <b>"+screen.curYear+"</b>"
              anchors.horizontalCenter: parent.horizontalCenter
-             font.bold: true
+             font.bold: false
              font.family: "Tahoma"
              smooth: true
              horizontalAlignment: Text.AlignHCenter
@@ -120,6 +121,7 @@ Item {
                       property int index: 0
                       onIndexChanged: txtDATEpv.currentIndex = reelx.index
                       color: "transparent"
+
                       Component {
                           id: delegate
                           Column {
@@ -145,7 +147,7 @@ Item {
                                           }
                                       }
                                       else
-                                          return theme_manager.theme.markdate.otherday;
+                                          return "transparent";//theme_manager.theme.markdate.otherday;
                                     }
                               }
                           }
@@ -214,10 +216,6 @@ Item {
                       }
 
                       function init(){
-                          while(maindatemodel.count>0){
-                              try{maindatemodel.remove(maindatemodel.count-1)}catch(e){}
-                          }
-
                           for(var i=1;i<=LC.calDays(screen.curMonth,screen.curYear);i++)
                               append({name:i})
 
@@ -226,9 +224,6 @@ Item {
                   }
 
          //-------------------------------------------------
-                  Component.onCompleted: {
-                     maindatemodel.init()
-                  }
 
          Text {
              id: txtTHU
@@ -333,18 +328,17 @@ Item {
              x: -(screen.width * 1.5)
          }
 
-         NoFeatureDialog{
-             id: nofeatureDialog
-             state:"nofeaturedialog"
+         About{
+             id: aboutDialog
+             state:"aboutdialog"
              anchors.verticalCenter: parent.verticalCenter
              width: parent.width; height: parent.height-60;
              x: -(screen.width * 1.5)
          }
 
-
-         About{
-             id: aboutDialog
-             state:"aboutdialog"
+         FileBrowser{
+             id: fileBrowser
+             state:"filebrowser"
              anchors.verticalCenter: parent.verticalCenter
              width: parent.width; height: parent.height-60;
              x: -(screen.width * 1.5)
@@ -383,6 +377,12 @@ Item {
                           PropertyChanges { target: mouseareaMM;enabled:false }
 
          },
+             State{
+                 name:"filebrowser"
+                 PropertyChanges { target: fileBrowser; x: 0; focus:true; visible:true;}
+                 PropertyChanges { target: toolBar; y: screen.height }
+                 PropertyChanges { target: toolBar }
+             },
          State {
              name: "optionsscreen";
              PropertyChanges { target: optionsScreen; x: 0; focus:true}
@@ -396,12 +396,13 @@ Item {
              PropertyChanges { target: changeTheme; x: 0; focus:true}
              PropertyChanges { target: toolBar; y: screen.height }
              PropertyChanges { target: toolBar }
-                          PropertyChanges { target: mouseareaMM;enabled:false }
+             PropertyChanges { target: reelx;enabled:false }
+             PropertyChanges { target: mouseareaMM;enabled:false }
 
          },
          State {
              name: "xemngaytotxauhoangdao";
-             PropertyChanges { target: xntxhdScreen; x: 0; focus:true}
+             PropertyChanges { target: xntxhdScreen; x: 0; focus:true;visible:true;}
              PropertyChanges { target: toolBar; y: screen.height }
              PropertyChanges { target: toolBar }
              PropertyChanges { target: mouseareaMM;enabled:false }
@@ -440,23 +441,15 @@ Item {
                 }
          },
          State {
-             name: "nofeaturedialog";
-             PropertyChanges { target: nofeatureDialog; x: 0; focus:true}
-             PropertyChanges { target: toolBar; y: screen.height }
-             PropertyChanges { target: toolBar }
-             PropertyChanges { target: mouseareaMM;enabled:false }
-                                                                 PropertyChanges { target: reelx;enabled:false }
-         },
-         State {
              name: "aboutdialog";
-             PropertyChanges { target: aboutDialog; x: 0; focus:true}
+             PropertyChanges { target: aboutDialog; x: 0; focus:true; visible:true;}
              PropertyChanges { target: toolBar; y: screen.height }
              PropertyChanges { target: toolBar }
              PropertyChanges { target: mouseareaMM;enabled:false }
          },
          State {
              name: "xemtheothang";
-             PropertyChanges { target: fullmonthDialog; x: 0; focus:true}
+             PropertyChanges { target: fullmonthDialog; x: 0; focus:true; visible:true;}
              PropertyChanges { target: toolBar; y: screen.height }
              PropertyChanges { target: toolBar }
              StateChangeScript {
@@ -469,7 +462,8 @@ Item {
      ]
 
      transitions: [
-         Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+         //normally i used InOutBack
+         Transition { NumberAnimation { properties: "x,y,opacity"; duration: 300; easing.type: Easing.InOutBack } }
      ]
 
 
@@ -507,6 +501,8 @@ Item {
      }
 
      Component.onCompleted: {
-
+        amdatetimeDialog.reset()
+        maindatemodel.init()
      }
+
 }