-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSettingsDialog.qml
174 lines (154 loc) · 5.72 KB
/
SettingsDialog.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import QtQuick 2.0
import Ubuntu.Components 1.1
import Ubuntu.Components.Popups 1.0
import Ubuntu.Components.ListItems 1.0
import "components"
Dialog {
id: root
title: qsTr("Media browser settings")
Column {
id: settingsCol
anchors.left: parent.left
anchors.right: parent.right
spacing: units.gu(1)
SectionHeader {
headerText: qsTr("Look and feel")
width: parent.width
color: "black"
}
// Standard {
// id: cbKeepDisplayLit
// text: qsTr("Keep display on when charging")
// control: Switch {
// checked: settings.keepDisplayLit
// }
// }
Row {
width: parent.width
spacing: units.gu(1)
CheckBox {
id: cbIgnoreArticle
checked: settings.ignoreArticle
}
Label {
width: parent.width - x
text: qsTr("Ignore articles for sorting")
anchors.verticalCenter: parent.verticalCenter
color: "black"
}
}
SectionHeader {
headerText: qsTr("Used media")
width: parent.width
color: "black"
}
Grid {
width: parent.width
columns: 4
height: childrenRect.height
spacing: units.gu(1)
CheckBox {
id: cbMusicEnabled
checked: settings.musicEnabled
}
Label {
height: cbMusicEnabled.height; verticalAlignment: Text.AlignVCenter
width: (parent.width - cbMusicEnabled.width * 2) / 2
text: qsTr("Music")
color: "black"
}
CheckBox {
id: cbVideosEnabled
checked: settings.videosEnabled
}
Label {
height: cbMusicEnabled.height; verticalAlignment: Text.AlignVCenter
width: (parent.width - cbMusicEnabled.width * 2) / 2
text: qsTr("Videos")
color: "black"
}
CheckBox {
id: cbPicturesEnabled
checked: settings.picturesEnabled
}
Label {
height: cbMusicEnabled.height; verticalAlignment: Text.AlignVCenter
width: (parent.width - cbMusicEnabled.width * 2) / 2
text: qsTr("Pictures")
color: "black"
}
CheckBox {
id: cbPvrEnabled
checked: settings.pvrEnabled
visible: kodi.pvrAvailable
}
Label {
height: cbMusicEnabled.height; verticalAlignment: Text.AlignVCenter
width: (parent.width - cbMusicEnabled.width * 2) / 2
text: qsTr("Live TV")
color: "black"
visible: kodi.pvrAvailable
}
}
// SectionHeader {
// headerText: qsTr("Phone calls")
// width: parent.width
// }
// Standard {
// id: cbChangeVol
// text: qsTr("Change volume")
// control: Switch {
// checked: settings.changeVolumeOnCall
// }
// }
// Slider {
// id: slVolume
// width: parent.width - 20
// anchors.right: parent.right
// value: settings.volumeOnCall
// enabled: cbChangeVol.checked
// maximumValue: 100
// }
// Standard {
// id: cbPauseVideo
// text: qsTr("Pause video")
// control: Switch {
// checked: settings.pauseVideoOnCall
// }
// }
// Standard {
// id: cbPauseMusic
// text: qsTr("Pause music")
// control: Switch {
// checked: settings.pauseMusicOnCall
// }
// }
// Standard {
// id: cbShowNotifications
// text: qsTr("Show call notifications")
// control: Switch {
// checked: settings.showCallNotifications
// }
// }
Button {
text: qsTr("Close")
width: parent.width
color: UbuntuColors.green
onClicked: {
console.log("sheet accepted")
// settings.keepDisplayLit = cbKeepDisplayLit.checked
settings.ignoreArticle = cbIgnoreArticle.checked
// settings.changeVolumeOnCall = cbChangeVol.checked
// settings.volumeOnCall = slVolume.value
// settings.pauseMusicOnCall = cbPauseMusic.checked
// settings.pauseVideoOnCall = cbPauseVideo.checked
// settings.showCallNotifications = cbShowNotifications.checked
settings.musicEnabled = cbMusicEnabled.checked
settings.videosEnabled = cbVideosEnabled.checked
settings.picturesEnabled = cbPicturesEnabled.checked
settings.pvrEnabled = cbPvrEnabled.checked
PopupUtils.close(root)
}
}
}
}