mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
update interface painting
This commit is contained in:
parent
634b4c3b41
commit
54583eae6e
@ -26,6 +26,8 @@ Item {
|
||||
id: aboutPage
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: NetctlAdds.isDebugEnabled()
|
||||
|
||||
@ -59,7 +61,6 @@ Item {
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
anchors.top: parent.top
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
font.capitalization: Font.SmallCaps
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
@ -258,17 +258,12 @@ Item {
|
||||
QtControls.Button {
|
||||
id: activeIconButton
|
||||
text: i18n("Browse")
|
||||
onClicked: {
|
||||
// FIXME: more clean directory definition
|
||||
var list = inactiveIcon.text.split('/')
|
||||
list.pop()
|
||||
activeFileDialog.folder = "/" + list.join('/')
|
||||
activeFileDialog.visible = true
|
||||
}
|
||||
onClicked: activeFileDialog.visible = true
|
||||
}
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: activeFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
nameFilters: [ "Image files (*.jpeg *.jpg *.png)", "All files (*)" ]
|
||||
selectExisting: true
|
||||
@ -295,17 +290,12 @@ Item {
|
||||
QtControls.Button {
|
||||
id: inactiveIconButton
|
||||
text: i18n("Browse")
|
||||
onClicked: {
|
||||
// FIXME: more clean directory definition
|
||||
var list = inactiveIcon.text.split('/')
|
||||
list.pop()
|
||||
inactiveFileDialog.folder = "/" + list.join('/')
|
||||
inactiveFileDialog.visible = true
|
||||
}
|
||||
onClicked: inactiveFileDialog.visible = true
|
||||
}
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: inactiveFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
nameFilters: [ "Image files (*.jpeg *.jpg *.png)", "All files (*)" ]
|
||||
selectExisting: true
|
||||
|
@ -19,6 +19,7 @@ import QtQuick 2.0
|
||||
import QtQuick.Controls 1.0 as QtControls
|
||||
import QtQuick.Dialogs 1.1 as QtDialogs
|
||||
import QtQuick.Layouts 1.0 as QtLayouts
|
||||
import QtQuick.Controls.Styles 1.3 as QtStyles
|
||||
|
||||
import org.kde.plasma.private.netctl 1.0
|
||||
|
||||
@ -27,6 +28,8 @@ Item {
|
||||
id: dataenginePage
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: NetctlAdds.isDebugEnabled()
|
||||
|
||||
@ -40,7 +43,7 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Path to netctl")
|
||||
@ -48,7 +51,7 @@ Item {
|
||||
QtControls.TextField {
|
||||
id: netctlPath
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - netctlPathButton.width
|
||||
width: parent.width * 3 / 5 - netctlPathButton.width
|
||||
text: cfg_dataengine["NETCTLCMD"]
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -59,6 +62,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: netctlFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -72,7 +76,7 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Path to netctl-auto")
|
||||
@ -80,7 +84,7 @@ Item {
|
||||
QtControls.TextField {
|
||||
id: netctlAutoPath
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - netctlAutoPathButton.width
|
||||
width: parent.width * 3 / 5 - netctlAutoPathButton.width
|
||||
text: cfg_dataengine["NETCTLAUTOCMD"]
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -91,6 +95,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: netctlAutoFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -102,18 +107,41 @@ Item {
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5 - extIp4.width
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Check external IPv4")
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: extIp4
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
text: i18n("Check external IPv4")
|
||||
width: implicitWidth
|
||||
checked: cfg_dataengine["EXTIP4"] == "true"
|
||||
style: QtStyles.CheckBoxStyle {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "darkblue" : "gray"
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
radius: 1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: "#555555"
|
||||
border.color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: extIp4Path
|
||||
enabled: extIp4.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - extIp4PathButton.width
|
||||
width: parent.width * 3 / 5 - extIp4PathButton.width
|
||||
text: cfg_dataengine["EXTIP4CMD"]
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -125,6 +153,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: extIp4FileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -136,18 +165,41 @@ Item {
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5 - extIp6.width
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Check external IPv6")
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: extIp6
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
text: i18n("Check external IPv6")
|
||||
width: implicitWidth
|
||||
checked: cfg_dataengine["EXTIP6"] == "true"
|
||||
style: QtStyles.CheckBoxStyle {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "darkblue" : "gray"
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
radius: 1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: "#555555"
|
||||
border.color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: extIp6Path
|
||||
enabled: extIp6.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - extIp6PathButton.width
|
||||
width: parent.width * 3 / 5 - extIp6PathButton.width
|
||||
text: cfg_dataengine["EXTIP6CMD"]
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -159,6 +211,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: extIp6FileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
|
@ -53,6 +53,7 @@ Item {
|
||||
"current": "N\\A",
|
||||
"extip4": "127.0.0.1",
|
||||
"extip6": "::1",
|
||||
"info": "N\\A",
|
||||
"intip4": "127.0.0.1",
|
||||
"intip6": "::1",
|
||||
"interfaces": "lo",
|
||||
|
@ -19,6 +19,7 @@ import QtQuick 2.0
|
||||
import QtQuick.Controls 1.3 as QtControls
|
||||
import QtQuick.Dialogs 1.1 as QtDialogs
|
||||
import QtQuick.Layouts 1.0 as QtLayouts
|
||||
import QtQuick.Controls.Styles 1.3 as QtStyles
|
||||
|
||||
import org.kde.plasma.private.netctl 1.0
|
||||
|
||||
@ -27,6 +28,8 @@ Item {
|
||||
id: widgetPage
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: NetctlAdds.isDebugEnabled()
|
||||
|
||||
@ -51,15 +54,14 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Auto update interval, msec")
|
||||
}
|
||||
QtControls.SpinBox {
|
||||
id: autoUpdate
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3
|
||||
width: parent.width * 3 / 5
|
||||
minimumValue: 1000
|
||||
maximumValue: 10000
|
||||
stepSize: 500
|
||||
@ -72,7 +74,7 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Path to GUI")
|
||||
@ -80,7 +82,7 @@ Item {
|
||||
QtControls.TextField {
|
||||
id: guiPath
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - guiPathButton.width
|
||||
width: parent.width * 3 / 5 - guiPathButton.width
|
||||
text: plasmoid.configuration.guiPath
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -91,6 +93,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: guiFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -102,17 +105,40 @@ Item {
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5 - useHelper.width
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Use helper")
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: useHelper
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
text: i18n("Use helper")
|
||||
width: implicitWidth
|
||||
style: QtStyles.CheckBoxStyle {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "darkblue" : "gray"
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
radius: 1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: "#555555"
|
||||
border.color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: helperPath
|
||||
enabled: useHelper.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - helperPathButton.width
|
||||
width: parent.width * 3 / 5 - helperPathButton.width
|
||||
text: plasmoid.configuration.helperPath
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -137,25 +163,28 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Path to netctl")
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: netctlPath
|
||||
enabled: !useHelper.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - netctlPathButton.width
|
||||
width: parent.width * 3 / 5 - netctlPathButton.width
|
||||
text: plasmoid.configuration.netctlPath
|
||||
}
|
||||
QtControls.Button {
|
||||
id: netctlPathButton
|
||||
enabled: !useHelper.checked
|
||||
text: i18n("Browse")
|
||||
onClicked: netctlFileDialog.visible = true
|
||||
}
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: netctlFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -169,25 +198,28 @@ Item {
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Path to netctl-auto")
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: netctlAutoPath
|
||||
enabled: !useHelper.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - netctlAutoPathButton.width
|
||||
width: parent.width * 3 / 5 - netctlAutoPathButton.width
|
||||
text: plasmoid.configuration.netctlAutoPath
|
||||
}
|
||||
QtControls.Button {
|
||||
id: netctlAutoPathButton
|
||||
enabled: !useHelper.checked
|
||||
text: i18n("Browse")
|
||||
onClicked: netctlAutoFileDialog.visible = true
|
||||
}
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: netctlAutoFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -199,17 +231,40 @@ Item {
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5 - useSudo.width
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Use sudo for netctl")
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: useSudo
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
text: i18n("Use sudo for netctl")
|
||||
width: implicitWidth
|
||||
style: QtStyles.CheckBoxStyle {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "darkblue" : "gray"
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
radius: 1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: "#555555"
|
||||
border.color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: sudoPath
|
||||
enabled: useSudo.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - sudoPathButton.width
|
||||
width: parent.width * 3 / 5 - sudoPathButton.width
|
||||
text: plasmoid.configuration.sudoPath
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -221,6 +276,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: sudoFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
@ -232,17 +288,40 @@ Item {
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5 - useWifi.width
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Show 'Start WiFi menu'")
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: useWifi
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
text: i18n("Show 'Start WiFi menu'")
|
||||
width: implicitWidth
|
||||
style: QtStyles.CheckBoxStyle {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "darkblue" : "gray"
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
radius: 1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: "#555555"
|
||||
border.color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QtControls.TextField {
|
||||
id: wifiPath
|
||||
enabled: useWifi.checked
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 3 - wifiPathButton.width
|
||||
width: parent.width * 3 / 5 - wifiPathButton.width
|
||||
text: plasmoid.configuration.wifiPath
|
||||
}
|
||||
QtControls.Button {
|
||||
@ -254,6 +333,7 @@ Item {
|
||||
|
||||
QtDialogs.FileDialog {
|
||||
id: wifiFileDialog
|
||||
modality: Qt.NonModal
|
||||
title: i18n("Select a path")
|
||||
folder: "/usr/bin"
|
||||
nameFilters: [ "All files (*)" ]
|
||||
|
Loading…
Reference in New Issue
Block a user