Changeset View
Changeset View
Standalone View
Standalone View
package/contents/ui/CompactRepresentation.qml
Context not available. | |||||
48 | property color redshiftColour: '#ff3c0b' | 48 | property color redshiftColour: '#ff3c0b' | ||
---|---|---|---|---|---|
49 | property color brightnessColour: '#39a2ee' | 49 | property color brightnessColour: '#39a2ee' | ||
50 | 50 | | |||
51 | property string versionString: 'N/A' | ||||
52 | | ||||
51 | PlasmaCore.IconItem { | 53 | PlasmaCore.IconItem { | ||
52 | id: customIcon | 54 | id: customIcon | ||
53 | anchors.fill: parent | 55 | anchors.fill: parent | ||
Context not available. | |||||
136 | } | 138 | } | ||
137 | } | 139 | } | ||
138 | } | 140 | } | ||
139 | redshiftDS.connectedSources.push(redshiftOneTimeCommand) | 141 | if (parseFloat(versionString) >= 1.12) { | ||
142 | redshiftDS.connectedSources.push(redshiftOneTimeCommand + " -P") | ||||
143 | } else { | ||||
144 | redshiftDS.connectedSources.push(redshiftOneTimeCommand) | ||||
145 | } | ||||
140 | } | 146 | } | ||
141 | 147 | | |||
142 | onClicked: { | 148 | onClicked: { | ||
Context not available. | |||||
169 | } | 175 | } | ||
170 | } | 176 | } | ||
171 | 177 | | |||
178 | PlasmaCore.DataSource { | ||||
179 | id: getOptionsDS | ||||
180 | engine: 'executable' | ||||
181 | | ||||
182 | connectedSources: ['redshift -V'] | ||||
183 | | ||||
184 | onNewData: { | ||||
185 | connectedSources.length = 0 | ||||
186 | if (data['exit code'] > 0) { | ||||
187 | print('Error running redshift with command: ' + sourceName + ' ...stderr: ' + data.stderr) | ||||
188 | return | ||||
189 | } | ||||
190 | versionString = data.stdout.split(' ')[1] | ||||
191 | } | ||||
192 | } | ||||
172 | } | 193 | } | ||
Context not available. |