| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2019 Marco Martin <[email protected]> |
| 3 |
SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <[email protected]> |
| 4 |
|
| 5 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 |
*/ |
| 7 |
|
| 8 |
import QtQuick |
| 9 |
import QtQuick.Layouts |
| 10 |
import QtQuick.Controls as QQC2 |
| 11 |
|
| 12 |
import org.kde.kirigami as Kirigami |
| 13 |
|
| 14 |
import org.kde.ksysguard.sensors as Sensors |
| 15 |
import org.kde.ksysguard.faces as Faces |
| 16 |
|
| 17 |
Kirigami.FormLayout { |
| 18 |
id: root |
| 19 |
|
| 20 |
property alias cfg_showLegend: showSensorsLegendCheckbox.checked |
| 21 |
property alias cfg_barChartStacked: stackedCheckbox.checked |
| 22 |
property alias cfg_showGridLines: showGridLinesCheckBox.checked |
| 23 |
property alias cfg_horizontalBars: horizontalBarsRadio.checked |
| 24 |
property alias cfg_showYAxisLabels: showYAxisLabelsCheckbox.checked |
| 25 |
|
| 26 |
property alias cfg_rangeAuto: rangeAutoCheckbox.checked |
| 27 |
property alias cfg_rangeFrom: rangeFromSpin.value |
| 28 |
property alias cfg_rangeFromUnit: rangeFromSpin.unit |
| 29 |
property alias cfg_rangeFromMultiplier: rangeFromSpin.multiplier |
| 30 |
property alias cfg_rangeTo: rangeToSpin.value |
| 31 |
property alias cfg_rangeToUnit: rangeToSpin.unit |
| 32 |
property alias cfg_rangeToMultiplier: rangeToSpin.multiplier |
| 33 |
|
| 34 |
QQC2.CheckBox { |
| 35 |
Kirigami.FormData.label: i18nc("@title:group General options", "General:") |
| 36 |
id: showSensorsLegendCheckbox |
| 37 |
text: i18nc("@option:check", "Show legend") |
| 38 |
} |
| 39 |
QQC2.CheckBox { |
| 40 |
id: stackedCheckbox |
| 41 |
text: i18nc("@option:check", "Stacked bars") |
| 42 |
} |
| 43 |
|
| 44 |
Item { |
| 45 |
Kirigami.FormData.isSection: true |
| 46 |
} |
| 47 |
|
| 48 |
QQC2.RadioButton { |
| 49 |
Kirigami.FormData.label: i18nc("@label for radiobutton group, Orientation of bar chart", "Bar orientation:") |
| 50 |
id: verticalBarsRadio |
| 51 |
text: i18nc("@option:radio Vertical option for the bar chart", "Vertical") |
| 52 |
checked: !cfg_horizontalBars |
| 53 |
} |
| 54 |
QQC2.RadioButton { |
| 55 |
id: horizontalBarsRadio |
| 56 |
text: i18nc("@option:radio Horizontal option for the bar chart", "Horizontal") |
| 57 |
onClicked: { |
| 58 |
showYAxisLabelsCheckbox.checked = false |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
Item { |
| 63 |
Kirigami.FormData.isSection: true |
| 64 |
} |
| 65 |
|
| 66 |
QQC2.CheckBox { |
| 67 |
Kirigami.FormData.label: i18nc("@label Options about axis and label of bar chart", "Axis:") |
| 68 |
id: showYAxisLabelsCheckbox |
| 69 |
text: i18nc("@option:check", "Show Y axis labels") |
| 70 |
enabled: !horizontalBarsRadio.checked |
| 71 |
} |
| 72 |
QQC2.CheckBox { |
| 73 |
id: showGridLinesCheckBox |
| 74 |
text: i18nc("@option:check", "Show grid lines") |
| 75 |
} |
| 76 |
QQC2.CheckBox { |
| 77 |
id: rangeAutoCheckbox |
| 78 |
text: i18nc("@option:check", "Automatic data range") |
| 79 |
} |
| 80 |
Faces.SensorRangeSpinBox { |
| 81 |
id: rangeFromSpin |
| 82 |
Kirigami.FormData.label: i18nc("@label:spinbox data range", "From:") |
| 83 |
Layout.preferredWidth: Kirigami.Units.gridUnit * 10 |
| 84 |
enabled: !rangeAutoCheckbox.checked |
| 85 |
sensors: controller.highPrioritySensorIds |
| 86 |
} |
| 87 |
Faces.SensorRangeSpinBox { |
| 88 |
id: rangeToSpin |
| 89 |
Kirigami.FormData.label: i18nc("@label:spinbox data range", "To:") |
| 90 |
Layout.preferredWidth: Kirigami.Units.gridUnit * 10 |
| 91 |
enabled: !rangeAutoCheckbox.checked |
| 92 |
sensors: controller.highPrioritySensorIds |
| 93 |
} |
| 94 |
} |
| 95 |
|