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);
29 height: infoLabel.height + fromLabel.height + toLabel.height + saveButton.height + 50
36 SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
37 color : myPalette.window;
42 height: paintedHeight+5;
43 anchors.right: parent.right
44 anchors.left: parent.left
45 anchors.top: parent.top
47 transformOrigin: Item.Left
55 height: paintedHeight+5;
56 anchors.top: infoLabel.bottom
57 anchors.left: parent.left
59 transformOrigin: Item.Left
66 height: paintedHeight+5;
67 anchors.top: fromLabel.bottom
68 anchors.left: parent.left
70 transformOrigin: Item.Left
77 anchors.left: parent.left
79 if (fromLabel.width < 30 && toLabel.width < 30){
82 else if (fromLabel.width > toLabel.width){
83 return fromLabel.width + 10
86 return toLabel.width + 10
90 anchors.top: infoLabel.bottom
91 anchors.right: revertButton.left
92 anchors.rightMargin: 10
94 basicHeight: fromLabel.height
95 expandedHeight: parent.height - comboFrom.x - saveButton.height -20
101 anchors.left: parent.left
102 anchors.leftMargin: {
103 if (fromLabel.width < 30 && toLabel.width < 30){
106 else if (fromLabel.width > toLabel.width){
107 return fromLabel.width + 10
110 return toLabel.width + 10
114 anchors.right: revertButton.left
115 anchors.rightMargin: 10
116 anchors.top: comboFrom.bottom
118 basicHeight: fromLabel.height
119 expandedHeight: parent.height - comboTo.x - saveButton.height - 20 - fromLabel.height
125 height: fromLabel.height
126 anchors.top: fromLabel.top
127 anchors.topMargin: fromLabel.height /2
128 anchors.right: parent.right
129 pathToIcon: "qrc:/button/revert.png"
130 onClicked: { rectangle1.revertLang() }
137 anchors.bottom: parent.bottom
138 anchors.right: parent.right
139 anchors.left: parent.left
141 rectangle1.saveButtonClicked(comboFrom.value, comboTo.value);
148 when: newPlugin==true
149 PropertyChanges { target: saveButton; textInButton: qsTr("Add") }
153 when: newPlugin==false
154 PropertyChanges { target: saveButton; textInButton: qsTr("Save settings") }