mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
massive qml controls replacement (#114)
This commit is contained in:
parent
8aa6d0c626
commit
80c994bce0
@ -0,0 +1,55 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* This file is part of awesome-widgets *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is free software: you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU General Public License as *
|
||||||
|
* published by the Free Software Foundation, either version 3 of the *
|
||||||
|
* License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 1.3 as QtControls
|
||||||
|
|
||||||
|
|
||||||
|
Row {
|
||||||
|
height: implicitHeight
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
property alias currentIndex: comboBox.currentIndex
|
||||||
|
property alias editable: comboBox.editable
|
||||||
|
property alias editText: comboBox.editText
|
||||||
|
property alias model: comboBox.model
|
||||||
|
property alias text: label.text
|
||||||
|
property string value
|
||||||
|
|
||||||
|
signal valueEdited(string newValue)
|
||||||
|
|
||||||
|
QtControls.Label {
|
||||||
|
id: label
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 2 / 5
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
QtControls.ComboBox {
|
||||||
|
id: comboBox
|
||||||
|
width: parent.width * 3 / 5
|
||||||
|
textRole: 'label'
|
||||||
|
onCurrentIndexChanged: valueEdited(comboBox.model[comboBox.currentIndex]['name'])
|
||||||
|
Component.onCompleted: {
|
||||||
|
var total = comboBox.model.length
|
||||||
|
for (var i = 0; i < total; i++) {
|
||||||
|
if (comboBox.model[i]["name"] == value)
|
||||||
|
comboBox.currentIndex = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* This file is part of awesome-widgets *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is free software: you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU General Public License as *
|
||||||
|
* published by the Free Software Foundation, either version 3 of the *
|
||||||
|
* License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 1.3 as QtControls
|
||||||
|
|
||||||
|
|
||||||
|
Row {
|
||||||
|
height: implicitHeight
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
property alias text: label.text
|
||||||
|
property alias value: spinBox.value
|
||||||
|
|
||||||
|
property alias maximumValue: spinBox.maximumValue
|
||||||
|
property alias minimumValue: spinBox.minimumValue
|
||||||
|
property alias stepSize: spinBox.stepSize
|
||||||
|
|
||||||
|
signal valueEdited(int newValue)
|
||||||
|
|
||||||
|
QtControls.Label {
|
||||||
|
id: label
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 2 / 5
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
QtControls.SpinBox {
|
||||||
|
id: spinBox
|
||||||
|
width: parent.width * 3 / 5
|
||||||
|
onEditingFinished: valueEdited(spinBox.value)
|
||||||
|
}
|
||||||
|
}
|
43
sources/awesome-widget/package/contents/ui/LineSelector.qml
Normal file
43
sources/awesome-widget/package/contents/ui/LineSelector.qml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* This file is part of awesome-widgets *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is free software: you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU General Public License as *
|
||||||
|
* published by the Free Software Foundation, either version 3 of the *
|
||||||
|
* License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* awesome-widgets is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 1.3 as QtControls
|
||||||
|
|
||||||
|
|
||||||
|
Row {
|
||||||
|
height: implicitHeight
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
property alias text: label.text
|
||||||
|
property alias value: textField.text
|
||||||
|
|
||||||
|
signal valueEdited(string newValue)
|
||||||
|
|
||||||
|
QtControls.Label {
|
||||||
|
id: label
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 2 / 5
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
QtControls.TextField {
|
||||||
|
id: textField
|
||||||
|
width: parent.width * 3 / 5
|
||||||
|
onEditingFinished: valueEdited(textField.text)
|
||||||
|
}
|
||||||
|
}
|
@ -50,11 +50,11 @@ Item {
|
|||||||
property alias cfg_width: widgetWidth.value
|
property alias cfg_width: widgetWidth.value
|
||||||
property alias cfg_interval: update.value
|
property alias cfg_interval: update.value
|
||||||
property alias cfg_queueLimit: queueLimit.value
|
property alias cfg_queueLimit: queueLimit.value
|
||||||
property string cfg_tempUnits: tempUnits.currentText
|
property string cfg_tempUnits: tempUnits.value
|
||||||
property alias cfg_customTime: customTime.text
|
property alias cfg_customTime: customTime.value
|
||||||
property alias cfg_customUptime: customUptime.text
|
property alias cfg_customUptime: customUptime.value
|
||||||
property alias cfg_acOnline: acOnline.text
|
property alias cfg_acOnline: acOnline.value
|
||||||
property alias cfg_acOffline: acOffline.text
|
property alias cfg_acOffline: acOffline.value
|
||||||
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@ -96,100 +96,44 @@ Item {
|
|||||||
text: i18n("Optimize subscription")
|
text: i18n("Optimize subscription")
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Widget height, px")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: widgetHeight
|
id: widgetHeight
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 0
|
|
||||||
maximumValue: 4096
|
maximumValue: 4096
|
||||||
|
minimumValue: 0
|
||||||
stepSize: 50
|
stepSize: 50
|
||||||
|
text: i18n("Widget height, px")
|
||||||
value: plasmoid.configuration.height
|
value: plasmoid.configuration.height
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Widget width, px")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: widgetWidth
|
id: widgetWidth
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 0
|
|
||||||
maximumValue: 4096
|
maximumValue: 4096
|
||||||
|
minimumValue: 0
|
||||||
stepSize: 50
|
stepSize: 50
|
||||||
|
text: i18n("Widget width, px")
|
||||||
value: plasmoid.configuration.width
|
value: plasmoid.configuration.width
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Time interval")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: update
|
id: update
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 1000
|
|
||||||
maximumValue: 10000
|
maximumValue: 10000
|
||||||
|
minimumValue: 1000
|
||||||
stepSize: 500
|
stepSize: 500
|
||||||
|
text: i18n("Time interval")
|
||||||
value: plasmoid.configuration.interval
|
value: plasmoid.configuration.interval
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Messages queue limit")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: queueLimit
|
id: queueLimit
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 0
|
|
||||||
maximumValue: 99
|
maximumValue: 99
|
||||||
|
minimumValue: 0
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
|
text: i18n("Messages queue limit")
|
||||||
value: plasmoid.configuration.queueLimit
|
value: plasmoid.configuration.queueLimit
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Temperature units")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: tempUnits
|
id: tempUnits
|
||||||
width: parent.width * 3 / 5
|
|
||||||
textRole: "label"
|
|
||||||
model: [
|
model: [
|
||||||
{
|
{
|
||||||
'label': i18n("Celsius"),
|
'label': i18n("Celsius"),
|
||||||
@ -220,85 +164,33 @@ Item {
|
|||||||
'name': "kcal/mol"
|
'name': "kcal/mol"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onCurrentIndexChanged: cfg_tempUnits = model[currentIndex]["name"]
|
text: i18n("Temperature units")
|
||||||
Component.onCompleted: {
|
value: plasmoid.configuration.tempUnits
|
||||||
if (debug) console.debug()
|
onValueEdited: cfg_tempUnits = newValue
|
||||||
for (var i = 0; i < model.length; i++) {
|
|
||||||
if (model[i]["name"] == plasmoid.configuration.tempUnits) {
|
|
||||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
|
||||||
tempUnits.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Custom time format")
|
|
||||||
}
|
|
||||||
QtControls.TextField {
|
|
||||||
id: customTime
|
id: customTime
|
||||||
width: parent.width * 3 / 5
|
text: i18n("Custom time format")
|
||||||
text: plasmoid.configuration.customTime
|
value: plasmoid.configuration.customTime
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Custom uptime format")
|
|
||||||
}
|
|
||||||
QtControls.TextField {
|
|
||||||
id: customUptime
|
id: customUptime
|
||||||
width: parent.width * 3 / 5
|
text: i18n("Custom uptime format")
|
||||||
text: plasmoid.configuration.customUptime
|
value: plasmoid.configuration.customUptime
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("AC online tag")
|
|
||||||
}
|
|
||||||
QtControls.TextField {
|
|
||||||
id: acOnline
|
id: acOnline
|
||||||
width: parent.width * 3 / 5
|
text: i18n("AC online tag")
|
||||||
text: plasmoid.configuration.acOnline
|
value: plasmoid.configuration.acOnline
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("AC offline tag")
|
|
||||||
}
|
|
||||||
QtControls.TextField {
|
|
||||||
id: acOffline
|
id: acOffline
|
||||||
width: parent.width * 3 / 5
|
text: i18n("AC offline tag")
|
||||||
text: plasmoid.configuration.acOffline
|
value: plasmoid.configuration.acOffline
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
@ -46,11 +46,11 @@ Item {
|
|||||||
|
|
||||||
property alias cfg_fontFamily: selectFont.text
|
property alias cfg_fontFamily: selectFont.text
|
||||||
property alias cfg_fontSize: fontSize.value
|
property alias cfg_fontSize: fontSize.value
|
||||||
property string cfg_fontWeight: fontWeight.currentText
|
property string cfg_fontWeight: fontWeight.value
|
||||||
property string cfg_fontStyle: fontStyle.currentText
|
property string cfg_fontStyle: fontStyle.value
|
||||||
property alias cfg_fontColor: selectColor.text
|
property alias cfg_fontColor: selectColor.text
|
||||||
property alias cfg_textStyleColor: selectStyleColor.text
|
property alias cfg_textStyleColor: selectStyleColor.text
|
||||||
property string cfg_textStyle: textStyle.currentText
|
property string cfg_textStyle: textStyle.value
|
||||||
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@ -78,40 +78,17 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width / 3
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Font size")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: fontSize
|
id: fontSize
|
||||||
width: parent.width * 2 / 3
|
|
||||||
minimumValue: 8
|
|
||||||
maximumValue: 32
|
maximumValue: 32
|
||||||
|
minimumValue: 8
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
|
text: i18n("Font size")
|
||||||
value: plasmoid.configuration.fontSize
|
value: plasmoid.configuration.fontSize
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width / 3
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Font weight")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: fontWeight
|
id: fontWeight
|
||||||
width: parent.width * 2 / 3
|
|
||||||
textRole: "label"
|
|
||||||
model: [
|
model: [
|
||||||
{
|
{
|
||||||
'label': i18n("light"),
|
'label': i18n("light"),
|
||||||
@ -134,33 +111,13 @@ Item {
|
|||||||
'name': "black"
|
'name': "black"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
|
text: i18n("Font weight")
|
||||||
Component.onCompleted: {
|
value: plasmoid.configuration.fontWeight
|
||||||
if (debug) console.debug()
|
onValueEdited: cfg_fontWeight = newValue
|
||||||
for (var i = 0; i < model.length; i++) {
|
|
||||||
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
|
|
||||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
|
||||||
fontWeight.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width / 3
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Font style")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: fontStyle
|
id: fontStyle
|
||||||
width: parent.width * 2 / 3
|
|
||||||
textRole: "label"
|
|
||||||
model: [
|
model: [
|
||||||
{
|
{
|
||||||
'label': i18n("normal"),
|
'label': i18n("normal"),
|
||||||
@ -171,17 +128,9 @@ Item {
|
|||||||
'name': "italic"
|
'name': "italic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
|
text: i18n("Font style")
|
||||||
Component.onCompleted: {
|
value: plasmoid.configuration.fontStyle
|
||||||
if (debug) console.debug()
|
onValueEdited: cfg_fontStyle = newValue
|
||||||
for (var i = 0; i < model.length; i++) {
|
|
||||||
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
|
|
||||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
|
||||||
fontStyle.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
@ -207,20 +156,8 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width / 3
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Style")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: textStyle
|
id: textStyle
|
||||||
width: parent.width * 2 / 3
|
|
||||||
textRole: "label"
|
|
||||||
model: [
|
model: [
|
||||||
{
|
{
|
||||||
'label': i18n("normal"),
|
'label': i18n("normal"),
|
||||||
@ -239,17 +176,9 @@ Item {
|
|||||||
'name': "sunken"
|
'name': "sunken"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onCurrentIndexChanged: cfg_textStyle = model[currentIndex]["name"]
|
text: i18n("Style")
|
||||||
Component.onCompleted: {
|
value: plasmoid.configuration.textStyle
|
||||||
if (debug) console.debug()
|
onValueEdited: cfg_textStyle = newValue
|
||||||
for (var i = 0; i < model.length; i++) {
|
|
||||||
if (model[i]["name"] == plasmoid.configuration.textStyle) {
|
|
||||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
|
||||||
textStyle.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
@ -52,21 +52,10 @@ Item {
|
|||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("ACPI")
|
title: i18n("ACPI")
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("ACPI path")
|
text: i18n("ACPI path")
|
||||||
}
|
value: cfg_dataengine["ACPIPATH"]
|
||||||
QtControls.TextField {
|
onValueEdited: cfg_dataengine["ACPIPATH"] = newValue
|
||||||
width: parent.width * 3 / 5
|
|
||||||
text: cfg_dataengine["ACPIPATH"]
|
|
||||||
onEditingFinished: cfg_dataengine["ACPIPATH"] = text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,30 +63,28 @@ Item {
|
|||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("GPU")
|
title: i18n("GPU")
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
model: [
|
||||||
width: parent.width
|
{
|
||||||
QtControls.Label {
|
'label': "auto",
|
||||||
height: parent.height
|
'name': "auto"
|
||||||
width: parent.width * 2 / 5
|
},
|
||||||
horizontalAlignment: Text.AlignRight
|
{
|
||||||
verticalAlignment: Text.AlignVCenter
|
'label': "disable",
|
||||||
|
'name': "disable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': "ati",
|
||||||
|
'name': "ati"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': "nvidia",
|
||||||
|
'name': "nvidia"
|
||||||
|
}
|
||||||
|
]
|
||||||
text: i18n("GPU device")
|
text: i18n("GPU device")
|
||||||
}
|
value: cfg_dataengine["GPUDEV"]
|
||||||
QtControls.ComboBox {
|
onValueEdited: cfg_dataengine["GPUDEV"] = newValue
|
||||||
id: gpuDev
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
model: ["auto", "disable", "ati", "nvidia"]
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (debug) console.debug()
|
|
||||||
for (var i=0; i<model.length; i++) {
|
|
||||||
if (model[i] == cfg_dataengine["GPUDEV"]) {
|
|
||||||
if (debug) console.info("Found", model[i], "on", i)
|
|
||||||
currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,37 +95,17 @@ Item {
|
|||||||
Column {
|
Column {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("HDD")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: hdd
|
id: hdd
|
||||||
width: parent.width * 3 / 5
|
text: i18n("HDD")
|
||||||
}
|
value: cfg_dataengine["HDDDEV"]
|
||||||
|
onValueEdited: cfg_dataengine["HDDDEV"] = newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("hddtemp cmd")
|
text: i18n("hddtemp cmd")
|
||||||
}
|
value: cfg_dataengine["HDDTEMPCMD"]
|
||||||
QtControls.TextField {
|
onValueEdited: cfg_dataengine["HDDTEMPCMD"] = newValue
|
||||||
width: parent.width * 3 / 5
|
|
||||||
text: cfg_dataengine["HDDTEMPCMD"]
|
|
||||||
onEditingFinished: cfg_dataengine["HDDTEMPCMD"] = text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,107 +117,93 @@ Item {
|
|||||||
Column {
|
Column {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Player data symbols")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 1
|
|
||||||
maximumValue: 100
|
maximumValue: 100
|
||||||
|
minimumValue: 1
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
|
text: i18n("Player data symbols")
|
||||||
value: cfg_dataengine["PLAYERSYMBOLS"]
|
value: cfg_dataengine["PLAYERSYMBOLS"]
|
||||||
onEditingFinished: cfg_dataengine["PLAYERSYMBOLS"] = value
|
onValueEdited: cfg_dataengine["PLAYERSYMBOLS"] = newValue
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
model: [
|
||||||
width: parent.width
|
{
|
||||||
QtControls.Label {
|
'label': "disable",
|
||||||
height: parent.height
|
'name': "disable"
|
||||||
width: parent.width * 2 / 5
|
},
|
||||||
horizontalAlignment: Text.AlignRight
|
{
|
||||||
verticalAlignment: Text.AlignVCenter
|
'label': "mpris",
|
||||||
|
'name': "mpris"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': "mpd",
|
||||||
|
'name': "mpd"
|
||||||
|
}
|
||||||
|
]
|
||||||
text: i18n("Music player")
|
text: i18n("Music player")
|
||||||
}
|
value: cfg_dataengine["PLAYER"]
|
||||||
QtControls.ComboBox {
|
onValueEdited: cfg_dataengine["PLAYER"] = newValue
|
||||||
id: player
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
model: ["disable", "mpris", "mpd"]
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (debug) console.debug()
|
|
||||||
for (var i=0; i<model.length; i++) {
|
|
||||||
if (model[i] == cfg_dataengine["PLAYER"]) {
|
|
||||||
if (debug) console.info("Found", model[i], "on", i)
|
|
||||||
player.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
ComboBoxSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("MPRIS player name")
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: mpris
|
id: mpris
|
||||||
width: parent.width * 3 / 5
|
|
||||||
editable: true
|
editable: true
|
||||||
model: ["auto", "amarok", "audacious", "clementine", "deadbeef",
|
model: [
|
||||||
"vlc", "qmmp", "xmms2", cfg_dataengine["MPRIS"]]
|
{
|
||||||
|
'label': 'auto',
|
||||||
|
'name': 'auto'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'amarok',
|
||||||
|
'name': 'amarok'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'audacious',
|
||||||
|
'name': 'audacious'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'clementine',
|
||||||
|
'name': 'clementine'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'deadbeef',
|
||||||
|
'name': 'deadbeef'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'vlc',
|
||||||
|
'name': 'vlc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'qmmp',
|
||||||
|
'name': 'qmmp'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'xmms2',
|
||||||
|
'name': 'xmms2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': cfg_dataengine["MPRIS"],
|
||||||
|
'name': cfg_dataengine["MPRIS"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
text: i18n("MPRIS player name")
|
||||||
currentIndex: model.length - 1
|
currentIndex: model.length - 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
LineSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("MPD address")
|
text: i18n("MPD address")
|
||||||
}
|
value: cfg_dataengine["MPDADDRESS"]
|
||||||
QtControls.TextField {
|
onValueEdited: cfg_dataengine["MPDADDRESS"] = newValue
|
||||||
width: parent.width * 3 / 5
|
|
||||||
text: cfg_dataengine["MPDADDRESS"]
|
|
||||||
onEditingFinished: cfg_dataengine["MPDADDRESS"] = text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("MPD port")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 1000
|
|
||||||
maximumValue: 65535
|
maximumValue: 65535
|
||||||
|
minimumValue: 1000
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
|
text: i18n("MPD port")
|
||||||
value: cfg_dataengine["MPDPORT"]
|
value: cfg_dataengine["MPDPORT"]
|
||||||
onEditingFinished: cfg_dataengine["MPDPORT"] = value
|
onValueEdited: cfg_dataengine["MPDPORT"] = newValue
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -342,21 +295,13 @@ Item {
|
|||||||
|
|
||||||
// update hdd model
|
// update hdd model
|
||||||
hdd.model = awKeys.getHddDevices()
|
hdd.model = awKeys.getHddDevices()
|
||||||
for (var i=0; i<hdd.model.length; i++) {
|
hdd.onCompleted
|
||||||
if (hdd.model[i] == cfg_dataengine["HDDDEV"]) {
|
|
||||||
if (debug) console.info("Found", hdd.model[i], "on", i)
|
|
||||||
hdd.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
if (debug) console.debug()
|
if (debug) console.debug()
|
||||||
|
|
||||||
cfg_dataengine["GPUDEV"] = gpuDev.currentText
|
cfg_dataengine["MPRIS"] = mpris.editText
|
||||||
cfg_dataengine["HDDDEV"] = hdd.currentText
|
|
||||||
cfg_dataengine["PLAYER"] = player.currentText
|
|
||||||
cfg_dataengine["MPRIS"] = mpris.currentText
|
|
||||||
awConfig.writeDataEngineConfiguration(cfg_dataengine)
|
awConfig.writeDataEngineConfiguration(cfg_dataengine)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
singleton general 1.0 general.qml
|
singleton general 1.0 general.qml
|
||||||
BugReport ./BugReport.qml
|
BugReport ./BugReport.qml
|
||||||
CheckBoxSelector ./CheckBoxSelector.qml
|
CheckBoxSelector ./CheckBoxSelector.qml
|
||||||
|
ComboBoxSelector ./ComboBoxSelector.qml
|
||||||
|
IntegerSelector ./IntegerSelector.qml
|
||||||
|
LineSelector ./LineSelector.qml
|
||||||
|
@ -67,25 +67,14 @@ Item {
|
|||||||
text: i18n("CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make needed checkbox checked.")
|
text: i18n("CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make needed checkbox checked.")
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
IntegerSelector {
|
||||||
height: implicitHeight
|
|
||||||
width: parent.width
|
|
||||||
QtControls.Label {
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width * 2 / 5
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
text: i18n("Number of values for tooltips")
|
|
||||||
}
|
|
||||||
QtControls.SpinBox {
|
|
||||||
id: tooltipNumber
|
id: tooltipNumber
|
||||||
width: parent.width * 3 / 5
|
|
||||||
minimumValue: 50
|
|
||||||
maximumValue: 1000
|
maximumValue: 1000
|
||||||
|
minimumValue: 50
|
||||||
stepSize: 25
|
stepSize: 25
|
||||||
|
text: i18n("Number of values for tooltips")
|
||||||
value: plasmoid.configuration.tooltipNumber
|
value: plasmoid.configuration.tooltipNumber
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
QtControls.GroupBox {
|
QtControls.GroupBox {
|
||||||
id: useTooltipBackground
|
id: useTooltipBackground
|
||||||
|
@ -153,12 +153,21 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList AWKeys::getHddDevices() const
|
QVariantList AWKeys::getHddDevices() const
|
||||||
{
|
{
|
||||||
QStringList devices = m_keyOperator->devices(QString("hdd"));
|
QStringList hddDevices = m_keyOperator->devices(QString("hdd"));
|
||||||
// required by selector in the UI
|
// required by selector in the UI
|
||||||
devices.insert(0, QString("disable"));
|
hddDevices.insert(0, QString("disable"));
|
||||||
devices.insert(0, QString("auto"));
|
hddDevices.insert(0, QString("auto"));
|
||||||
|
|
||||||
|
// build model
|
||||||
|
QVariantList devices;
|
||||||
|
for (auto device : hddDevices) {
|
||||||
|
QVariantMap model;
|
||||||
|
model[QString("label")] = device;
|
||||||
|
model[QString("name")] = device;
|
||||||
|
devices.append(model);
|
||||||
|
}
|
||||||
|
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
// keys
|
// keys
|
||||||
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
|
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
|
||||||
const QString regexp = QString()) const;
|
const QString regexp = QString()) const;
|
||||||
Q_INVOKABLE QStringList getHddDevices() const;
|
Q_INVOKABLE QVariantList getHddDevices() const;
|
||||||
// values
|
// values
|
||||||
Q_INVOKABLE QString infoByKey(QString key) const;
|
Q_INVOKABLE QString infoByKey(QString key) const;
|
||||||
Q_INVOKABLE QString valueByKey(QString key) const;
|
Q_INVOKABLE QString valueByKey(QString key) const;
|
||||||
|
@ -72,7 +72,7 @@ void TestAWKeys::cleanupTestCase()
|
|||||||
|
|
||||||
void TestAWKeys::test_hddDevices()
|
void TestAWKeys::test_hddDevices()
|
||||||
{
|
{
|
||||||
QVERIFY(!plugin->getHddDevices().isEmpty());
|
QVERIFY(plugin->getHddDevices().count() > 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user