4 property bool newPlugin:false;
6 function setInfo(string){
7 infoLabel.text = string;
9 function setStartValues(startFrom, startTo, startFromIndex, startToIndex){
10 comboFrom.setStartValue(startFrom, startFromIndex)
11 comboTo.setStartValue(startTo, startToIndex)
13 function revertLang(){
14 var tmpidx = comboFrom.index
15 comboFrom.index = comboTo.index
16 comboTo.index = tmpidx
18 var tmpval = comboFrom.value
19 comboFrom.value = comboTo.value
20 comboTo.value = tmpval
23 function setNew(bool){
27 signal saveButtonClicked(string langFrom, string langTo);
31 height: infoLabel.height + fromLabel.height + toLabel.height + saveButton.height + 50
33 color : myPalette.window;
37 colorGroup:SystemPalette.Active
42 anchors.bottomMargin: 6
43 anchors.rightMargin: 0
44 anchors.left: fromLabel.right
45 anchors.right: revertButton.left
46 anchors.bottom: saveButton.top
47 anchors.top: parent.top
54 height: paintedHeight+5;
55 anchors.right: parent.right
56 anchors.left: parent.left
57 anchors.top: parent.top
59 transformOrigin: Item.Left
67 height: paintedHeight+5;
68 anchors.top: infoLabel.bottom
69 anchors.left: parent.left
71 transformOrigin: Item.Left
79 height: paintedHeight+5;
80 anchors.top: fromLabel.bottom
81 anchors.left: parent.left
83 transformOrigin: Item.Left
90 anchors.right: revertButton.left
91 anchors.rightMargin: 5
92 anchors.left: fromLabel.right
93 anchors.leftMargin: 10
94 anchors.verticalCenter: fromLabel.verticalCenter
96 parentField: comboField
98 basicHeight: fromLabel.height
110 anchors.right: revertButton.left
111 anchors.rightMargin: 5
112 anchors.left: fromLabel.right
113 anchors.leftMargin: 10
114 anchors.verticalCenter: toLabel.verticalCenter
116 parentField: comboField;
118 basicHeight: fromLabel.height
131 height: fromLabel.height
132 anchors.top: fromLabel.bottom
133 anchors.topMargin: -8
134 anchors.right: parent.right
135 pathToIcon: "qrc:/button/revert.png"
136 onClicked: { rectangle1.revertLang() }
142 anchors.bottom: parent.bottom
143 anchors.right: parent.right
144 anchors.left: parent.left
146 rectangle1.saveButtonClicked(comboFrom.value, comboTo.value);
155 comboTo.expanded=false;
156 comboFrom.expanded=false;
165 when: newPlugin==true
166 PropertyChanges { target: saveButton; textInButton: qsTr("Add") }
170 when: newPlugin==false
171 PropertyChanges { target: saveButton; textInButton: qsTr("Save settings") }
179 property bool newPlugin:false;
181 function setInfo(string){
182 infoLabel.text = string;
184 function setStartValues(startFrom, startTo, startFromIndex, startToIndex){
185 comboFrom.setStartValue(startFrom, startFromIndex)
186 comboTo.setStartValue(startTo, startToIndex)
188 function revertLang(){
189 var tmpidx = comboFrom.index
190 comboFrom.index = comboTo.index
191 comboTo.index = tmpidx
193 var tmpval = comboFrom.value
194 comboFrom.value = comboTo.value
195 comboTo.value = tmpval
198 function setNew(bool){
202 signal saveButtonClicked(string langFrom, string langTo);
206 height: infoLabel.height + fromLabel.height + toLabel.height + saveButton.height + 50
209 SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
210 color : myPalette.window;
215 height: paintedHeight+5;
216 anchors.right: parent.right
217 anchors.left: parent.left
218 anchors.top: parent.top
220 transformOrigin: Item.Left
228 height: paintedHeight+5;
229 anchors.top: infoLabel.bottom
230 anchors.left: parent.left
232 transformOrigin: Item.Left
239 height: paintedHeight+5;
240 anchors.top: fromLabel.bottom
241 anchors.left: parent.left
243 transformOrigin: Item.Left
248 //parentField: rectangle1
252 anchors.left: parent.left
253 anchors.leftMargin: {
254 if (fromLabel.width < 30 && toLabel.width < 30){
257 else if (fromLabel.width > toLabel.width){
258 return fromLabel.width + 10
261 return toLabel.width + 10
265 anchors.top: infoLabel.bottom
266 anchors.right: revertButton.left
267 anchors.rightMargin: 10
269 basicHeight: fromLabel.height
270 expandedHeight: parent.height - comboFrom.x - saveButton.height -20
274 //parentField: rectangle1;
277 anchors.left: parent.left
278 anchors.leftMargin: {
279 if (fromLabel.width < 30 && toLabel.width < 30){
282 else if (fromLabel.width > toLabel.width){
283 return fromLabel.width + 10
286 return toLabel.width + 10
290 anchors.right: revertButton.left
291 anchors.rightMargin: 10
292 anchors.top: comboFrom.bottom
294 basicHeight: fromLabel.height
295 expandedHeight: parent.height - comboTo.x - saveButton.height - 20 - fromLabel.height
301 height: fromLabel.height
302 anchors.top: fromLabel.top
303 anchors.topMargin: fromLabel.height /2
304 anchors.right: parent.right
305 pathToIcon: "qrc:/button/revert.png"
306 onClicked: { rectangle1.revertLang() }
313 anchors.bottom: parent.bottom
314 anchors.right: parent.right
315 anchors.left: parent.left
317 rectangle1.saveButtonClicked(comboFrom.value, comboTo.value);
324 when: newPlugin==true
325 PropertyChanges { target: saveButton; textInButton: qsTr("Add") }
329 when: newPlugin==false
330 PropertyChanges { target: saveButton; textInButton: qsTr("Save settings") }