-
Notifications
You must be signed in to change notification settings - Fork 1
/
KsSettings.qml
145 lines (124 loc) · 6.11 KB
/
KsSettings.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import QtQuick 1.0
import "startupChecks.js" as Checks
import "popups.js" as Popups
Item{
id: kssettings
//color:"transparent"
width: 360
height: 640
Component.onCompleted: Checks.getks()
function setks(){
return i8910tuning.setks_slot(mass.value, gravity.value, erp.value, cfm.value, highlight_timeout.value, drag_threshold.value,
frame_delay.value, min_frame_interval.value, ode_enabled.value, short_list_empty_space.value, long_list_empty_space.value)
}
Image{
source: "images/bg4.jpg"
}
VisualItemModel{
id: ksmodel
Item{
width:360
height: col.height
Column{
id: col
spacing: 5
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
Slider{id:mass; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Mass"; step: 1; minimum: 0; maximum: 50}
Slider{id:gravity; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Gravity"; step: 1; minimum: 0; maximum: 50 }
Slider{id:erp; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Surface ERP"; step: 1; minimum: 0; maximum: 100}
Slider{id:cfm; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Surface CFM"; step: 1; minimum: 0; maximum: 50}
Slider{id:highlight_timeout; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Highlight TOut"; step: 1; minimum: 0; maximum: 100}
Slider{id:drag_threshold; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Drag Threshold"; step: 1; minimum: 0; maximum: 100}
Slider{id:frame_delay; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "Frame Delay"; step: 1; minimum: 0; maximum: 50}
Slider{id:min_frame_interval; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "MinFrameInterval"; step: 1; minimum: 0; maximum: 100}
Slider{id:ode_enabled; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "KS Enable/Disable"; step: 1; minimum: 0; maximum: 1}
Slider{id:short_list_empty_space; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "ShortListEmpty"; step: 1; minimum: 0; maximum: 200}
Slider{id:long_list_empty_space; anchors.horizontalCenter: parent.horizontalCenter; propertyname: "LongListEmpty"; step: 1; minimum: 0; maximum: 200}
Image{
id:ksimg
anchors.horizontalCenter: parent.horizontalCenter
width: 260
height: 75
source: "images/butt.png"
Text{
anchors.centerIn:parent
text: "Apply"
}
MouseArea{
id: ksButt
anchors.fill: parent
onClicked: {if (setks()) {Popups.showErrorBox("Could not set ks values");} else {Popups.showSuccessBox("KS Settings successfully changed!")}; Checks.getks()}
}
states: State {
name: "pressed"; when: ksButt.pressed == true
PropertyChanges { target: ksimg; source: "images/butt_pressed.png" }
}
}
Image{
id:defaultks
anchors.horizontalCenter: parent.horizontalCenter
width: 260
height: 75
source: "images/butt.png"
Text{
anchors.centerIn:parent
text: "Restore Default"
}
MouseArea{
id: defaultksButt
anchors.fill: parent
onClicked: {
Popups.confirmcomp = Qt.createComponent("ConfirmBox.qml");
Popups.confirmitem = Popups.confirmcomp.createObject(page)
Popups.confirmitem.anchors.centerIn = page;
Popups.confirmitem.title = "WARNING"
Popups.confirmitem.msg = "Do you really want to restore default ks settings?"
page.loadingRect.opacity=0.6;
Popups.confirmitem.opacity = 1;
page.disableMouseBack = true
Popups.confirmitem.confirmed.connect(Popups.defaultks)
}
states: State {
name: "pressed"; when: defaultksButt.pressed == true
PropertyChanges { target: defaultks; source: "images/butt_pressed.png" }
}
}
}
Image{
id:refreshks
anchors.horizontalCenter: parent.horizontalCenter
width: 260
height: 75
source: "images/butt.png"
Text{
anchors.centerIn:parent
text: "Refresh"
}
MouseArea{
id: refreshksButt
anchors.fill: parent
onClicked: {
Checks.getks()
}
states: State {
name: "pressed"; when: refreshksButt.pressed == true
PropertyChanges { target: refreshks; source: "images/butt_pressed.png" }
}
}
}
}
}
}
ListView{
id: kslist
anchors.fill: parent
anchors.bottomMargin: 75
anchors.topMargin: 75
model: ksmodel
orientation: ListView.Vertical
flickDeceleration: 1000
highlightFollowsCurrentItem: true
highlightMoveDuration:240
}
}