~ubuntu-branches/ubuntu/vivid/youker-assistant/vivid

« back to all changes in this revision

Viewing changes to qml/func/settings/FcitxConfigtoolKey.qml

  • Committer: Package Import Robot
  • Author(s): Kobe Lee (kylinkobe)
  • Date: 2013-09-18 16:22:14 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130918162214-6nqyjyf3cd3ynqky
Tags: 0.2.1-0ubuntu1
* Modify the mouse events of MonitorBall.
* Add reset button for clear pages.
* Add policykit for apt clear in sudodbus.
* Fixed the bug about software status and add masklayer.
* Rewrite the code of system information.
* Add some signals and slots.
* Fixed the bug about Software signals(LP: #1226389).
* Modify KThread and add base.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    width: parent.width
10
10
    height: 475
11
11
 
12
 
    property string actiontitle: "小企鹅输入法快捷键/云输入/皮肤配置"
13
 
    property string actiontext: "可以设置自己喜欢的方式,点击"下一步"继续设置,点击"取消"取消当前设置并返回,点击“应用”按钮完成输入法设置。"
14
 
    property string selectedimage: ""
15
 
    property string defaultChangeMethod: ""
16
 
    property string eventABC:""
17
 
    property int hotkyScrollBetweenIndex: 0
18
 
    property string methodBtn1Tmp: ""
19
 
    property string methodBtn2Tmp:""
20
 
    property string prevpageBtn1Tmp: ""
21
 
    property string prevpageBtn2Tmp: ""
22
 
    property string nextpageBtn1Tmp: ""
23
 
    property string nextpageBtn2Tmp: ""
 
12
    property string actiontitle: "小企鹅输入法外观配置"
 
13
    property string actiontext: "可以设置自己喜欢的皮肤,点击“应用”完成设置,点击"上一步"返回上一界面设置。"
 
14
    property int flagCheck: 1
 
15
    property int flag_i: 0
 
16
    property string h_fcitxSkinImage: ""
 
17
    property string v_fcitxSkinImage: ""
24
18
    //背景
25
19
    Image {
26
20
        source: "../../img/skin/bg-left.png"
34
28
        anchors.topMargin: 44
35
29
        anchors.left: parent.left
36
30
        anchors.leftMargin: 80
37
 
        Text {
38
 
             text: fcitxconfigtoolKey.actiontitle
39
 
             font.bold: true
40
 
             font.pixelSize: 14
41
 
             color: "#383838"
 
31
        Row{
 
32
            spacing: 50
 
33
            Text {
 
34
                 text: fcitxconfigtoolKey.actiontitle
 
35
                 font.bold: true
 
36
                 font.pixelSize: 14
 
37
                 color: "#383838"
42
38
 
43
 
         }
 
39
             }
 
40
            //status picture
 
41
            Image {
 
42
                id: statusImage
 
43
                visible: false
 
44
                source: "../../img/toolWidget/finish.png"
 
45
                fillMode: "PreserveAspectFit"
 
46
                smooth: true
 
47
                anchors.verticalCenter: parent.verticalCenter
 
48
            }
 
49
        }
44
50
         Text {
45
51
             text: fcitxconfigtoolKey.actiontext
46
52
             font.pixelSize: 12
49
55
    }
50
56
 
51
57
    function refreshFcitxKey(){
52
 
        fcitxChangeModel.clear();
53
58
        skinModel.clear();
54
 
        //get_trigger_key========================================================
55
 
        var getMethodBtn1 = fcitxcfgwizard.get_trigger_key_first();
56
 
 
57
 
        methodBtn1.text = getMethodBtn1;
58
 
 
59
 
        var getMethodBtn2 = fcitxcfgwizard.get_trigger_key_second();
60
 
        methodBtn2.text = getMethodBtn2
61
 
 
62
 
        //get_prev_page_key======================================================
63
 
        var getPrevPageBtn1 = fcitxcfgwizard.get_prev_page_key_first();
64
 
        prevPageBtn1.text = getPrevPageBtn1;
65
 
        var getPrevPageBtn2 = fcitxcfgwizard.get_prev_page_key_second();
66
 
        prevPageBtn2.text = getPrevPageBtn2
67
 
 
68
 
        //get_next_page_key=======================================================
69
 
        var getNextpageBtn1 = fcitxcfgwizard.get_next_page_key_first();
70
 
        nextPageBtn1.text = getNextpageBtn1;
71
 
        var getNextpageBtn2 = fcitxcfgwizard.get_next_page_key_second();
72
 
        nextPageBtn2.text = getNextpageBtn2;
73
 
 
74
 
        //get_im_switch_key
75
 
        var getEnableHotKeybool =fcitxcfgwizard.get_im_switch_key();
76
 
        enableHotKeyBox.checked = getEnableHotKeybool;
77
 
 
78
 
        //set_im_switch_hot_key=======================================================
79
 
          var getHotkyScrollBetween = fcitxcfgwizard.get_im_switch_hot_key()
80
 
        if(getHotkyScrollBetween==0)
81
 
        {
82
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
83
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
84
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
85
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
86
 
        }
87
 
        if(getHotkyScrollBetween==1)
88
 
        {
89
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
90
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
91
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
92
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
93
 
        }
94
 
        if(getHotkyScrollBetween==2)
95
 
        {
96
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
97
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
98
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
99
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
100
 
        }
101
 
        if(getHotkyScrollBetween==3)
102
 
        {
103
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
104
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
105
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
106
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
107
 
        }
 
59
//        refreshSkinModel.clear()
 
60
//        skinCombo.model = refreshSkinModel
 
61
//        refreshSkinModel.append({"skinTitel": "11111111111"})
 
62
        //set font============================================================
 
63
        var setFont = fcitxcfgwizard.get_font();
 
64
        fontStyleBtn.text = setFont;
 
65
        //get font size=======================================================
 
66
        var getFontSize = fcitxcfgwizard.get_font_size();
 
67
        if(getFontSize == 0)
 
68
            getFontSize = fcitxcfgwizard.get_font_size();
 
69
        sliderFontSize.value = getFontSize;
108
70
 
109
71
        //get_skin_list and current_skin=================================================
110
72
        var getSkinList = fcitxcfgwizard.get_all_skin_type()
111
73
        var getCurrentSkin = fcitxcfgwizard.get_skin_type()
112
 
        getSkinList.unshift(getCurrentSkin);
 
74
        if(getCurrentSkin != "default")
 
75
        {
 
76
            enableSkinBox.checked = true
 
77
            flagCheck = 1;
 
78
        }
 
79
        else
 
80
        {
 
81
            enableSkinBox.checked = false;
 
82
            flagCheck = 0;
 
83
        }
 
84
        getSkinList.unshift(getCurrentSkin);   //js将数组第一个添加unshift进来的
113
85
        skinModel.clear();
114
86
        for(var i=0;i<getSkinList.length;i++)
115
87
       {
117
89
            if(i!=0&&(getSkinList[i] == getCurrentSkin))
118
90
                skinModel.remove(i);
119
91
        }
 
92
        //load_skin_image====================================================
 
93
        if(getCurrentSkin == "default")
 
94
        {
 
95
            h_fcitxSkinImage = "../../img/skin/h_default.png"
 
96
            v_fcitxSkinImage = "../../img/skin/v_default.png"
 
97
        }
 
98
        else if(getCurrentSkin == "dark")
 
99
        {
 
100
            h_fcitxSkinImage = "../../img/skin/h_dark.png"
 
101
            v_fcitxSkinImage = "../../img/skin/v_dark.png"
 
102
        }
 
103
        else if(getCurrentSkin == "classic")
 
104
        {
 
105
            h_fcitxSkinImage = "../../img/skin/h_classic.png"
 
106
            v_fcitxSkinImage = "../../img/skin/v_classic.png"
 
107
        }
 
108
        else{
 
109
            h_fcitxSkinImage = ""
 
110
            v_fcitxSkinImage = ""
 
111
        }
 
112
 
 
113
  }
 
114
    //选择皮肤
 
115
    ListModel {
 
116
        id: skinModel
 
117
        ListElement {skinTitle: ""}
120
118
    }
 
119
 
121
120
    Connections {
122
121
            target: fcitxcfgwizard
123
122
            onRefreshFcitxSig: {
124
123
                refreshFcitxKey();
125
124
            }
126
125
        }
 
126
 
127
127
    Component.onCompleted: {
128
 
        fcitxChangeModel.clear();
129
128
        skinModel.clear();
130
 
        //get_trigger_key========================================================
131
 
        var getMethodBtn1 = fcitxcfgwizard.get_trigger_key_first();
132
 
        methodBtn1.text = getMethodBtn1;
133
 
        var getMethodBtn2 = fcitxcfgwizard.get_trigger_key_second();
134
 
        methodBtn2.text = getMethodBtn2
135
 
 
136
 
        //get_prev_page_key======================================================
137
 
        var getPrevPageBtn1 = fcitxcfgwizard.get_prev_page_key_first();
138
 
        prevPageBtn1.text = getPrevPageBtn1;
139
 
        var getPrevPageBtn2 = fcitxcfgwizard.get_prev_page_key_second();
140
 
        prevPageBtn2.text = getPrevPageBtn2
141
 
 
142
 
        //get_next_page_key=======================================================
143
 
        var getNextpageBtn1 = fcitxcfgwizard.get_next_page_key_first();
144
 
        nextPageBtn1.text = getNextpageBtn1;
145
 
        var getNextpageBtn2 = fcitxcfgwizard.get_next_page_key_second();
146
 
        nextPageBtn2.text = getNextpageBtn2;
147
 
 
148
 
        //get_im_switch_key
149
 
        var getEnableHotKeybool =fcitxcfgwizard.get_im_switch_key();
150
 
        enableHotKeyBox.checked = getEnableHotKeybool;
151
 
 
152
 
        //set_im_switch_hot_key=======================================================
153
 
          var getHotkyScrollBetween = fcitxcfgwizard.get_im_switch_hot_key()
154
 
        if(getHotkyScrollBetween==0)
155
 
        {
156
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
157
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
158
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
159
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
160
 
        }
161
 
        if(getHotkyScrollBetween==1)
162
 
        {
163
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
164
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
165
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
166
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
167
 
        }
168
 
        if(getHotkyScrollBetween==2)
169
 
        {
170
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
171
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
172
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
173
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
174
 
        }
175
 
        if(getHotkyScrollBetween==3)
176
 
        {
177
 
            fcitxChangeModel.append({"text": "ALT_SUPER"});
178
 
            fcitxChangeModel.append({"text": "CTRL_SHIFT"});
179
 
            fcitxChangeModel.append({"text": "ALT_SHIFT"});
180
 
            fcitxChangeModel.append({"text": "CTRL_SUPER"});
181
 
        }
 
129
        //set font============================================================
 
130
        var setFont = fcitxcfgwizard.get_font();
 
131
        fontStyleBtn.text = setFont;
 
132
        //get font size=======================================================
 
133
        var getFontSize = fcitxcfgwizard.get_font_size();
 
134
        if(getFontSize == 0)
 
135
            getFontSize = fcitxcfgwizard.get_font_size();
 
136
        if(getFontSize == 0)
 
137
            getFontSize = 12;
 
138
        sliderFontSize.value = getFontSize;
182
139
 
183
140
        //get_skin_list and current_skin=================================================
184
141
        var getSkinList = fcitxcfgwizard.get_all_skin_type()
185
142
        var getCurrentSkin = fcitxcfgwizard.get_skin_type()
 
143
        if(getCurrentSkin != "default")
 
144
        {
 
145
            enableSkinBox.checked = true
 
146
            flagCheck = 1;
 
147
        }
 
148
        else
 
149
        {
 
150
            enableSkinBox.checked = false;
 
151
            flagCheck = 0;
 
152
        }
186
153
        getSkinList.unshift(getCurrentSkin);   //js将数组第一个添加unshift进来的
187
154
        skinModel.clear();
188
155
        for(var i=0;i<getSkinList.length;i++)
191
158
            if(i!=0&&(getSkinList[i] == getCurrentSkin))
192
159
                skinModel.remove(i);
193
160
        }
194
 
 
195
 
    }
196
 
 
197
 
    Column{
 
161
        //load_skin_image====================================================
 
162
        if(getCurrentSkin == "default")
 
163
        {
 
164
            h_fcitxSkinImage = "../../img/skin/h_default.png"
 
165
            v_fcitxSkinImage = "../../img/skin/v_default.png"
 
166
        }
 
167
        else if(getCurrentSkin == "dark")
 
168
        {
 
169
            h_fcitxSkinImage = "../../img/skin/h_dark.png"
 
170
            v_fcitxSkinImage = "../../img/skin/v_dark.png"
 
171
        }
 
172
        else if(getCurrentSkin == "classic")
 
173
        {
 
174
            h_fcitxSkinImage = "../../img/skin/h_classic.png"
 
175
            v_fcitxSkinImage = "../../img/skin/v_classic.png"
 
176
        }
 
177
        else{
 
178
            h_fcitxSkinImage = ""
 
179
            v_fcitxSkinImage = ""
 
180
        }
 
181
    }
 
182
 
 
183
 
 
184
    //分割线
 
185
    Row{
 
186
        anchors{
 
187
            left: parent.left
 
188
            leftMargin: 40
 
189
            top: parent.top
 
190
            topMargin: 120
 
191
        }
 
192
        spacing: 5
 
193
        Text{
 
194
            text: "皮肤设置"
 
195
            font.bold: true
 
196
            font.pixelSize: 12
 
197
            color: "#383838"
 
198
        }
 
199
        Rectangle{
 
200
            width:700
 
201
            height:1
 
202
            color:"#b9c5cc"
 
203
            anchors.verticalCenter: parent.verticalCenter
 
204
        }
 
205
    }
 
206
    //使用皮肤
 
207
    Row{
 
208
        spacing: 75
 
209
        anchors {
 
210
            top: parent.top
 
211
            topMargin: 150
 
212
            left: parent.left
 
213
            leftMargin: 65
 
214
        }
 
215
        Common.CheckBox{
 
216
            id:enableSkinBox
 
217
            anchors.verticalCenter: parent.verticalCenter
 
218
            titleName: "使用皮肤"
 
219
            onCheckedChanged: {
 
220
                if(flagCheck == 1)
 
221
                {
 
222
                    if(enableSkinBox.checked == false)
 
223
                    {
 
224
                        var getSkinList = fcitxcfgwizard.get_all_skin_type()
 
225
                        for(var i=0;i<getSkinList.length;i++)
 
226
                       {
 
227
                            if(getSkinList[i] == "default")
 
228
                            {
 
229
                                flag_i = i;
 
230
                                break;
 
231
                            }
 
232
                        }
 
233
                        if(fcitxcfgwizard.get_skin_type()=="default")
 
234
                                {
 
235
                                    flag_i = 0;
 
236
                                }
 
237
 
 
238
                        skinCombo.selectedIndex = flag_i;
 
239
                    }
 
240
                }
 
241
            }
 
242
        }
 
243
        Common.ComboBox {
 
244
            id: skinCombo
 
245
            model: skinModel
 
246
            width: 130
 
247
            height: 25
 
248
            onSelectedTextChanged: {
 
249
                if(skinCombo.selectedText == "default")
 
250
                {
 
251
                    enableSkinBox.checked = false;
 
252
                    flagCheck = 0;
 
253
 
 
254
                }
 
255
                else{
 
256
                    enableSkinBox.checked = true;
 
257
                    flagCheck = 1;
 
258
                }
 
259
 
 
260
                //load_skin_image====================================================
 
261
                 if(skinCombo.selectedText == "default")
 
262
                {
 
263
                    h_fcitxSkinImage = "../../img/skin/h_default.png"
 
264
                    v_fcitxSkinImage = "../../img/skin/v_default.png"
 
265
 
 
266
                }
 
267
                else if(skinCombo.selectedText == "dark")
 
268
                {
 
269
                    h_fcitxSkinImage = "../../img/skin/h_dark.png"
 
270
                    v_fcitxSkinImage = "../../img/skin/v_dark.png"
 
271
                }
 
272
                else if(skinCombo.selectedText == "classic")
 
273
                {
 
274
                    h_fcitxSkinImage = "../../img/skin/h_classic.png"
 
275
                    v_fcitxSkinImage = "../../img/skin/v_classic.png"
 
276
                }
 
277
                else{
 
278
                    h_fcitxSkinImage = "../../img/skin/fcitxSkin_not.png"
 
279
                    v_fcitxSkinImage = ""
 
280
                }
 
281
           }
 
282
        }
 
283
     }
 
284
    //更换字体
 
285
    Row{
 
286
        spacing: 75
 
287
        anchors {
 
288
            top: parent.top
 
289
            topMargin: 180
 
290
            left: parent.left
 
291
            leftMargin: 65
 
292
        }
 
293
        Common.CheckBox{
 
294
            id:enableHotKeyBox
 
295
            anchors.verticalCenter: parent.verticalCenter
 
296
            titleName: "更换字体"
 
297
            onCheckedChanged: {
 
298
                if(enableHotKeyBox.checked == false)
 
299
                {
 
300
                    sliderFontSize.value = 12;
 
301
                    fontStyleBtn.text = "Sans";
 
302
                }
 
303
            }
 
304
        }
 
305
        //fontsize
 
306
        Row{
 
307
            spacing: 10
 
308
            Text {
 
309
                id: fontSize
 
310
                font.pixelSize: 12
 
311
                color: "#7a7a7a"
 
312
                anchors.verticalCenter: parent.verticalCenter
 
313
                text: qsTr("大小")
 
314
            }
 
315
            Row{
 
316
                spacing: 10
 
317
                Common.Slider {
 
318
                    id: sliderFontSize
 
319
                    anchors.verticalCenter: parent.verticalCenter
 
320
                    minimumValue: 1
 
321
                    maximumValue: 72
 
322
                    value:12
 
323
                    width: 150
 
324
                    stepSize: 1
 
325
                    animated: true
 
326
                    onValueChanged: {
 
327
                        if(sliderFontSize.value != 12)
 
328
                        {
 
329
                            enableHotKeyBox.checked = true;
 
330
                        }
 
331
                    }
 
332
                }
 
333
                Text {
 
334
                    id: displayFontSize
 
335
                    text: sliderFontSize.value
 
336
                    font.pixelSize: 12
 
337
                    color: "#7a7a7a"
 
338
                    anchors.verticalCenter: parent.verticalCenter
 
339
                }
 
340
            }
 
341
        }
 
342
     }
 
343
    //font
 
344
   Row{
 
345
       spacing: 10
 
346
       anchors {
 
347
           top: parent.top
 
348
           topMargin: 180
 
349
           left: parent.left
 
350
           leftMargin: 400
 
351
       }
 
352
       Text {
 
353
           id: font
 
354
           font.pixelSize: 12
 
355
           color: "#7a7a7a"
 
356
           anchors.verticalCenter: parent.verticalCenter
 
357
           text: qsTr("字体设置")
 
358
       }
 
359
       Common.Button {
 
360
            id: fontStyleBtn
 
361
            smooth:true
 
362
            width: 160;height: 25
 
363
            hoverimage: "fcitxFont.png"//../../img/icons/
 
364
            fontcolor:"#929292"
 
365
            fontsize: 13
 
366
            anchors.verticalCenter: font.verticalCenter
 
367
           onClicked: {
 
368
               fontStyleBtn.text = fcitxcfgwizard.show_font_dialog();
 
369
           }
 
370
           onTextChanged: {
 
371
               if(fontStyleBtn.text != "Sans" )
 
372
               {
 
373
                   enableHotKeyBox = true;
 
374
               }
 
375
           }
 
376
       }
 
377
   }
 
378
 
 
379
 
 
380
    Rectangle{
198
381
        anchors{
199
382
            top:parent.top
200
 
            topMargin: 110
 
383
            topMargin: 220
201
384
            left:parent.left
202
 
            leftMargin: 80
203
 
        }
204
 
        spacing: 15
205
 
        //Trigger Input Method
206
 
        Row{
207
 
            spacing: 179
208
 
            Text{
209
 
                id:inputMethod
210
 
                text:qsTr("切换激活/非激活输入法")
211
 
            }
212
 
            Row{
213
 
                spacing: 5
214
 
                Common.Button{
215
 
                    id:methodBtn1
216
 
                    //focus:true
217
 
 
218
 
    //                text:""
219
 
                    //hoverimage: "button_normal.png"
220
 
                    width:200
221
 
                    height:30
222
 
                    onClicked: {
223
 
                        methodBtn1.forceActiveFocus();
224
 
                        methodBtn1.text = "请按下要设置的组合键";
225
 
                    }
226
 
                    onEntered:{
227
 
                        methodBtn1Tmp = methodBtn1.text
228
 
                    }
229
 
                    onExited: {
230
 
                        methodBtn1.text = methodBtn1Tmp
231
 
                    }
232
 
                    Keys.onPressed: {
233
 
                        methodBtn1.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
234
 
                        methodBtn1Tmp = methodBtn1.text;
235
 
                    }
236
 
 
237
 
 
238
 
                }
239
 
 
240
 
                Common.Button{
241
 
                    id:methodBtn2
242
 
                    //focus:true
243
 
 
244
 
                    //hoverimage:"button_normal.png"
245
 
    //                text:"Empty"
246
 
                    width:200
247
 
                    height:30
248
 
                    onClicked: {
249
 
                        methodBtn2.forceActiveFocus();
250
 
                        methodBtn2.text = "请按下要设置的组合键"
251
 
                    }
252
 
                    onEntered:{
253
 
                        methodBtn2Tmp = methodBtn2.text
254
 
                    }
255
 
                    onExited: {
256
 
                        methodBtn2.text = methodBtn2Tmp
257
 
                    }
258
 
                    Keys.onPressed: {
259
 
                        methodBtn2.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
260
 
                        methodBtn2Tmp = methodBtn2.text
261
 
                    }
262
 
                 }
263
 
            }
264
 
        }
265
 
        //Prev Page
266
 
        Row{
267
 
            spacing: 287
268
 
            Text {
269
 
                id: prevPage
270
 
                text: qsTr("上一页")
271
 
            }
272
 
            Row{
273
 
                spacing: 5
274
 
                Common.Button{
275
 
                    id:prevPageBtn1
276
 
                    width:200
277
 
                    height:30
278
 
                    onClicked: {
279
 
                        prevPageBtn1.forceActiveFocus();
280
 
                        prevPageBtn1.text = "请按下要设置的组合键"
281
 
                    }
282
 
                    onEntered:{
283
 
                        prevpageBtn1Tmp = prevPageBtn1.text
284
 
                    }
285
 
                    onExited: {
286
 
                        prevPageBtn1.text = prevpageBtn1Tmp
287
 
                    }
288
 
                    Keys.onPressed: {
289
 
                        prevPageBtn1.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
290
 
                        prevpageBtn1Tmp = prevPageBtn1.text;
291
 
                    }
292
 
                }
293
 
                Common.Button{
294
 
                    id:prevPageBtn2
295
 
                    width:200
296
 
                    height:30
297
 
                    onClicked: {
298
 
                        prevPageBtn2.forceActiveFocus();
299
 
                        prevPageBtn2.text = "请按下要设置的组合键";
300
 
                    }
301
 
                    onEntered:{
302
 
                        prevpageBtn2Tmp = prevPageBtn2.text;
303
 
                    }
304
 
                    onExited: {
305
 
                        prevPageBtn2.text = prevpageBtn2Tmp;
306
 
                    }
307
 
                    Keys.onPressed: {
308
 
                        prevPageBtn2.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
309
 
                        prevpageBtn2Tmp = prevPageBtn2.text;
310
 
                    }
311
 
                }
312
 
            }
313
 
        }
314
 
        //Next Page
315
 
        Row{
316
 
            spacing: 287
317
 
            Text {
318
 
                id: nextPage
319
 
                text: qsTr("下一页")
320
 
            }
321
 
            Row{
322
 
                spacing: 5
323
 
                Common.Button{
324
 
                    id:nextPageBtn1
325
 
                    width:200
326
 
                    height:30
327
 
                    onClicked: {
328
 
                        nextPageBtn1.forceActiveFocus();
329
 
                        nextPageBtn1.text = "请按下要设置的组合键";
330
 
                    }
331
 
                    onEntered:{
332
 
                        nextpageBtn1Tmp = nextPageBtn1.text;
333
 
                    }
334
 
                    onExited: {
335
 
                        nextPageBtn1.text = nextpageBtn1Tmp;
336
 
                    }
337
 
                    Keys.onPressed: {
338
 
                        nextPageBtn1.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
339
 
                        nextpageBtn1Tmp = nextPageBtn1.text;
340
 
                    }
341
 
                }
342
 
                Common.Button{
343
 
                    id:nextPageBtn2
344
 
                    width:200
345
 
                    height:30
346
 
                    onClicked: {
347
 
                        nextPageBtn2.forceActiveFocus();
348
 
                        nextPageBtn2.text = "请按下要设置的组合键";
349
 
                    }
350
 
                    onEntered:{
351
 
                        nextpageBtn2Tmp = nextPageBtn2.text;
352
 
                    }
353
 
                    onExited: {
354
 
                        nextPageBtn2.text = nextpageBtn2Tmp;
355
 
                    }
356
 
                    Keys.onPressed: {
357
 
                        nextPageBtn2.text = fcitxcfgwizard.get_fcitx_hot_key_string(event.key, event.modifiers);
358
 
                        nextpageBtn2Tmp = nextPageBtn2.text;
359
 
                    }
360
 
                }
361
 
             }
362
 
        }
363
 
        Row{
364
 
            spacing: 272
365
 
            //选择皮肤
366
 
            ListModel {
367
 
                id: skinModel
368
 
                ListElement {skinTitle: "";}
369
 
            }
370
 
            Text{
371
 
                id:skinchoose
372
 
                text:qsTr("皮肤选择")
373
 
            }
374
 
 
375
 
            Common.ComboBox {
376
 
                id: skinCombo
377
 
                model: skinModel
378
 
                width: 405
379
 
                onSelectedTextChanged: {
380
 
//                    skinCombo.selectedText
381
 
                }
382
 
            }
383
 
        }
384
 
        //Scroll between input Method
385
 
        Row{
386
 
            spacing: 256
387
 
            ListModel {
388
 
                id: fcitxChangeModel
389
 
                ListElement { text: "" }
390
 
            }
391
 
                Text{
392
 
                    id:scrollBetween
393
 
                    text:qsTr("输入法切换")
394
 
                }
395
 
                Common.ComboBox {
396
 
                    anchors{
397
 
                        verticalCenter: scrollBetween.verticalCenter
398
 
                    }
399
 
                    id: scrollBetweenCombo
400
 
                        model: fcitxChangeModel
401
 
                        width: 405
402
 
                        onSelectedTextChanged: {
403
 
                            hotkyScrollBetweenIndex = scrollBetweenCombo.selectedIndex;
404
 
                        }
405
 
                    }
406
 
            }
407
 
 
408
 
        Row{
409
 
            spacing: 213
410
 
            Text {
411
 
                id: hotkyScroll
412
 
                text: qsTr("启用输入法间切换")
413
 
            }
414
 
            Common.CheckBox{
415
 
                id:enableHotKeyBox
416
 
                anchors.verticalCenter: hotkyScroll.verticalCenter
417
 
                titleName: ""
418
 
            }
419
 
        }
420
 
 
421
 
        //启用云拼音
422
 
//        Row{
423
 
//        spacing: 258
424
 
//            Text {
425
 
//                id: cloudPinyin
426
 
 
427
 
//                text: qsTr("启用云拼音")
428
 
//            }
429
 
//            Common.CheckBox{
430
 
//                anchors.verticalCenter: cloudPinyin.verticalCenter
431
 
//                titleName: ""
432
 
//            }
433
 
//        }
434
 
}
 
385
            leftMargin: 65
 
386
        }
 
