Skip to content

Commit

Permalink
feat(config): use tabs for data config
Browse files Browse the repository at this point in the history
  • Loading branch information
orblazer committed Nov 28, 2021
1 parent d6c27ff commit 19a3ea8
Showing 1 changed file with 63 additions and 43 deletions.
106 changes: 63 additions & 43 deletions package/contents/ui/config/ConfigData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,85 @@ import QtQuick 2.2
import QtQuick.Controls 2.12 as QtControls
import QtQuick.Layouts 1.1 as QtLayouts
import org.kde.kirigami 2.6 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents

import "../components"

Kirigami.FormLayout {
QtLayouts.ColumnLayout {
property alias cfg_memoryUseAllocated: memoryUseAllocated.checked
property alias cfg_memorySwapGraph: memorySwapGraph.checked
property alias cfg_networkSensorInterface: networkSensorInterface.text
property alias cfg_downloadMaxKBs: downloadMaxKBs.value
property alias cfg_uploadMaxKBs: uploadMaxKBs.value

PlasmaComponents.TabBar {
id: bar

Item {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n('Memory')
PlasmaComponents.TabButton {
tab: memoryPage
iconSource: 'memory-symbolic'
text: i18n('Memory')
}
PlasmaComponents.TabButton {
tab: networkPage
iconSource: 'preferences-system-network'
text: i18n('Network')
}
}

QtControls.CheckBox {
id: memoryUseAllocated
text: i18n('Use allocated memory instead of application')
}
PlasmaComponents.TabGroup {
QtLayouts.Layout.fillWidth: true
QtLayouts.Layout.fillHeight: true

QtControls.CheckBox {
id: memorySwapGraph
text: i18n('Display memory swap graph')
}
// Memory
Kirigami.FormLayout {
id: memoryPage

Item {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n('Network')
}
QtControls.CheckBox {
id: memoryUseAllocated
text: i18n('Use allocated memory instead of application')
}

QtControls.TextField {
id: networkSensorInterface
Kirigami.FormData.label: i18n('Specific network interface:')
QtLayouts.Layout.fillWidth: true
placeholderText: 'enp3s0'
onTextChanged: cfg_networkSensorInterface = text
QtControls.CheckBox {
id: memorySwapGraph
text: i18n('Display memory swap graph')
}
}

// Network
Kirigami.FormLayout {
id: networkPage

Accessible.name: QtControls.ToolTip.text
QtControls.ToolTip {
text: i18n("The network interface name (could pass \"all\" for every interfaces)")
QtControls.TextField {
id: networkSensorInterface
Kirigami.FormData.label: i18n('Specific network interface:')
QtLayouts.Layout.fillWidth: true
placeholderText: 'enp3s0'
onTextChanged: cfg_networkSensorInterface = text

Accessible.name: QtControls.ToolTip.text
QtControls.ToolTip {
text: i18n("The network interface name (could pass \"all\" for every interfaces)")
}
}
SpinBox {
id: downloadMaxKBs
Kirigami.FormData.label: i18n('Max download speed:')
QtLayouts.Layout.fillWidth: true
stepSize: 10
from: 10
to: 10000000
suffix: i18nc('Abbreviation for KB/s', ' KB/s')
}
SpinBox {
id: uploadMaxKBs
Kirigami.FormData.label: i18n('Max upload speed:')
QtLayouts.Layout.fillWidth: true
stepSize: 10
from: 10
to: 10000000
suffix: i18nc('Abbreviation for KB/s', ' KB/s')
}
}
}
SpinBox {
id: downloadMaxKBs
Kirigami.FormData.label: i18n('Max download speed:')
QtLayouts.Layout.fillWidth: true
stepSize: 10
from: 10
to: 10000000
suffix: i18nc('Abbreviation for KB/s', ' KB/s')
}
SpinBox {
id: uploadMaxKBs
Kirigami.FormData.label: i18n('Max upload speed:')
QtLayouts.Layout.fillWidth: true
stepSize: 10
from: 10
to: 10000000
suffix: i18nc('Abbreviation for KB/s', ' KB/s')
}
}

0 comments on commit 19a3ea8

Please sign in to comment.