3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
8 import "Library/js/DBUtility.js" as DBUtility
11 id: configParametersComponent
12 property bool updateFreqEnabled
13 property string updateFreqMin
14 property bool updateWeekdaysOnly
15 signal logRequest(string strMessage)
22 Component.onCompleted: {
23 DBUtility.initialize();
27 Component.onDestruction:{
28 logRequest("Saving settings");
32 function loadSettings(){
34 value = DBUtility.getSetting("UpdateFreqency");
35 if (!value || value == "0.0" || value == ""){
36 configParametersComponent.updateFreqEnabled = false;
39 configParametersComponent.updateFreqEnabled = true;
40 configParametersComponent.updateFreqMin = parseInt(value);
42 value = DBUtility.getSetting("UpdateWeekdaysOnly");
43 if (!value || value == "0.0" || value == ""){
44 configParametersComponent.updateWeekdaysOnly = false;
47 configParametersComponent.updateWeekdaysOnly = true;
51 function saveSettings(){
52 DBUtility.setSetting("UpdateFreqency",configParametersComponent.updateFreqMin);
53 DBUtility.setSetting("UpdateWeekdaysOnly",(configParametersComponent.updateWeekdaysOnly?1:0));
57 id: autoUpdateSectionLabel
58 anchors.top: parent.top
59 //anchors.topMargin: 10
60 anchors.left: parent.left
61 anchors.leftMargin: 45
63 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
64 font.pixelSize: 22; font.bold: true; elide: Text.ElideRight; color: "#B8B8B8"; style: Text.Raised; styleColor: "black"
71 border.color: "#BFBFBF"
73 anchors.top: autoUpdateSectionLabel.bottom
75 anchors.left: parent.left
76 anchors.leftMargin: 40
77 anchors.right: parent.right
78 anchors.rightMargin: 40
84 anchors.top: parent.top
86 anchors.left: parent.left
88 anchors.right: parent.right
93 id: checkboxUpdateFreqImg
94 source: configParametersComponent.updateFreqEnabled? "Library/images/checkbox_checked.png":"Library/images/checkbox_unchecked.png"
99 configParametersComponent.updateFreqEnabled = !configParametersComponent.updateFreqEnabled;
100 if (!configParametersComponent.updateFreqEnabled){
101 txtUpdateFreqMin.text = "";
102 configParametersComponent.updateWeekdaysOnly = false;
110 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
111 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
113 color: configParametersComponent.updateFreqEnabled? "#ffffff" :"#B8B8B8";
118 BorderImage { source: "Library/images/lineedit.sci"; anchors.fill: parent }
123 text: configParametersComponent.updateFreqMin
124 horizontalAlignment: Text.AlignHCenter
125 inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoPredictiveText
127 configParametersComponent.updateFreqMin = txtUpdateFreqMin.text;
133 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
134 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
136 color: configParametersComponent.updateFreqEnabled? "#ffffff" :"#B8B8B8";
141 anchors.top: rowUpdateFreq.bottom
143 anchors.left: parent.left
144 anchors.leftMargin: 5
145 anchors.right: parent.right
150 id: checkboxUpdateWeekdays
151 source: configParametersComponent.updateWeekdaysOnly? "Library/images/checkbox_checked.png":"Library/images/checkbox_unchecked.png"
152 width: 32; height: 32
154 anchors.fill: parent;
156 configParametersComponent.updateWeekdaysOnly = !configParametersComponent.updateWeekdaysOnly;
163 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
164 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
165 text: "Only on weekdays"
166 color: configParametersComponent.updateWeekdaysOnly? "#ffffff" :"#B8B8B8";