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 property bool updateOnSavedNetworksOnly
16 signal logRequest(string strMessage)
23 Component.onCompleted: {
24 DBUtility.initialize();
28 Component.onDestruction:{
29 logRequest("Saving settings");
33 function loadSettings(){
35 value = DBUtility.getSetting("UpdateFreqency");
36 if (!value || value == "0.0" || value == ""){
37 configParametersComponent.updateFreqEnabled = false;
40 configParametersComponent.updateFreqEnabled = true;
41 configParametersComponent.updateFreqMin = parseInt(value);
43 value = DBUtility.getSetting("UpdateWeekdaysOnly");
44 if (!value || value == "0.0" || value == ""){
45 configParametersComponent.updateWeekdaysOnly = false;
48 configParametersComponent.updateWeekdaysOnly = true;
51 value = DBUtility.getSetting("UpdateOnSavedNetworksOnly");
52 if (!value || value == "0.0" || value == ""){
53 configParametersComponent.updateOnSavedNetworksOnly = false;
56 configParametersComponent.updateOnSavedNetworksOnly = true;
60 function saveSettings(){
61 DBUtility.setSetting("UpdateFreqency",configParametersComponent.updateFreqMin);
62 DBUtility.setSetting("UpdateWeekdaysOnly",(configParametersComponent.updateWeekdaysOnly?1:0));
63 DBUtility.setSetting("UpdateOnSavedNetworksOnly",(configParametersComponent.updateOnSavedNetworksOnly?1:0));
67 id: autoUpdateSectionLabel
68 anchors.top: parent.top
69 //anchors.topMargin: 10
70 anchors.left: parent.left
71 anchors.leftMargin: 45
73 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
74 font.pixelSize: 22; font.bold: true; elide: Text.ElideRight; color: "#B8B8B8"; style: Text.Raised; styleColor: "black"
81 border.color: "#BFBFBF"
83 anchors.top: autoUpdateSectionLabel.bottom
85 anchors.left: parent.left
86 anchors.leftMargin: 40
87 anchors.right: parent.right
88 anchors.rightMargin: 40
94 anchors.top: parent.top
96 anchors.left: parent.left
98 anchors.right: parent.right
103 id: checkboxUpdateFreqImg
104 source: configParametersComponent.updateFreqEnabled? "Library/images/checkbox_checked.png":"Library/images/checkbox_unchecked.png"
105 width: 32; height: 32
107 anchors.fill: parent;
109 configParametersComponent.updateFreqEnabled = !configParametersComponent.updateFreqEnabled;
110 if (!configParametersComponent.updateFreqEnabled){
111 txtUpdateFreqMin.text = "";
112 configParametersComponent.updateWeekdaysOnly = false;
120 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
121 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
123 color: configParametersComponent.updateFreqEnabled? "#ffffff" :"#B8B8B8";
128 BorderImage { source: "Library/images/lineedit.sci"; anchors.fill: parent }
133 text: configParametersComponent.updateFreqMin
134 horizontalAlignment: Text.AlignHCenter
135 inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoPredictiveText
137 configParametersComponent.updateFreqMin = txtUpdateFreqMin.text;
143 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
144 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
146 color: configParametersComponent.updateFreqEnabled? "#ffffff" :"#B8B8B8";
151 anchors.top: rowUpdateFreq.bottom
153 anchors.left: parent.left
154 anchors.leftMargin: 5
155 anchors.right: parent.right
160 id: checkboxUpdateWeekdays
161 source: configParametersComponent.updateWeekdaysOnly? "Library/images/checkbox_checked.png":"Library/images/checkbox_unchecked.png"
162 width: 32; height: 32
164 anchors.fill: parent;
166 configParametersComponent.updateWeekdaysOnly = !configParametersComponent.updateWeekdaysOnly;
173 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
174 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
175 text: "Only on weekdays"
176 color: configParametersComponent.updateWeekdaysOnly? "#ffffff" :"#B8B8B8";
180 id: rowUpdateConnections
181 anchors.top: rowUpdateDays.bottom
183 anchors.left: parent.left
184 anchors.leftMargin: 5
185 anchors.right: parent.right
190 id: checkboxUpdateKnownConnections
191 source: configParametersComponent.updateOnSavedNetworksOnly? "Library/images/checkbox_checked.png":"Library/images/checkbox_unchecked.png"
192 width: 32; height: 32
194 anchors.fill: parent;
196 configParametersComponent.updateOnSavedNetworksOnly = !configParametersComponent.updateOnSavedNetworksOnly;
203 horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
204 font.pixelSize: 20; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black"
205 text: "Only on saved Wifi connections"
206 color: configParametersComponent.updateOnSavedNetworksOnly? "#ffffff" :"#B8B8B8";