387
        color:"white"
 
388
        width: 680
 
389
        height: 190
 
390
 
 
391
        Rectangle{
 
392
            anchors{
 
393
                top:parent.top
 
394
                topMargin: 0
 
395
                left:parent.left
 
396
                leftMargin: 0
 
397
            }
 
398
            width:680
 
399
            height:1
 
400
            color:"#b9c5cc"
 
401
        }
 
402
        Rectangle{
 
403
            anchors{
 
404
                top:parent.top
 
405
                topMargin: 190
 
406
                left:parent.left
 
407
                leftMargin: 0
 
408
            }
 
409
            width:680
 
410
            height:1
 
411
            color:"#b9c5cc"
 
412
        }
 
413
        Rectangle{
 
414
            anchors{
 
415
                top:parent.top
 
416
                topMargin: 0
 
417
                left:parent.left
 
418
                leftMargin: 0
 
419
            }
 
420
            width:1
 
421
            height:190
 
422
            color:"#b9c5cc"
 
423
        }
 
424
        Rectangle{
 
425
            anchors{
 
426
                top:parent.top
 
427
                topMargin: 0
 
428
                left:parent.left
 
429
                leftMargin: 680
 
430
            }
 
431
            width:1
 
432
            height:190
 
433
            color:"#b9c5cc"
 
434
        }
 
435
 
 
436
        Row{
 
437
            anchors{
 
438
                top:parent.top
 
439
                topMargin: 15
 
440
                left:parent.left
 
441
                leftMargin: 20
 
442
            }
 
443
        spacing: 30
 
444
        Image {
 
445
            id: fcitxVimage
 
446
            source: v_fcitxSkinImage
 
447
            smooth: true
 
448
        }
 
449
        Image {
 
450
            id: fcitxHimage
 
451
            source: h_fcitxSkinImage
 
452
            smooth: true
 
453
            anchors.verticalCenter: parent.verticalCenter
 
454
        }
 
455
      }
 
456
 
 
457
    }
 
458
 
435
459
    //顶层工具栏
436
460
    Bars.TopBar {
437
461
        id: topBar
459
483
//            button1Label: qsTr("退出")
460
484
//            button1Label: qsTr("返回")
461
485
//            button2Label: qsTr("应用")
 
486
        onGobackHomeClicked: {
 
487
            pageStack.push(functioncollection);
 
488
        }
462
489
        onCancelBtnClicked: {
463
 
            fcitxcfgwizard.send_fcitx_ok_warn();
 
490
            fcitxcfgwizard.send_fcitx_ok_warn(mainwindow.x, mainwindow.y);
464
491
        }
465
492
        onGobackBtnClicked: {
466
493
            pageStack.push(fcitxConfigtoolFontpage);//静态添加页面
468
495
        }
469
496
        onFinishBtnClicked: {
470
497
            //接后台应用接口
471
 
            fcitxcfgwizard.set_trigger_key_first(methodBtn1.text,false);
472
 
            fcitxcfgwizard.set_trigger_key_second(methodBtn2.text,false);
473
 
            fcitxcfgwizard.set_prev_page_key_first(prevPageBtn1.text,false);
474
 
            fcitxcfgwizard.set_prev_page_key_second(prevPageBtn2.text,false);
475
 
            fcitxcfgwizard.set_next_page_key_first(nextPageBtn1.text,false);
476
 
            fcitxcfgwizard.set_next_page_key_second(nextPageBtn2.text,false);
477
 
 
478
 
            //fcitxcfgwizard.set_skin_type(skinCombo.selectedText,false);
 
498
            fcitxcfgwizard.set_font(fontStyleBtn.text,false);
 
499
            fcitxcfgwizard.set_font_size(sliderFontSize.value,false);
479
500
            fcitxcfgwizard.set_skin_type(skinCombo.selectedText, false);
480
 
 
481
 
            fcitxcfgwizard.set_im_switch_hot_key(hotkyScrollBetweenIndex,false);
482
 
            fcitxcfgwizard.set_im_switch_key(enableHotKeyBox.checked,false);
483
501
            fcitxcfgwizard.all_cfg_save()
484
 
            pageStack.push(functioncollection);
 
502
            statusImage.visible = true;
485
503
        }
 
504
        Timer {
 
505
                 interval: 5000; running: true; repeat: true
 
506
                 onTriggered: statusImage.visible = false
 
507
             }
486
508
 
487
509
    }
488
510
 
489
511
}
490
 
 
491
 
 
492